/countdown cmd?
#1

plz give me the script of /countdown command
Reply
#2

Quote:
Originally Posted by PAF
Посмотреть сообщение
plz give me the script of /countdown command
forwards in your script:

forward Counting(playerid);
forward Counting2(playerid);
forward Counting1(playerid);
forward CountingGO(playerid);

Publics in your script:

public Counting(playerid)
{
Count = 1;
GameTextForAll("~r~3",1000,3);
SetTimer("Counting2",1000,false);
return 1;
}
public Counting2(playerid)
{
Count = 1;
GameTextForAll("~r~2",1000,3);
SetTimer("Counting1",1000,false);
return 1;
}
public Counting1(playerid)
{
Count = 1;
GameTextForAll("~r~1",1000,3);
SetTimer("CountingGO",1000,false);
return 1;
}
public CountingGO(playerid)
{
Count = 0;
GameTextForAll("~g~STARTAS",1000,3);
for(new i=0; i < MAX_PLAYERS; i++)
return 1;
}

CMD:countdown(playerid,params[])
{
new Float: x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if (Count == 0)
{
SetTimer("Counting",1000,false);
}else{
SendClientMessage(playerid, 0xFF0000FF,"Countdown started!");
}
return 1;
}
Reply
#3

You'll have to use a timer as shown in the code above.
Reply
#4

Not tested test and tell me if it worked
pawn Код:
new timec;

CMD:countdown(playerid, params[])
{
if(sscanf(params, "i", timec)) return SendClientMessage( playerid, -1, "/countdown [time]" );
if((timec < 1) || (timec > 20)) return SendClientMessage(playerid, -1, "Time 20!");
TimerCont = SetTimer("DTime", 1000, true);
return 1;
}

public DTime()
{
    if(timec == 0)
    {
        KillTimer(TimerCont);
        GameTextForAll("~r~Go Go Go", 1000, 6);
        return 1;
    }
    format(String, sizeof(String), "~g~%d", timec);
    GameTextForAll(String, 1000, 6);
    timec--;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)