Spamming 'Crouch' - Kick
#2

pawn Код:
new CrouchCount[MAX_PLAYERS];

forward ResetCrouchCount(playerid);

public ResetCrouchCount(playerid)
{
    CrouchCount[playerid] = 0;
}

public OnPlayerConnect(playerid)
{
    CrouchCount[playerid] = 0; // I don't think this is needed, but I put it anyways
    SetTimerEx("ResetCrouchCount", 5000, true, "i", playerid);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
    {
        CrouchCount[playerid] ++;
        if(CrouchCount[playerid] > 5) return Kick(playerid);
    }
    return 1;
}
That's how I'd do it.
Reply


Messages In This Thread
Spamming 'Crouch' - Kick - by FL3GM4 - 08.01.2013, 22:12
Re: Spamming 'Crouch' - Kick - by Fabio11 - 08.01.2013, 22:18

Forum Jump:


Users browsing this thread: 1 Guest(s)