Forum

> > CS2D > Scripts > bind error
Forums overviewCS2D overview Scripts overviewLog in to reply

English bind error

5 replies
To the start Previous 1 Next To the start

old bind error

scriptmen
User Off Offline

Quote
so I was trying to solve the problem with key pressing , because, as I understood there are no such hooks as "key", "keypress" and so on. an I found a solution - binds.
bind some key to say !12121 and then addhook say - if text=="!12121" then.....

but I found a strange problem .
look, I have a simple script:

addhook("join","bb")
function bb(id)
parse ('bind "h" "sayteam !lol"')
end

and the problem is that only server says !lol after pressing "h". all other players ignore the bind. can anybody tell where the problem is?

old Re: bind error

DC
Admin Off Offline

Quote
Lua scripts are executed on the server only which automatically means that the binds are executed for the server only. You can't remotely change the binds of clients (or execute other CS2D - non Lua - coammands remotely at clients). This is a security measurement because otherwise the server would be able to f*ck the whole controls of the client up which would be a pretty stupid thing.

Your idea works but the clients have to do the binding themselves. Manually.

old Re: bind error

scriptmen
User Off Offline

Quote
and what about aliases ? bind in alias and working with aliases in lua script
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview