Count how many bullets fired.
#1

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.

Код:
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;
}
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: 3 Guest(s)