08.10.2015, 15:33
(
Последний раз редактировалось faff; 08.10.2015 в 16:21.
)
Ehhh... Use "1 ammo" as 0 ammo.
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).
PHP код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float: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(playerid, weapon, 1); // Prevent the weapon from dissappearing.
return 0;} // Bullet won't do damage.
else{
return 1;}
}
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).