GetTickCount ?
#10

Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
It's best to use a timer for that (SetTimerEx("Killplayer", 1000, 0, "i", playerid))

pawn Код:
new Killcount[MAX_PLAYERS];
pawn Код:
if(!strcmp("/kill", cmdtext, true))
{
    Killcount[playerid] = 10; // 10 seconds
    SetTimerEx("KillPlayer", 1000, 0, "i", playerid); //Check every second for Killcount.
    new str[10]; format(str, 10, "%d...", Killcount[playerid]);
    SendClientMessage(playerid, -1, str);
    return 1;
}
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
    switch(Killcount[playerid])
    {
        case 0: return SetPlayerHealth(playerid, 0.0);
        default:
        {
            SetTimerEx("KillPlayer", 1000, 0, "i", playerid);
            new str[10]; format(str, 10, "%d...", Killcount[playerid]);
            Killcount[playerid] -= 1;
            SendClientMessage(playerid, -1, str);
        }
    }
}
I recive Errors
Reply


Messages In This Thread
GetTickCount ? - by [D]ry[D]esert - 23.05.2012, 16:44
Re: GetTickCount ? - by Jonny5 - 23.05.2012, 16:46
Re: GetTickCount ? - by [FMJ]PowerSurge - 23.05.2012, 16:46
Re: GetTickCount ? - by iggy1 - 23.05.2012, 16:55
Re: GetTickCount ? - by [D]ry[D]esert - 23.05.2012, 16:56
Re: GetTickCount ? - by [FMJ]PowerSurge - 23.05.2012, 17:07
Re: GetTickCount ? - by Sanady - 23.05.2012, 17:09
Re: GetTickCount ? - by [D]ry[D]esert - 23.05.2012, 17:11
Re: GetTickCount ? - by [D]ry[D]esert - 23.05.2012, 17:14
Re: GetTickCount ? - by [D]ry[D]esert - 25.05.2012, 13:46

Forum Jump:


Users browsing this thread: 1 Guest(s)