SA-MP Forums Archive
[HELP] How can i make a timer on my /heal cmd - 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: [HELP] How can i make a timer on my /heal cmd (/showthread.php?tid=66783)



[HELP] How can i make a timer on my /heal cmd - rp4life - 24.02.2009

Код:
	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.


Re: [HELP] How can i make a timer on my /heal cmd - GTAScripter - 24.02.2009

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

SetTimer("HealCheck",3000000,0);