17.08.2013, 01:38
Hey, I wonder how can I make a countdown with GameTextForPlayer?
#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;
}