Detector de tiempo por comando
#2

pawn Код:
new AntiMacros[MAX_PLAYERS];

public AntiMacros(playerid)
{
    AntiMacros[playerid] = 0;
}

YCMD:me(playerid, params[], help)
{
if (help) SendClientMessage(playerid, 0xFF0000AA, "Para hacer roles "); // Esto no sale si se usa el comando
else
{
if(!sscanf(params, "s[128]", params[0]))
{

if(AntiMacros[playerid] == 1) return Message(playerid, COLOR_GRAD2, "Espera 10 segundos para volver a usar el /me!");
new string[128];
format(string, sizeof(string), "* %s %s.", NombreJugador(playerid), params[0]);
ProxDetector(30.0, playerid, string, COLOR_PURPURA,COLOR_PURPURA,COLOR_PURPURA,COLOR_PURPURA,COLOR_PURPURA);
AntiMacros[playerid] = 1;
SetTimerEx("AntiMacros", 10000, false, "i", playerid);//aqui por ejeemplo son 10 segundos en milisegundos
}
else SendClientMessage(playerid, COLOR_GRAD2, "Utilize: /me <Acciуn>");
}
return 1;
}
Ahi tienes un ejemplo,si lo quieres para todos los comandos simplemente utiliza


pawn Код:
if(AntiMacros[playerid] == 1) return Message(playerid, COLOR_GRAD2, "Espera 10 segundos para volver a usar el comando!");
Dentro de OnPlayerCommandText
Reply


Messages In This Thread
Detector de tiempo por comando - by Glimma - 02.09.2012, 03:38
Respuesta: Detector de tiempo por comando - by -[R]hysi- - 02.09.2012, 09:50
Respuesta: Detector de tiempo por comando - by Glimma - 02.09.2012, 14:14
Respuesta: Detector de tiempo por comando - by -[R]hysi- - 02.09.2012, 14:21
Respuesta: Detector de tiempo por comando - by Glimma - 02.09.2012, 14:22
Respuesta: Detector de tiempo por comando - by Shiny_David - 02.09.2012, 15:13

Forum Jump:


Users browsing this thread: 1 Guest(s)