Get player weapon slot? - 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: Get player weapon slot? (
/showthread.php?tid=166165)
Get player weapon slot? -
0ne - 07.08.2010
Does anyone know how to GET players weapon slot?
Re: Get player weapon slot? -
vital2k - 07.08.2010
GetPlayerWeaponData?
Re: Get player weapon slot? -
0ne - 07.08.2010
I'm doing an stock GivePlayerGun(playerid,weaponid,ammo) and i need to get weapon slot, only the slot so i can set one cmd. Example pls?
Re: Get player weapon slot? -
Hiddos - 07.08.2010
pawn Code:
stock GetWeaponSlot(weaponid)
{
new slot;
switch(weaponid)
{
case 0,1: slot = 0;
case 2 .. 9: slot = 1;
case 10 .. 15: slot = 10;
case 16 .. 18, 39: slot = 8;
case 22 .. 24: slot =2;
case 25 .. 27: slot = 3;
case 28, 29, 32: slot = 4;
case 30, 31: slot = 5;
case 33, 34: slot = 6;
case 35 .. 38: slot = 7;
case 40: slot = 12;
case 41 .. 43: slot = 9;
case 44 .. 46: slot = 11;
}
return slot;
}
Just scripted that, unsure if it works.