Forum

> > CS2D > Scripts > Mouse position
Forums overviewCS2D overview Scripts overviewLog in to reply

English Mouse position

2 replies
To the start Previous 1 Next To the start

old Re: Mouse position

Apache uwu
User Off Offline

Quote
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.

old Re: Mouse position

DC
Admin Off Offline

Quote
There's also a great example for that included in CS2D. It displays the cursors of all players:
sys/lua/samples/cursors.lua
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview