I want to make a simple countdown but I dont know where or how to start. I figured if i could get an example everything would become clear. I am trying to make a countdown (3, 2, 1, GO!) to start the game and a timer so the game doesnt last forever.
|
forward CountDownCheck3();
forward CountDownCheck2();
forward CountDownCheck1();
forward CountDownCheckGo();
//==============================================================================
public CountDownCheck3()
{
SendClientMessageToAll(-1 " 3");
SetTimer("CountDownCheck2", 1000, 0);
}
//==============================================================================
public CountDownCheck2()
{
SendClientMessageToAll(-1, " 2");
SetTimer("CountDownCheck1", 1000, 0);
}
//==============================================================================
public CountDownCheck1()
{
SendClientMessageToAll(-1, " 1");
SetTimer("CountDownCheckGo", 1000, 0);
}
//==============================================================================
public CountDownCheckGo()
{
SendClientMessageToAll(-1, " Go!");
}
//==============================================================================
CMD:countdown(playerid, params[])
{
SetTimer("CountDownCheck3", 1000, 0);
return 1;
}
if(strcmp(cmd, "/countdown", true) == 0)
{
SetTimer("CountDownCheck3", 1000, 0);
return 1;
}