Forum

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

Englisch Mouse position

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Mouse position

Apache uwu
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("always","_always")
addhook("clientdata","_clientdata")

function _always()
	reqcld(0,2)
end

mouse={}

function _clientdata(id,_mode,data1,data2)
	if _mode==2 then
		mouse[id]={data1,data2}
	end
end

Now mouse[id][1] is X position on the map, and mouse[id][2] is Y position on the map.

alt Re: Mouse position

DC
Admin Off Offline

Zitieren
There's also a great example for that included in CS2D. It displays the cursors of all players:
sys/lua/samples/cursors.lua
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht