How would one make a weapon not dissapear, even at 0 ammunition?
#9

Ehhh... Use "1 ammo" as 0 ammo.
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
   new 
ammo GetPlayerAmmo(playerid); // Getting player his current ammo.
   
new weapon GetPlayerWeapon(playerid); // Getting player his current weapon.
   
if(ammo == 1){ // Check if player has 1 ammo.
   
SetPlayerAmmo(playeridweapon1); // Prevent the weapon from dissappearing.
   
return 0;} // Bullet won't do damage. 
   
else{
   return 
1;}

Tested it and works perfect.
It won't shoot any bullet when having 1 ammo.
REMINDER: Since a minigun and someother weapons are shooting to fast you'll have to raise the amount of ammo for these. Tested this with Desert Deagle, Colt45, Shotgun, Spaz-12 and Grenades and was working perfectly.
It didn't work with Miniguns since it was shooting to fast. Just raise up if(ammo == 1) to if(ammo == 2).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)