16.06.2013, 20:07
Testa aн ~>
Espero ter ajudado
pawn Код:
// Topo do GM
new Contar[MAX_PLAYERS];
forward FicarContando(playerid);
public FicarContando(playerid)
{
if(Contar[playerid] >= 1)
{
Contar[playerid]--;
format(Fala,sizeof(Fala),"~r~Contagem: ~w~%d",Contar[playerid]);
GameTextForPlayer(playerid,Fala,2000,3);
}
if(Contar[playerid] == 0)
{
GameTextForPlayer(playerid,"~g~Go Go Go!",2000,3);
}
return 1;
}
// OnGameModeInit
for(new i=0; i<MAX_PLAYERS; i++)
{
SetTimerEx("FicarContando",1000,1,"i",i);
}
// Comando STRCMP
new cmd[128];
new tmp[128];
new idx;
cmd = strtok(cmdtext,idx);
if(strcmp(cmdtext,"/contar",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0xBFBFBFAA,"Use /contar [ID] [Tempo]");
return 1;
}
new id = strval(tmp);
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid,0xBFBFBFAA,"Este player nгo estб conectado.");
return 1;
}
new Count = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0xBFBFBFAA,"Use /contar [ID] [Tempo]");
return 1;
}
if(Count > 10)
{
SendClientMessage(playerid,0xBFBFBFAA,"Os nъmeros sу podem ser de 1 a 10.");
return 1;
}
Contar[id] = Count;
return 1;
}
// Comando ZCMD
CMD:contar(playerid,params[])
{
new ID, Count;
if(sscanf(params,"ud",ID,Count))
{
SendClientMessage(playerid,0xBFBFBFAA,"Use /contar [ID] [Tempo]");
return 1;
}
if(!IsPlayerConnected(ID))
{
SendClientMessage(playerid,0xBFBFBFAA,"Este player nгo estб conectado.");
return 1;
}
if(Count > 10)
{
SendClientMessage(playerid,0xBFBFBFAA,"Os nъmeros sу podem ser de 1 a 10.");
return 1;
}
Contar[ID] = Count;
return 1;
}