Usedrugs cooldown
#1

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.
Reply
#2

Bump.

Still need the help. (the drugsystem is the same as norn made for carlitos rp)
Thank you.
Reply
#3

1) dont bump
2) ask in carlito's RP topic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)