SA-MP Forums Archive
[HELP] When I type /exit i teleport to nowhere... - 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] When I type /exit i teleport to nowhere... (/showthread.php?tid=79302)



[HELP] When I type /exit i teleport to nowhere... - FreddeN - 27.05.2009

I use this script:

Код:
  if (strcmp("/enter", cmdtext, true) == 0)
	{
		if(PlayerToPoint(5.0, playerid, 1568.5195,-1690.6931,5.8906))
	{
		SetPlayerPos(playerid, -2028.3383,-104.9234,1035.1719);
		SetPlayerInterior(playerid, 3);
	}
		else
	{
		SendClientMessage(playerid, 0xFF0000AA, "You must be closer!");
	}
		return 1;
	}

	if (strcmp("/exit", cmdtext, true) == 0)
	{
	  SetPlayerInterior(playerid, 3);
		if(PlayerToPoint(5.0, playerid, -2028.3383,-104.9234,1035.1719))
	{
		SetPlayerPos(playerid, 1568.5195,-1690.6931,5.8906);
 	}
		else
	{
		SendClientMessage(playerid, 0xFF0000AA, "You must be closer!");
	}
		return 1;
	}
}
When I type /enter near the spot, I come to the interior I want, but when I type /exit I teleport back to the door... but, the world is not there, I can just see gray, no houses, nothing...

What is wrong?


Re: [HELP] When I type /exit i teleport to nowhere... - Weirdosport - 27.05.2009

SetPlayerInterior(playerid, 3); --> SetPlayerInterior(playerid, 0);


Re: [HELP] When I type /exit i teleport to nowhere... - shitbird - 27.05.2009

you are using SetPlayerInterior 3, which is most likely inside a house, to get out of a house, use SetPlayerInterior 0.


Re: [HELP] When I type /exit i teleport to nowhere... - @TheShadow@ - 27.05.2009

Your problem ist :
Quote:
Originally Posted by FreddeN
Код:
  
	if (strcmp("/exit", cmdtext, true) == 0)
	{
	  SetPlayerInterior(playerid, 3);
		if(PlayerToPoint(5.0, playerid, -2028.3383,-104.9234,1035.1719))
	{
		SetPlayerPos(playerid, 1568.5195,-1690.6931,5.8906);
 	}
		else
	{
		SendClientMessage(playerid, 0xFF0000AA, "You must be closer!");
	}
		return 1;
	}
}
You see? Thats not good^^ Except of that better use:
Код:
	if (strcmp("/exit", cmdtext, true) == 0)
	{
	  
		if(PlayerToPoint(5.0, playerid, -2028.3383,-104.9234,1035.1719))
	{
		SetPlayerPos(playerid, 1568.5195,-1690.6931,5.8906);
             SetPlayerInterior(playerid,0);
 	}
		else
	{
		SendClientMessage(playerid, 0xFF0000AA, "You must be closer!");
	}
		return 1;
	}
EDIT: Lol u 2 were a few seconds faster than me^^


Re: [HELP] When I type /exit i teleport to nowhere... - FreddeN - 27.05.2009

It works
You maybe can help me with another quastion that have to do with this?
I want to remove the markers on the doors that makes you enter it when you go in the marker, I want to use /exit and /enter.

Thx!


Re: [HELP] When I type /exit i teleport to nowhere... - shitbird - 27.05.2009

head to OnGameModeInit.

Type:
pawn Код:
DisableInteriorEnterExits();