Check ALL the players weapons! - 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: Check ALL the players weapons! (
/showthread.php?tid=89818)
Check ALL the players weapons! -
Rocco - 04.08.2009
Hey, does anyone know how to check ALL the players weapons?
i tried with
Код:
GetPlayerWeapon(playerid)
But apperently that only checks the weapon the player is holding in his hand.... So how do i check for all weapons ?
Re: Check ALL the players weapons! -
Correlli - 04.08.2009
Use:
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Re: Check ALL the players weapons! -
Rocco - 04.08.2009
How can i make like:
if (GetPlayerWeapon(playerid) == 22)
22 = Weapon ID
With
GetPlayerWeaponData .... :/, i don't get it i dont need ammo and all that :/
Re: Check ALL the players weapons! -
Correlli - 04.08.2009
Here's a wiki example:
pawn Код:
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
So, you would use:
pawn Код:
if(weapons[2][0] == 22) { }
2 is the weapon-slot of weaponid 22 (9mm).