Quote:
|
Originally Posted by Pixels^
Just a small code to check if a player has a weapon or not or how many. You will need to replace all your GivePlayerWeapon with GivePlayerWeapon2.
Edit:This snippet will only be useful in 0.1. 0.2 already has a GetPlayerWeapon function.
pawn Код:
stock GivePlayerWeapon2(playerid,weapon,ammo) { Weapon[playerid]++; return GivePlayerWeapon(playerid,weapon,ammo); }
pawn Код:
if(Weapon[playerid]) // if he has a weapon { } else // he doesn't { }
pawn Код:
if(Weapon[playerid] >= 2) // 2 or more weapons { } else // less then 2 weapons { }
|
This code only works for the weapons you give to a player through your script, not for the weapons a player might pickup or buy at ammunations.