Count how many bullets fired.
#5

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
pawn Код:
new pAmmo[MAX_PLAYERS][13],
    pWeapon[MAX_PLAYERS][13];
    pTotalFired[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    for(new slot = 0; slot < 13; slot++)
    {
        new ammo, weaponid;
        GetPlayerWeaponData(playerid, slot, weaponid, ammo);
        if(weaponid == pWeapon[playerid][slot] && ammo < pAmmo[playerid][slot)
        {
            new ShotsFired = (pAmmo[playerid][slot] - ammo);
            pTotalFired[playerid] += ShotsFired;
        }
        pAmmo[playerid][slot] = ammo;
        pWeapon[playerid][slot] = weaponid;
    }
    return 1;
}
Try this!
error 033: array must be indexed (variable "-unknown-")
Reply


Messages In This Thread
Count how many bullets fired. - by Slepur - 06.08.2013, 08:30
Re: Count how many bullets fired. - by Slepur - 06.08.2013, 11:00
Re: Count how many bullets fired. - by Vanter - 06.08.2013, 11:13
Re: Count how many bullets fired. - by RedFusion - 06.08.2013, 11:31
Re: Count how many bullets fired. - by Slepur - 06.08.2013, 11:42
Re: Count how many bullets fired. - by RedFusion - 06.08.2013, 11:46
Re: Count how many bullets fired. - by Konstantinos - 06.08.2013, 11:48
Re: Count how many bullets fired. - by Slepur - 06.08.2013, 11:52
Re: Count how many bullets fired. - by Konstantinos - 06.08.2013, 11:56
Re: Count how many bullets fired. - by Slepur - 06.08.2013, 12:03

Forum Jump:


Users browsing this thread: 4 Guest(s)