SA-MP Forums Archive
Weapon stats 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 stats help (/showthread.php?tid=421165)



- - Colossus874 - 08.03.2013

----


Re: Weapon stats help - zxc1 - 08.03.2013

pawn Код:
CMD:weaponstats(playerid,params[])
{
    for(new x; x < 13; x++)
    {
    GetPlayerWeaponData(playerid,x,PlayerInfo[playerid][pWeapons][x],PlayerInfo[playerid][pWeaponAmmo][x]);
    if(!PlayerInfo[playerid][pWeapons][x] && PlayerInfo[playerid][pWeaponAmmo][x] != 0)
    {
    new string[128],ammo;
    new weapon;
    ammo = PlayerInfo[playerid][pWeaponAmmo][x];
    weapon = PlayerInfo[playerid][pWeapons][x];
    format(string,sizeof(string),"[%s with %i ammo.]", aWeaponNames[weapon],ammo);
    SendClientMessage(playerid, COLOR_WHITE,string);
    }
    }
    return 1;
}



Re: Weapon stats help - Colossus874 - 08.03.2013

Quote:
Originally Posted by zxc1
Посмотреть сообщение
pawn Код:
CMD:weaponstats(playerid,params[])
{
    for(new x; x < 13; x++)
    {
    GetPlayerWeaponData(playerid,x,PlayerInfo[playerid][pWeapons][x],PlayerInfo[playerid][pWeaponAmmo][x]);
    if(!PlayerInfo[playerid][pWeapons][x] && PlayerInfo[playerid][pWeaponAmmo][x] != 0)
    {
    new string[128],ammo;
    new weapon;
    ammo = PlayerInfo[playerid][pWeaponAmmo][x];
    weapon = PlayerInfo[playerid][pWeapons][x];
    format(string,sizeof(string),"[%s with %i ammo.]", aWeaponNames[weapon],ammo);
    SendClientMessage(playerid, COLOR_WHITE,string);
    }
    }
    return 1;
}


Thanks for giving me the tip to change the == to != but I still had to remove the ! in front of PlayerInfo.

+rep