SA-MP Forums Archive
Tempo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: Tempo (/showthread.php?tid=333137)



Tempo - FriendrS - 10.04.2012

Como faso pra quando o player usar o comando /kill
ele espera 5 segundo e more?


Re: Tempo - rjjj - 10.04.2012

Utilize um timer :


pawn Код:
//Coloque no OnPlayerCommandText:

if(!strcmp(cmdtext, "/kill", true))
    {
        KillTimer(GetPVarInt(playerid, "TimerKill"));
        new Timer;
        SendClientMessage(playerid, 0x33CCFFAA, "Espere 5 segundos para morrer !");
        Timer = SetTimerEx("Matar", 5000, false, "n", playerid);
        SetPVarInt(playerid, "TimerKill", Timer);
        return 1;
    }


//E, no Final do GM:

forward Matar(playerid);
public Matar(playerid)
{
    SendClientMessage(playerid, 0xFF0000FF, "Vocк morreu.");
    SetPlayerHealth(playerid, -1);
    return 1;
}


Espero ter ajudado .