Pressing a Key - Question -
rappy93 - 24.10.2013
Hello SA-MP community. I have a question about key pressing in SA-MP and how does the server work around it. For example, I want to make a script so that when a player pressed the key f11 the server would send a message to all players. I know how to make the message part,but how do I work around the key pressing part ? Looked a bit on the wiki but I couldn't figure it out.
Anyone has some suggestions ? I'd appreciate it and I will +rep those who help me,in any way.
Thanks and hopefully you can help me.
Re: Pressing a Key - Question -
xVIP3Rx - 24.10.2013
Use
OnPlayerKeyStateChange callback
Note: You can't use all the keys, just the
supported keys
Re: Pressing a Key - Question -
rappy93 - 24.10.2013
So , is F11 one of em ? Can't see it there, and I dont really understand that page.
I need this so that I can counter some guys who use s0b to
teleport cars,change their color,spam and many more things on my server. They forced us to close it for today because they kept on connecting after getting banned .. cuz of dynamic IPs,curse them.
So please,if anyone has any suggestions about keys or those problems above,please help.
Re: Pressing a Key - Question -
AIped - 24.10.2013
f11 doesnt belong to it, there is a list of keys you can use like the other guys said.
for example; pressing vehicle enter/exit is F by default. but scriptwise this key is 16 you can find it again in the wiki. Try to understand
Re: Pressing a Key - Question -
DanishHaq - 24.10.2013
There are no detectable function keys, the only keys available are the ones on the key map:
https://sampwiki.blast.hk/wiki/Keys.
Re: Pressing a Key - Question -
rappy93 - 24.10.2013
So then... anyone has any idea of how to counter the vehicle teleporting ? Without interfering with my /getcar command of course..
Re: Pressing a Key - Question -
DanishHaq - 24.10.2013
Quote:
Originally Posted by rappy93
So then... anyone has any idea of how to counter the vehicle teleporting ? Without interfering with my /getcar command of course..
|
Could try and GetVehicleVelocity under OnPlayerUpdate. If they're going faster than 500km/h, could be speed hack / possible tp.