public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/conteo", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_RED,"[ ! ] Conteo en inicio");
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
TextDrawShowForPlayer(playerid,C3);
SetTimer("conteo2",1000,0);
return 1;
}
return 0;
}
new ConteoON = 0;
if (strcmp("/conteo", cmdtext, true, 10) == 0) { if(ConteoON == 1) return SendClientMessage(playerid, -1, "Ya se ha iniciado un conteo."); // Si el conteo ya se iniciу marcarб йste mensaje. (Variable en 1) SendClientMessage(playerid,COLOR_RED,"[ ! ] Conteo en inicio"); PlayerPlaySound(playerid,1056,0.0,0.0,0.0); TextDrawShowForPlayer(playerid,C3); SetTimer("conteo2",1000,0); return ConteoON = 1; // retornaremos en la variable, colocбndole 1 para que no se pueda ejecutar el comando. }
ConteoON = 0; // Setea a 0 la variable para que se pueda usar de nuevo.
Crea un variable general.
Код:
new ConteoON = 0; Код:
if (strcmp("/conteo", cmdtext, true, 10) == 0) { if(ConteoON == 1) return SendClientMessage(playerid, -1, "Ya se ha iniciado un conteo."); // Si el conteo ya se iniciу marcarб йste mensaje. (Variable en 1) SendClientMessage(playerid,COLOR_RED,"[ ! ] Conteo en inicio"); PlayerPlaySound(playerid,1056,0.0,0.0,0.0); TextDrawShowForPlayer(playerid,C3); SetTimer("conteo2",1000,0); return ConteoON = 1; // retornaremos en la variable, colocбndole 1 para que no se pueda ejecutar el comando. } Код:
ConteoON = 0; // Setea a 0 la variable para que se pueda usar de nuevo. |