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

pawn Код:
new
  Float:x,
  Float:y,
  Float:z;

GetPlayerPos(playa,x,y,z);
if(!IsPlayerInRangeOfPoint(5.0,playerid,x,y,z)) return SendClientMessage(playerid,color,"You're not near him !.");
Reply
#3

Код:
C:\Documents and Settings\Yarik\Desktop\ц'йийн\one of the best edits\gamemodes\crp.pwn(11672) : error 017: undefined symbol "IsPlayerInRangeOfPoint"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Quote:
Originally Posted by [Sk
Noob ]
Код:
C:\Documents and Settings\Yarik\Desktop\ц'йийн\one of the best edits\gamemodes\crp.pwn(11672) : error 017: undefined symbol "IsPlayerInRangeOfPoint"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Meh, it's a 0.3 function. Use PlayerToPoint until 0.3 gets released.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)