28.06.2009, 21:20
Hello, I cant get my cooldown to work.
Heres the code.
no errors or anything, the cooldown just dosnt work.(I can spam /usedrugs only thing i see is the "you must wait blabla")
I guess its something i have forgot to put in, but i dont know what Xd.
Heres the code.
Код:
if(strcmp(cmdtext, "/usedrugs", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDrugs] > 1)
{
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour < 100.0)
{
SetPlayerArmour(playerid, armour + 15.0);
}
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[INFO:] 2 grams used.");
PlayerInfo[playerid][pDrugs] -= 2;
PlayerActionMessage(playerid,15.0,"has just took some drugs.");
DrugsIntake[playerid] += 2;
if(DrugsIntake[playerid] >= 2)
{
SetTimerEx("DrugEffect", 1000, false, "i", playerid);
}
format(string, sizeof(string), "[ERROR:] You must wait %d seconds before using drugs again.", (addtimer/30000));
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have any drugs.");
}
}//not connected
return 1;
}
I guess its something i have forgot to put in, but i dont know what Xd.

