Forum

> > CS2D > Scripts > reqcld and pointer "catch"
Forums overviewCS2D overview Scripts overviewLog in to reply

English reqcld and pointer "catch"

4 replies
To the start Previous 1 Next To the start

old reqcld and pointer "catch"

scriptmen
User Off Offline

Quote
hello! I have a simple question and hope you'll help

I want to know more about reqcld function, about its modes and the way it works, or just give a link to page where i can get this information

and one more thing - is it real to "catch" the player's pointer position? and use it for example for such things as if you move your pointer over some image it changes color or a message appear or something like that

hope you'll help, thanks

old Re: reqcld and pointer "catch"

omg
User Off Offline

Quote
what do u mean its "real"?
reqcld literally requests client data. when the client receives a reqcld, it sends the requested info back to the server (ex. clients current cursor position)

reqcld works together with clientdata. server sends some reqcld, a hook on clientdata manages what to do with the data

old Re: reqcld and pointer "catch"

EngiN33R
Moderator Off Offline

Quote
cs2d lua cmd reqcld.
Syntax: reqcld(id,mode)

For handling pointer positions you'll need modes 0 and 2 - local screen position and global map position, respectively. It returns the current position, so to continuously update it you should put it in a time hook like ms100 or always.

I don't even know what mode 1 (map scrolling) does, mode 3 returns 1 or 0 if a player has or hasn't enabled the lighting engine, I'm also not sure what files mode 4 returns the loaded state of.

To handle the data sent by cs2d lua cmd reqcld, you need the cs2d lua hook clientdata hook.

old Re: reqcld and pointer "catch"

DC
Admin Off Offline

Quote
1 is the map scrolling offset in pixels. It changes whenever a client moves on the map or scrolls the map as spectator.

4 returns 1 if a certain image/audio file as been loaded. This will only work for files used in entities or put in the servertransfer.lst. This is very useful if you are using sprites/sounds which are essential for gameplay (maybe camouflage skins or sprites that darken the screen). You can check if all players actually downloaded the files (they may not have loaded them due to their download preferences). You can then kick them for instance or don't let them join a team or stuff like that (this feature has actually been requested by some users so I added it).
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview