SA-MP Forums Archive
fixed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: fixed (/showthread.php?tid=112598)



fixed - Mikep. - 08.12.2009

fixed


Re: Array. - Abernethy - 08.12.2009

I believe arrow keys can only be detected in a timer..


Re: Array. - Correlli - 08.12.2009

Quote:
Originally Posted by Aberâ–²
I believe arrow keys can only be detected in a timer..
OnPlayerUpdate is faster than any timer.


Re: Array. - Mikep. - 08.12.2009

GetPlayerKeys isn't for timers only. Anyway it's not the key detection.

The code gets to that part.


Re: Array. - yom - 08.12.2009

Quote:
Originally Posted by Don Correlli
OnPlayerUpdate is faster than any timer.
In which way it is faster? Or, how can you even compare a callback and a timer? They are totally different things.


Re: Array. - Mikep. - 08.12.2009

Forget the timers, the key detected works 100% perfect.


Re: Array. - Correlli - 08.12.2009

Quote:
Originally Posted by 0rb
In which way it is faster?
I meant that it's called more often than any timer you set.

Quote:
Originally Posted by 0rb
Or, how can you even compare a callback and a timer? They are totally different things.
I never compared them.


Re: Array. - Joe Staff - 08.12.2009

Quote:
Originally Posted by Don Correlli
OnPlayerUpdate is faster than any timer.
That's a comparison
"Callback > Timer"

What about the script doesn't work? Have you debugged it? You said that the keys are being detected, does that mean that pSkin[playerid] is being incremented? Try adding a buffer size to "new CopSkins[]" for testing.


Re: Array. - Mikep. - 08.12.2009

I will do some proper debugging.

EDIT:

Wow, I was setting pSkin to 281 by default LOL D:

Thanks for the help guys..


Re: Array. - Finn - 08.12.2009

Quote:
Originally Posted by 0rb
In which way it is faster? Or, how can you even compare a callback and a timer? They are totally different things.
Timer is not as accurate in getting i.e. keys of the players, unlike with OnPlayerUpdate you'll be able to detect all the changes that happens to the player.

I wouldn't suggest using OnPlayerUpdate, as it's proven that it'll cause lag (if has big piles of code in it) when used while loads of players connected. Timer set to 100 ms or such will do the same thing.