PDA

View Full Version : Game not responding after shoot all ammo


Zeddclarity
19/10/2015, 07:49 AM
I had add for my gamemode which all the gun will have bullets.But after shoot out all the ammo, my game is not reponding, all the time which i try to test shoot out the ammo again the game is not responding and stop working all the time
Please help me :(

Crystallize
19/10/2015, 10:04 AM
show us public onplayerweaponshot

Aerotactics
19/10/2015, 10:13 AM
If you are trying to do something when you have 0 ammo, your "detector" has to be:


//Example
new ammo = (GetPlayerAmmo(playerid) - 1);


I found that with GetPlayerAmmo, it always returns ammo + 1, which is probably why when you run out of ammo, the game removes your weapon when it returns with 1 ammo. So if you detect if (using the sample above):


if(ammo == 0)


Without subtracting 1 from GetPlayerAmmo, you will never reach 0, so the script will never respond.

Source: Personal knowledge.