06.08.2013, 08:30
I've got the script working for the most part, but there's a bug that I can't seem to get my head around.
At the moment it logs how much ammo the player has and how many shots the player has made... The problem is that when they get a weapon which over rides the previous weapon, it adds the ammo lost from that weapon onto the pTotalFired.
Say I have a regular shotgun with 500 bullets... When I get the Combat Shotgun and it removes the regular shotgun from the player it adds the 500 bullets from that shotgun to the total shots.
At the moment it logs how much ammo the player has and how many shots the player has made... The problem is that when they get a weapon which over rides the previous weapon, it adds the ammo lost from that weapon onto the pTotalFired.
Say I have a regular shotgun with 500 bullets... When I get the Combat Shotgun and it removes the regular shotgun from the player it adds the 500 bullets from that shotgun to the total shots.
Код:
new pAmmo[MAX_PLAYERS]; new pTotalFired[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { new playerammo = GetPlayerAmmo(playerid); if(playerammo < pAmmo[playerid]) { new ShotsFired = (pAmmo[playerid]-playerammo); pTotalFired[playerid]+=ShotsFired; } pAmmo[playerid]=playerammo; return 1; }