SA-MP Forums Archive
IsPlayerInRangeOfPoint - 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: IsPlayerInRangeOfPoint (/showthread.php?tid=109541)



IsPlayerInRangeOfPoint - Galcio - 20.11.2009

Okay, I want to create a command that'll teleport me to a map I've created. But I want it only to be able to TP there if the player is at the LS stadium. I've made it this far:
Quote:

{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.843)
SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!");
return 1;
}

I'm not sure how to continue, I guess I should type SetPlayerPos(playerid, coords where the map is); And please don't tell me to visit samp wiki. I've looked there and couldn't find what I am looking for.
I'm a noob at pawn, so please, help me out!


Re: IsPlayerInRangeOfPoint - boelie - 20.11.2009

just do setplayerpos under the message you made.

should work..just try .

if you are teleporting to an interior you should find the interior id and use setplayerinterior to

have fun!


Re: IsPlayerInRangeOfPoint - Galcio - 20.11.2009

I tried this:
Код:
    {
 		if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
 		SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!");
 		SetPlayerInterior(playerid, 0);
 		SetPlayerPos(playerid, 1970.3921, -1276.3458, 23.9908);
  	    return 1;
	}
Problem: It lets me teleport to the coords wherever I am, I want it to only let me once I'm at the stadium.
Anyone know how to solve this?

EDIT: Fixed!