Pressing a Key - Question
#1

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.
Reply
#2

Use OnPlayerKeyStateChange callback
Note: You can't use all the keys, just the supported keys
Reply
#3

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.
Reply
#4

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
Reply
#5

There are no detectable function keys, the only keys available are the ones on the key map: https://sampwiki.blast.hk/wiki/Keys.
Reply
#6

So then... anyone has any idea of how to counter the vehicle teleporting ? Without interfering with my /getcar command of course..
Reply
#7

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


Forum Jump:


Users browsing this thread: 2 Guest(s)