Forum

> > CS2D > Scripts > Mouse -> img
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Mouse -> img

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Mouse -> img

Good day
User Off Offline

Zitieren
Hi all, I'm just a beginner and can not do it.
When the mouse pointer is on the coordinates (example x=1 y=1), the image is presented on the mouse pointer.
if the value of x is not equal to unity, then remove the image. Thx very much. Sry, my English is bad. D=

alt Re: Mouse -> img

Rainoth
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
img = image("path/of/the/image.png",0,0,0)
imagealpha(img,0)

addhook("ms100","a")
function a()
	for _,id in pairs (player(0,"table")) do
		reqcld(id,2)
	end
end

addhook("clientdata","b")
function b(id,mode,d1,d2)
	if mode == 2 then
		local tx = math.floor(d1/32)
		local ty = math.floor(d2/32)
		if tx == 1 and ty == 1 then
			imagealpha(img,1)
		else
			imagealpha(img,2)
		end
	end
end

Not the best method but my brain refuses to think right now so you'll have to do with this.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht