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



PlayerToPoint issue - SimonXY - 01.06.2009

Hello everyone, i've been adding several cluckinbells and burger shots in my script but i'm encountering a problem; since i'm using the same interior for each cluckin bell and burger shot, my PlayerToPoint is the same for all of them so it usually will bring me back to only one spot when i leave the building. Is there a way i can set it so that i can use the same interior but make it so that it brings me back outside to where i originally came in?


Re: PlayerToPoint issue - hoodline - 01.06.2009

Virtual Worlds


Re: PlayerToPoint issue - SimonXY - 01.06.2009

how do i assign virtual worlds to specific coordinates?


Re: PlayerToPoint issue - SimonXY - 01.06.2009

like for example i have these two 24/7's assigned for the command /enter

Код:
		if (PlayerToPoint(2.0, playerid,2247.5637,2396.6123,10.8203))//24/7 2 entrance
			{
				EnteredShop[playerid] = 3;//entered third 24/7
			  SetPlayerInterior(playerid,6);
				SetPlayerPos(playerid,-26.6916,-55.7149,1003.5469);
			}
			if (PlayerToPoint(2.0, playerid,2187.9460,2469.8042,11.2422))//24/7 3 entrance
			{
				EnteredShop[playerid] = 1;//entered first 24/7
			  SetPlayerInterior(playerid,6);
				SetPlayerPos(playerid,-26.6916,-55.7149,1003.5469);
			}
and i have these two assigned for the command /exit

Код:
	else if (EnteredShop[playerid] == 2 && PlayerToPoint(5.0, playerid,-26.6916,-55.7149,1003.5469))//second 24/7 exit
			{
			  EnteredShop[playerid] = 0;//exited shop
				SetPlayerPos(playerid,2097.6501,2224.4165,11.0234);
			 	SetPlayerInterior(playerid,0);
			}
			else if (EnteredShop[playerid] == 3 && PlayerToPoint(5.0, playerid,-26.6916,-55.7149,1003.5469))//third 24/7 exit
			{
			  EnteredShop[playerid] = 0;//exited shop
				SetPlayerPos(playerid,2187.9460, 2469.8042, 11.2422);
			 	SetPlayerInterior(playerid,0);
			}
How do i determine which ones match up?


Re: PlayerToPoint issue - hoodline - 01.06.2009

SetPlayerVirtualWorld(playerid, worldid);

you can reuse worlds over and over but make sure there not in the same place

pawn Код:
if (PlayerToPoint(2.0, playerid,2187.9460,2469.8042,11.2422))//24/7 3 entrance
{
  EnteredShop[playerid] = 1;//entered first 24/7
  SetPlayerInterior(playerid,6);
  SetPlayerPos(playerid,-26.6916,-55.7149,1003.5469);
  SetPlayerVirtualWorld(playerid, worldid);
}
If its for an exit use virtual world 0 to get back to the normal world

Virtual Worlds


Re: PlayerToPoint issue - SimonXY - 01.06.2009

ok thanks alot man i appreciate it


Re: PlayerToPoint issue - hoodline - 01.06.2009

No problem


Re: PlayerToPoint issue - SimonXY - 02.06.2009

btw, can i use that same command for other buildings that are not shops?


Re: PlayerToPoint issue - hoodline - 02.06.2009

yeah just change the interior id and the coords and virtual world if you need to


Re: PlayerToPoint issue - SimonXY - 02.06.2009

EDIT: i tried to use the same command with a bank and this is what happend:

i go to the second bank i created, it lets me in fine but then when i want to leave it brings me outside the other bank so i go in that bank(first one i created) again and then go exit again and brings me where i want it to...anyone know why it is doing this?