18.07.2012, 07:21
pawn Код:
//Arriba de todo del GM/FS
new conteo[MAX_PLAYERS] = 0;
new terminarTimer;
#define tiempo_Usado 5000
//En la funcion del comando
conteo[playerid] ++;
//Dentro del comando, pero arriba de todo
if(conteo[playerid] == 3)
{
SendClientMessage(playerid, -1, "debes esperar 5 segundos para volver a usar el comando!.");
terminarTimer = SetTimer("Cargartimer", tiempo_Usado, true);
return 1;
}
//Alfinal del GM/FS o donde kieras
forward Cargartimer(playerid);
public Cargartimer(playerid)
{
conteo[playerid] = 0;
KillTimer(terminarTimer);
return 1;
}
pawn Код:
if(strcmp(cmdtext,"/PlantarMarihuana", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(Plantada[playerid] == 0) // si la variable esta en 0 te manda un mensaje de aviso
{
SendClientMessage(playerid, GRIS, "No tienes Semillas");
return 1;
}
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X,Y,Z);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
MarihuanaPlantada[playerid] = 6;
Plantada[playerid] --; //<----------
GameTextForPlayer(playerid, "~w~Plantando~g~ Marihuana...", 3000, 3);
SetTimerEx("PlantarMarihuana",3000,0,"d",playerid);
}
return 1;
}
if(strcmp(cmdtext, "/semillas", true) == 0)
{
Plantada[playerid] = 6; // que te de 6 semillas osea 6 veces para plantar
SendClientMessage(playerid, GRIS, "Has comprado 6 semillas!");
return 1;
}