Countdown timer?
#1

Hey, I wonder how can I make a countdown with GameTextForPlayer?
Reply
#2

use it with timers while calling the commandd or function of countdown
Reply
#3

I ask this question 1 time now i'll teach you

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

new countac,
    countam,
    counttime;

forward Count();

CMD:count(playerid,params[])
{
    new am;
    if(sscanf(params,"i",am)) return SendClientMessage(playerid,-1,"USAGE: /count [second]");
    counttime = SetTimer("Count",2000,true);
    countam = am;
    countac = 1;
    return 1;
}

public Count()
{
    if(!countac)
    {
        KillTimer(counttime);
    }
    else
    {
        new tstring[128];
        format(tstring,sizeof(tstring),"Counting Down: %i",countam);
        GameTextForAll(tstring,1000,3);
        countam --;
        if(countam == 0)
        {
            countac = 0;
            GameTextForAll("~g~~h~Go!",1000,3);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)