pawn Код:
new countttt;
new timerrrrrrr;
new bool:CountStart;
CMD:contar(playerid,params[])
{
if(CountStart == true)
return SendClientMessage(playerid,-1,"(error) jб existe uma contagem em andamento.");
else
{
timerrrrrrr = SetTimerEx("Count",1000,true,"d",playerid);
countttt = 5;
}
return true;
}
forward Count(playerid);
public Count(playerid)
{
if(CountStart == false)
{
new Float:Float[3];
GetPlayerPos(playerid,Float[0],Float[1],Float[2]);
for(new x = 0; x != MAX_PLAYERS; x++)
{
if(IsPlayerInRangeOfPoint(x,50.0,Float[0],Float[1],Float[2]) && IsPlayerConnected(x)) continue;
TogglePlayerControllable(x,false);
}
CountStart = true;
}
else
{
if(countttt != 0)
{
for(new x = 0; x != MAX_PLAYERS; x++)
{
new Str[6],Float:Float[3];
GetPlayerPos(playerid,Float[0],Float[1],Float[2]);
if(IsPlayerInRangeOfPoint(x,50.0,Float[0],Float[1],Float[2]) && IsPlayerConnected(x)) continue;
format(Str,sizeof(Str),"~w~%d",countttt);
GameTextForPlayer(x,Str,1000,6);
}
countttt--;
}
else
{
for(new x = 0; x != MAX_PLAYERS; x++)
{
new Float:Float[3];
GetPlayerPos(playerid,Float[0],Float[1],Float[2]);
if(IsPlayerInRangeOfPoint(x,50.0,Float[0],Float[1],Float[2]) && IsPlayerConnected(x)) continue;
GameTextForPlayer(x,"~r~GO ~y~ GO ~b~~h~~h~GO!",1000,6);
}
KillTimer(timerrrrrrr);
}
}
return true;
}