Keys Update?
#1

How much time of 'update' while i press 2 keys without leave the pressing ?
I mean, if i press 2 keys, the game will call again the onplayerkeystatechange if i leave and press again or too if i continue pressing, but after how many seconds??

Do i need to use GetPlayerKeys(playerid,Keys,ud,lr) or can i only use keystate public ?

P.S: Sorry for my bad english.

Thanks.
Reply
#2

You can use OnPlayerKeyStateChange in all cases (if pressing, if pressed, if pressed and release)
and you can even detect for how long the key has been pressed by using a timer.
you can learn all abt that public Here
Reply
#3

Nope, the callback is only called when the state of the keys changes. If you want to do stuff when the player is holding a key you need to set a timer when they first press the key and kill the timer when they release it.
Reply
#4

How can i do that? Just an example.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)