[HELP] How can i make a timer on my /heal cmd
#1

Код:
	if(strcmp(cmd, "/heal", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		GetPlayerName(playerid, sendername, sizeof(sendername));
		new location = PlayerInfo[playerid][pLocal];
		if(!strlen(tmp))
		{
			if(location != 255)
			{
				if(location < 99)
				{
					if(HouseInfo[location][hArm] == 1)
					{
						SetPlayerArmour(playerid, 100.0);
						PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
						format(string, sizeof(string), "You have been healed to 100 armor");
						SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
					}
					else
					{
						format(string, sizeof(string), "This place does not have armour upgrades");
						SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
					}
					if(HouseInfo[location][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if ( tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
							PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
							format(string, sizeof(string), "You have been healed to 100 health");
							SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
						}
						else
						{
							SendClientMessage(playerid, TEAM_GREEN_COLOR,"You are alredy healed to 100");
						}
					}
					else
					{
						format(string, sizeof(string), "This place does not have healing upgrades");
						SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
					}
					return 1;
				}
				else
				{
					if(BizzInfo[location-99][bArm] == 1)
					{
							SetPlayerArmour(playerid,100.0);
							PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
							format(string, sizeof(string), "You have been healed to 100 armor");
							SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
					}
					else
					{
						format(string, sizeof(string), "This place does not have armour upgrades");
						SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
					}
					if(BizzInfo[location-99][bHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if ( tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
							PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
							format(string, sizeof(string), "You have been healed to 100 health");
							SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
						}
						else
						{
							SendClientMessage(playerid, TEAM_GREEN_COLOR,"You are alredy healed to 100");
						}
					}
					else
					{
						format(string, sizeof(string), "This place does not have healing upgrades");
						SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
					}
					return 1;
It should have a timer for 90sec. Example when i use /heal for the next heal i must wait 90sec

It's from penls. Pls help

Thanks.
Reply
#2

Make something like this and put it behind the code and make an return.
Quote:

SetTimer("HealCheck",3000000,0);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)