Need help with /enter and /exit
#1

So, I am trying to make the commands /enter and /exit to make a player exit and enter the spawn.
But for some reason the player won't spawn outside or inside, it just stays in the same position.
This is my code:

Код:
CMD:enter(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 3.0, 1685.0341,-1343.4779,17.4349))
	{
	    if(pInfo[playerid][Sex] == 1)
	    {
	        SetSpawnInfo(playerid, 0, 3, 161.4045, -95.8079, 1001.8047, 347.3583, 0, 0, 0, 0, 0, 0);
	        SetPlayerInterior(playerid, 18);
	        SpawnPlayer(playerid);
	    }
		if(pInfo[playerid][Sex] == 2)
		{
		    SetSpawnInfo(playerid, 0, 11, 161.4045, -95.8079, 1001.8047, 347.3583, 0, 0, 0, 0, 0, 0);
		    SetPlayerInterior(playerid, 18);
		    SpawnPlayer(playerid);
		}
	}
	return 1;
}
CMD:exit(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 3.0, 161.4045, -95.8079, 1001.8047))
	{
	    if(pInfo[playerid][Sex] == 1)
	    {
	        SetSpawnInfo(playerid, 0, 3, 1685.0341, -1343.4779, 17.4349, 274.0744, 0, 0, 0, 0, 0, 0);
	        SetPlayerInterior(playerid, 0);
	        SpawnPlayer(playerid);
	    }
	    if(pInfo[playerid][Sex] == 2)
	    {
	        SetSpawnInfo(playerid, 0, 11, 1685.0341, -1343.4779, 17.4349, 274.0744, 0, 0, 0, 0, 0, 0);
	        SetPlayerInterior(playerid, 0);
	        SpawnPlayer(playerid);
	    }
	}
	return 1;
}
Reply
#2

You are setting their spawn information but you not actually spawning them... use SpawnPlayer(playerid); after the setspawninfo
Reply
#3

Quote:
Originally Posted by Blademaster680
Посмотреть сообщение
You are setting their spawn information but you not actually spawning them... use SpawnPlayer(playerid); after the setspawninfo
I have updated the Code, but i have another problem. If your gender is "Female" and you use/exit. It won't work.
Reply
#4

Not sure if this is right but
Change this
pawn Код:
if(pInfo[playerid][Sex] == 2)
To this
pawn Код:
else  if(pInfo[playerid][Sex] == 2)
Reply
#5

Quote:
Originally Posted by 1fret
Посмотреть сообщение
Not sure if this is right but
Change this
pawn Код:
if(pInfo[playerid][Sex] == 2)
To this
pawn Код:
else  if(pInfo[playerid][Sex] == 2)
Nope it doesn't work :/
Reply
#6

Why u are not using SetPlayerPos ? i have using this one for enter exit and its works for my fine , or u can use iee
to create enter exit point without typing anything , or another way to do this u can use enter key to enter or exit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)