Arrest Key ...(Cops And Robbers)
#3

For about the million time,keys NEVER check with '==' .
Use '&' to check for keys.
pawn Код:
if(newkeys & KEY_SUBMISSION)
Quote:
Originally Posted by sa-mp wiki
How NOT to check for a key
pawn Код:
if (newkeys == KEY_FIRE)
This code may even work in your testing, but it is wrong and your testing is insufficient. Try crouching and pressing fire - your code will instantly stop working. Why? Because "newkeys" is no longer the same as "KEY_FIRE", it is the same as "KEY_FIRE" COMBINED WITH "KEY_CROUCH".
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply


Messages In This Thread
Arrest Key ...(Cops And Robbers) - by Raul_Ro - 07.09.2010, 15:05
Re: Arrest Key ...(Cops And Robbers) - by nissan123 - 07.09.2010, 15:26
Re: Arrest Key ...(Cops And Robbers) - by [XST]O_x - 07.09.2010, 15:30
Re: Arrest Key ...(Cops And Robbers) - by Raul_Ro - 07.09.2010, 15:46
Re: Arrest Key ...(Cops And Robbers) - by [XST]O_x - 07.09.2010, 15:48
Re: Arrest Key ...(Cops And Robbers) - by Raul_Ro - 07.09.2010, 15:54
Re: Arrest Key ...(Cops And Robbers) - by LegendNissanGTR - 29.11.2010, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)