Return guns [+Rep]
#1

Hi Guys I got the holster system so when i switch Gun ID 0 its return fast to the killer guns
like knife or anything so guys i need to set it to return the gun after 3 seconds not faster

Sorry for my bad english!
This is the code!

pawn Код:
public OnPlayerUpdate(playerid)
{
    new w = GetPlayerWeapon(playerid);

    if(w != lastWeapon[playerid])
    {
        if(lastWeapon[playerid] == 0) return lastWeapon[playerid] = GetPlayerWeapon(playerid);

        SetPlayerArmedWeapon(playerid, lastWeapon[playerid]);
    }

    lastWeapon[playerid] = w;

    return 1;
}
Reply
#2

Because you are doing this inside OnPlayerUpdate callback which gets called frequently. Create your own timer with the interval of 3 seconds and do the stuff there.
Reply
#3

I try to change OnPlayerUpdate to HolsterOnPlayerUpdate and still switching fast.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)