16.12.2010, 21:28
The first thing that struck me when I looked through your script was the check to see whether a player is firing his gun in the OnPlayerKeyStateChange callback:
The first check (newkeys == KEY_FIRE) will pass if the player is pressing the "fire" key and nothing else. This is a problem as most people will also be holding down the "aim" key too. You need to do a bitwise AND (&) check instead of a logical AND (==) check. Change that line to:
As for the rest of the code, it's looking pretty nice. Although honestly I haven't quite got my head around the maths for the "has the player shot a cow" check. It's really interesting to go through though, so expect another reply from me later
pawn Код:
if(newkeys == KEY_FIRE && GetPlayerWeapon(playerid) != 0 && IsPlayerSpawned[playerid] == true)
pawn Код:
if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) != 0 && IsPlayerSpawned[playerid] == true)