SA-MP Forums Archive
Kill player on esc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kill player on esc (/showthread.php?tid=454151)



Kill player on esc - Configuration - 27.07.2013

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


Re: Kill player on esc - Configuration - 27.07.2013

anyone?


AW: Kill player on esc - Skimmer - 28.07.2013

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;
    }
}



Re: Kill player on esc - ScRipTeRi - 28.07.2013

<Removed>

EDIT:Wrong Selection


Re: Kill player on esc - Configuration - 28.07.2013

Thanks this work