[quote]
forward CountDown();
forward StartCount(p);
//news:
new Count;
new bool: IsCountdownStarted;
new CountdownTimer;
forward CountDown();
//OnPlayerCommandText:
if(strcmp(cmdtext,"/contar",true)==0)
{
if(IsCountdownStarted == false)
{
new pName[MAX_PLAYER_NAME];
Count = 5;
CountdownTimer = SetTimer("CountDown", 1000, 1);
IsCountdownStarted = true;
SendClientMessage(playerid, 0x00FF00FF, "Vocк comeзou uma contagem");
new countstring[256];
GetPlayerName(playerid,pName, MAX_PLAYER_NAME);
format(countstring, sizeof(countstring), "%s comeзou uma contagem", pName);
SendClientMessageToAll(COLOR_WHITE, countstring);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Jб hб uma contagem em andamento");
}
return 1;
}
//Final do gm:
public CountDown()
{
switch(Count)
{
case 5: { GameTextForAll("~n~~b~-~r~ 5 ~w~-", 1100, 3); }
case 4: { GameTextForAll("~n~~b~-~r~ 4 ~w~-", 1100, 3); }
case 3: { GameTextForAll("~n~~b~-~r~ 3 ~w~-", 1100, 3); }
case 2: { GameTextForAll("~n~~b~-~r~ 2 ~w~-", 1100, 3); }
case 1: { GameTextForAll("~n~~b~-~r~ 1 ~w~-", 1100, 3); }
case 0:
{
GameTextForAll("~w~Go~b~ Drifter~w~ Go!!", 2000, 3);
KillTimer(CountdownTimer);
IsCountdownStarted = false;
}
}
Count--;
}[/quote]
forward GameUm(allplayers);
public GameUm(allplayers)
{
GameTextForAll("~b~3", 4000, 3);
SetTimer("GameDois", 1500, false);
return 1;
}
forward GameDois(allplayers);
public GameDois(allplayers)
{
GameTextForAll("~g~2", 4000, 3);
SetTimer("GameTres", 1500, false);
return 1;
}
forward GameTres(allplayers);
public GameTres(allplayers)
{
GameTextForAll("~r~1", 4000, 3);
SetTimer("GameRounde", 1500, false);
return 1;
}
forward GameRounde(allplayers);
public GameRounde(allplayers)
{
GameTextForAll("~g~Roundi Uam!", 4000, 3);
SetTimer("GameGo", 1500, false);
return 1;
}
forward GameGo(allplayers);
public GameGo(allplayers)
{
GameTextForAll("~p~Faiti", 4000, 3);
return 1;
}
CMD:contar(playerid,params[])
{
GameTextForAll(5, 1000, 4);
GameTextForAll(4, 1000, 4);
GameTextForAll(3, 1000, 4);
GameTextForAll(2, 1000, 4);
GameTextForAll(1, 1000, 4);
GameTextForAll(Go!, 1000, 4);
return 1;
}
pawn Код:
@Edit: Testa ai,mais pensando bem,acho que isso bugaria. |
CMD:contar(playerid,params[])
{
GameUm(allplayers);
return 1;
}
if(strcmp("/contar", cmdtext, true, 7) == 0)
{
GameUm(allplayers);
return 1;
}
if(strcmp("/contar", cmdtext, true, 7) == 0)
{
GameUm(allplayers);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/contar", cmdtext, true, 10) == 0)
{
GameTextForAll("~n~ ~n~ ~n~ ~w~Uma contagem foi iniciada!", 4000, 3);
SetTimer("GameUm", 1500, false);
SendClientMessage(playerid, -1, "Vocк comeзou uma contagem.");
return 1;
}
return 1;
forward GameUm(allplayers);
public GameUm(allplayers)
{
GameTextForAll("~b~3", 4000, 3);
SetTimer("GameDois", 1500, false);
return 1;
}
forward GameDois(allplayers);
public GameDois(allplayers)
{
GameTextForAll("~g~2", 4000, 3);
SetTimer("GameTres", 1500, false);
return 1;
}
forward GameTres(allplayers);
public GameTres(allplayers)
{
GameTextForAll("~r~1", 4000, 3);
SetTimer("GameRounde", 1500, false);
return 1;
}
forward GameRounde(allplayers);
public GameRounde(allplayers)
{
GameTextForAll("~g~Roundi Uam!", 4000, 3);
SetTimer("GameGo", 1500, false);
return 1;
}
forward GameGo(allplayers);
public GameGo(allplayers)
{
GameTextForAll("~p~Faiti", 4000, 3);
return 1;
}