Help with command
#1

I got this command to heal people its working but now i need that the command will work only if i am standing near the player i am trying to heal... here's the command

Код:
	if (strcmp(cmd, "/tryheal", true) == 0)
	{
		new index;
		cmd = strtok(cmdtext, index);
		new playa;
		tmp = strtok(cmdtext, index);
		
		if (strlen(tmp))
		{
			playa = strval(tmp);
		 	new succeed = 1 + random(2);
			if(succeed == 1)
			{
				SetPlayerHealth(playa, 75);
				TogglePlayerControllable(playa, 1);
				format(string, sizeof(string), " %s tries to heal %s and success.", GetPlayerNameEx(playerid), GetPlayerNameEx(playa));
				ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
			else if(succeed == 2)
			{
				format(string, sizeof(string), " %s tries to heal %s and failed.", GetPlayerNameEx(playerid), GetPlayerNameEx(playa));
				ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
		}
		else
		{
			SendClientMessage(playerid, 0x919191ff, "USAGE:/heal <playerid>");
		}
		return 1;
	}
Reply


Messages In This Thread
Help with command - by [Sk]Noob - 21.08.2009, 16:00
Re: Help with command - by MenaceX^ - 21.08.2009, 16:20
Re: Help with command - by [Sk]Noob - 21.08.2009, 16:59
Re: Help with command - by MenaceX^ - 21.08.2009, 17:06

Forum Jump:


Users browsing this thread: 1 Guest(s)