[HELP] When I type /exit i teleport to nowhere...
#1

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

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

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

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^^
Reply
#5

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!
Reply
#6

head to OnGameModeInit.

Type:
pawn Код:
DisableInteriorEnterExits();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)