No reload gun
#5

Quote:
Originally Posted by BeckzyBoi
View Post
I'm not sure why you're giving the player 10 ammo every 0.25 seconds, but the correct way to do it is: https://pastebin.com/RbZMa3Ly
Which gives the player 10 ammo every 0.25 seconds even if he's not shooting. Also he would lose his weapon if he got like a minigun and a little lag.

This would be the correct way.
PHP Code:
CMD:noreload(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
PlayerInfo[playerid][pAdmin] < 3)return SendClientMessage(playeridCOLOR_CORRECTION"You are not authorized to use this command !");
        if(
GetPVarInt(playerid,"NoReloadActive") > 0)//turn off
        
{
            
DeletePVar(playerid,"NoReloadActive");
            
SendClientMessage(playeridCOLOR_SUCCESS"No-Reload deactivated!");
        }
        else 
//turn on
        
{
            
SetPVarInt(playerid,"NoReloadActive",1);
            
SendClientMessage(playeridCOLOR_SUCCESS"No-Reload activated!");
        }
        return 
1;
    }
    return 
1;
}
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ//called if the player shot
{
    if(
GetPVarInt(playerid,"NoReloadActive") > 0){GivePlayerWeapon(playeridGetPlayerWeapon(playerid), GetPlayerAmmo(playerid)+10);} // give the player +10 ammo
    
return 1;

Reply


Messages In This Thread
No reload gun - by Jaua10 - 11.07.2018, 13:36
Re: No reload gun - by TadePoleMG - 11.07.2018, 15:28
Re: No reload gun - by Jaua10 - 11.07.2018, 15:28
Re: No reload gun - by beckzy - 11.07.2018, 16:10
Re: No reload gun - by GangstaSunny. - 11.07.2018, 16:49
Re: No reload gun - by Jaua10 - 11.07.2018, 17:03

Forum Jump:


Users browsing this thread: 1 Guest(s)