SA-MP Forums Archive
Help with command - 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 with command (/showthread.php?tid=92686)



Help with command - [Sk]Noob - 21.08.2009

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;
	}



Re: Help with command - MenaceX^ - 21.08.2009

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 !.");



Re: Help with command - [Sk]Noob - 21.08.2009

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



Re: Help with command - MenaceX^ - 21.08.2009

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.