Spamming 'Crouch' - Kick
#1

how to make that is spamming 'Crouch' button kick player !?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)