get time for a pressed key?
#1

how can i get for how many secs a key is pressed?
does this have to do with gettickcount??
Reply
#2

cmon, i need this noww
Reply
#3

You could use something like this with some tweaking.

pawn Код:
IsKeyJustDown(key, newkeys, oldkeys)
{
    if((newkeys & key) && !(oldkeys & key)) return 1;
    return 0;
}
Peace...
Reply
#4

Use timers and check when a key is released
Reply
#5

Save the result of GetTickCount() in a PVar when the player presses the key. When the play releases the key again, get the result of GetTickCount() again and subtract the value you saved in the PVar off of it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)