Avoid quickswapping
#2

pawn Код:
public OnPlayerUpdate(playerid)
{
    // ----- OnPlayerWeaponChange -----
    static
        oldWeapon[MAX_PLAYERS char];
    new
        newWeapon = GetPlayerWeapon(playerid);
       
    if(newWeapon != oldWeapon{playerid})
    {
        OnPlayerWeaponChange(playerid, newWeapon, oldWeapon{playerid});
        oldWeapon{playerid} = newWeapon;
        return 1;
    }
    return 1;
}

public OnPlayerWeaponChange(playerid, newweapon, oldweapon)
{
    static
        switchTime[MAX_PLAYERS];
       
    if((gettime() - switchTime[playerid]) < 3)
        SetPlayerArmedWeapon(playerid, oldweapon);
       
    switchTime[playerid] = gettime();
    return 1;
}
I think that should work.
Reply


Messages In This Thread
Avoid quickswapping - by Mikkel_RE - 30.07.2012, 12:28
Re: Avoid quickswapping - by Vince - 30.07.2012, 12:42
Re: Avoid quickswapping - by Mikkel_RE - 30.07.2012, 12:57
Re: Avoid quickswapping - by Mikkel_RE - 30.07.2012, 15:18

Forum Jump:


Users browsing this thread: 5 Guest(s)