[HELP] /enter and /exit problem
#1

This is a little hard to tell, but I will try...

This is my /enter and /exit script, it is added to two doors and the /exit in inside the interior so I can get out again.

Код:
  if (strcmp("/enter", cmdtext, true, 6) == 0)
  {
    if(PlayerToPoint(1,playerid,-1862.1277,-145.4071,11.8984))
		{
			SetPlayerInterior(playerid,1);
			SetPlayerPos(playerid,963.418762,2108.292480,1011.030273);
			return 1;
		}
		
		else if(PlayerToPoint(1,playerid,-2033.9464,148.6126,28.8359))
		{
		  SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,501.980987,-69.150199,998.757812);
			return 1;
		}
	}
	
	if (strcmp("/exit", cmdtext, true, 5) == 0)
	{
	  if(PlayerToPoint(1,playerid,963.418762,2108.292480,1011.030273))
	  {
  			SetPlayerInterior(playerid,0);
			SetPlayerPos(playerid,-1862.1277,-145.4071,11.8984);
			return 1;
		}
	}
	
	else if(PlayerToPoint(1,playerid,501.980987,-69.150199,998.757812))
	{
 		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,-2033.9464,148.6126,28.8359);
		return 1;
	}
	return 0;
}
The script works at the first /enter and /exit, but when I type /enter at the second one, it send me to the interior, but when I want to /exit it tells me Unknown Command, but if I type /enter again from the interior it send me outside...

I hope you understand what I mean, thanks.
Reply
#2

pawn Код:
if (strcmp("/exit", cmdtext, true, 5) == 0)
{
  if(PlayerToPoint(1,playerid,963.418762,2108.292480,1011.030273))
  {
     SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1862.1277,-145.4071,11.8984);
}

else if(PlayerToPoint(1,playerid,501.980987,-69.150199,998.757812))
{
     SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-2033.9464,148.6126,28.8359);
}
return 0;
}
This should work.
Reply
#3

Quote:
Originally Posted by Jakku
pawn Код:
if (strcmp("/exit", cmdtext, true, 5) == 0)
{
  if(PlayerToPoint(1,playerid,963.418762,2108.292480,1011.030273))
  {
     SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1862.1277,-145.4071,11.8984);
}

else if(PlayerToPoint(1,playerid,501.980987,-69.150199,998.757812))
{
     SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-2033.9464,148.6126,28.8359);
}
return 0;
}
This should work.
Thanks friend, that did it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)