SA-MP Forums Archive
Checking Weapons of any player - 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: Checking Weapons of any player (/showthread.php?tid=288008)



Checking Weapons of any player - Niko_Oconner - 05.10.2011

Hello how i can add a commands in my GM for CHECK the weapons that have a player?


Re: Checking Weapons of any player - TheLazySloth - 05.10.2011

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

Be sure to use https://sampwiki.blast.hk/ before asking please.


Re: Checking Weapons of any player - Niko_Oconner - 06.10.2011

Thanks but i search the complete script, i can't make the FS becouse i'm n00b LoL


Re: Checking Weapons of any player - Pharrel - 06.10.2011

pawn Код:
new Weapons[12][2];//global variable

CMD:checkweapons(playerid, params[])
{
    new id,stringp[58];
    if(sscanf(params, "u",id))
        return SendClientMessage(playerid, -1, "Usage: /checkweapons [playerid]");
    new weaponname[32];
    for(new i=0; i<13; i++)
    {
        GetPlayerWeaponData(id, i, Weapons[i][0], Weapons[i][1]);
        if(Weapons[i][0] != 0 && Weapons[i][1] > 0)
        {
            GetWeaponName(Weapons[i][0], weaponname, 32);
            format(stringp, 58, "Weapon[%s] <---> Ammo[%d]", weaponname, Weapons[i][1]);
            SendClientMessage(playerid, -1, strinngp);
        }
    }
    return 1;
}



Re: Checking Weapons of any player - TheLazySloth - 06.10.2011

The above code will only work if you have the sscanf2 and zcmd includes.


Re: Checking Weapons of any player - Niko_Oconner - 06.10.2011

Ok very thanks


Re: Checking Weapons of any player - Niko_Oconner - 06.10.2011

But this is a FS or I add this in the GM??