Usedrugs cooldown - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Usedrugs cooldown (
/showthread.php?tid=84117)
Usedrugs cooldown -
Buwla - 28.06.2009
Hello, I cant get my cooldown to work.
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;
}
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.
Re: Usedrugs cooldown -
Buwla - 30.06.2009
Bump.
Still need the help. (the drugsystem is the same as norn made for carlitos rp)
Thank you.
Re: Usedrugs cooldown -
kaisersouse - 30.06.2009
1) dont bump
2) ask in carlito's RP topic.