Kill player on esc
#1

Hello how can i kill player when he have press esc? i have see this in one server thanks
Reply
#2

anyone?
Reply
#3

Alright. You want kill a player, when he press ESC key right?

This key is not detectable on SA-MP, but as far we know it pauses the Game right?

See this script.

pawn Код:
new bool:paused[MAX_PLAYERS];
Add this function below OnPlayerUpdate

pawn Код:
public OnPlayerUpdate(playerid)
{
    paused[playerid] = false; // Player is playing the server (not paused)
    return 1;
}
Don't forgot to create a Timer, which sets the value to 'true' each 500ms.

pawn Код:
public OnGameModeInit()
{
    SetTimer("PausePlayer", 500, 1);
    return 1;
}

forward PausePlayer();
public PausePlayer()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) continue;

        if(paused[i] == true)
        {
            SetPlayerHealth(i, 0.0);
        }

        paused[i] = true;
    }
}
Reply
#4

<Removed>

EDIT:Wrong Selection
Reply
#5

Thanks this work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)