SA-MP Forums Archive
Weapon Check Help! - 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)
+--- Thread: Weapon Check Help! (/showthread.php?tid=470727)



Weapon Check Help! - NewCityRoleplay - 19.10.2013

Okay so I was wondering how do I check if a player has a certain gun in his inventory For example If he tries to use /rob, but you need a shotgun to do it? How do I check to see if he has a shotgun or any other weapon for that matter?


Re: Weapon Check Help! - Patrick - 19.10.2013

Use the function GetPlayerWeapon Link: https://sampwiki.blast.hk/wiki/GetPlayerWeapon

for example
pawn Код:
if(GetPlayerWeapon(playerid) != 25) return SendClientMessage(playerid, -1, "You must be holding a shot gun to rob this store!"); //if player is not holding that weapon, it will show the error.



Re: Weapon Check Help! - NewCityRoleplay - 19.10.2013

Thanks !