SA-MP Forums Archive
[HELP] Ammunition detect - 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: [HELP] Ammunition detect (/showthread.php?tid=483250)



[HELP] Ammunition detect - Luca12 - 24.12.2013

Hello I wonder How can I make ammunition detection for example player has weapon id 30 and 31 and ammunition 700 in the each weapon and max ammunition is 350 and how can I make to detect that and send to admins so it's go something like this

pawn Код:
Weapon id 30-31 || Ammunition found: 700 || Max ammunition is: 350

Thanks.


Re: [HELP] Ammunition detect - Jefff - 24.12.2013

https://sampwiki.blast.hk/wiki/GetPlayerWeaponData


Re: [HELP] Ammunition detect - Luca12 - 24.12.2013

How is that gonna help me? Thanks


Re: [HELP] Ammunition detect - Jefff - 24.12.2013

it will get all weapon ids and ammo which player have


Re: [HELP] Ammunition detect - Luca12 - 24.12.2013

can you set mi that in the code something which I post


Re: [HELP] Ammunition detect - Jefff - 24.12.2013

pawn Код:
new Weapon, Ammo;
GetPlayerWeaponData(giveplayerid, 5, Weapon, Ammo); // slot 5 is for AK-47 and M4

if(Weapon > 0 && Ammo > 0) // if player got AK or M4 and ammo more than 0
{
    if(Ammo > 699)
    {
        new str[128];
        format(str,sizeof(str),"Weapon id %d || Ammunition found: %d || Max ammunition is: 350", Weapon, Ammo);
        SendClientMessage(playerid,-1,str);
    }
}