Unlimited Ammo without lag/bug.
#1

I got 99999 for ammo, But when I logging and loadding my guns. I get sometimes a gun with -1 ammo orsomething. So when I scroll to it its disappear in 0.5 sec.So I cannot shoot with it.
Here is my give saved weapons fuction:
Code:
				if(PlayerStats[playerid][Slot1] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot1], 99999); }
				if(PlayerStats[playerid][Slot2] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot2], 99999); }
				if(PlayerStats[playerid][Slot3] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot3], 99999); }
				if(PlayerStats[playerid][Slot4] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot4], 99999); }
				if(PlayerStats[playerid][Slot5] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot5], 99999); }
				if(PlayerStats[playerid][Slot6] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot6], 99999); }
				if(PlayerStats[playerid][Slot7] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot7], 99999); }
				if(PlayerStats[playerid][Slot8] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot8], 99999); }
				if(PlayerStats[playerid][Slot9] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot9], 99999); }
				if(PlayerStats[playerid][Slot10] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot10], 99999); }
				if(PlayerStats[playerid][Slot11] != 0)
				{ GivePlayerWeapon(playerid, PlayerStats[playerid][Slot11], 99999); }
Reply
#2

try use the number 9999 instead of yours..
Reply
#3

Yeah, When you load a weapon from a file with a big amount of ammo you kinda cannot use it.
All numbers above 9999 shows the weapon as unlimited ammo.
But if you have 10 000 ammo and shoot one shot it will go down to 9999 and not show as unlimited anymore.
I suggest using 15 000 or 12 500 or something
Reply
#4

Well, I still use 99999 Because the ammo isn't loading from a file and it works now. it only failed on time. So I hope it keep working now. But thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)