[HELP] How can I make more than one /enter and /exit ?
#1

When I go to my position and type /enter, I just spawn at the other /enter position...

The script:

Код:
	if (strcmp("/enter", cmdtext, true) == 0)
	{
		if(PlayerToPoint(5.0, playerid, -1605.6515,712.0331,13.8672))

		SetPlayerPos(playerid, 246.7840,63.9002,1003.6406);
		SetPlayerInterior(playerid, 6);
		return 1;
	}
	
	if (strcmp("/exit", cmdtext, true) == 0)
	{
		if(PlayerToPoint(5.0, playerid, 246.7840,63.9002,1003.6406))

		SetPlayerPos(playerid, -1605.6515,712.0331,13.8672);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
	
	if (strcmp("/enter", cmdtext, true) == 0)
	{
		if(PlayerToPoint(5.0, playerid, -1606.3541,672.6132,-5.2422))

		SetPlayerPos(playerid, 246.7840,63.9002,1003.6406);
		SetPlayerInterior(playerid, 6);
		return 1;
	}
	
	if (strcmp("/exit", cmdtext, true) == 0)
	{
		if(PlayerToPoint(5.0, playerid, 246.7840,63.9002,1003.6406))

		SetPlayerPos(playerid, -1606.3541,672.6132,-5.2422);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
Thanks
Reply
#2

i think thats perfectly correct. because it got playertopoint so if he is to point
Код:
 -1605.6515,712.0331,13.8672))
then he'll enter the building

Код:
246.7840,63.9002,1003.6406
and the same with other one.
Reply
#3

You can't have 2 commands by the same name (well not if you use return 1. Try this:

EDIT: Just realised both of your exit co-ordinates are the same...
Reply
#4

Quote:
Originally Posted by Weirdosport
You can't have 2 commands by the same name (well not if you use return 1. Try this:

EDIT: Just realised both of your exit co-ordinates are the same...
It works, but Now I got the prblem, when I type /enter or /exit, it says "SERVER UNKNOWN Command", but it works...
Reply
#5

Here's something i use...

Код:
if (strcmp(cmd, "/enter", true) == 0)
	{
		if (PlayerToPoint(playerid, 5.0, 2498.3540, -1644.1443, 13.7826)) // GroveHouse1
		{
			SetPlayerInterior(playerid, 1);
			SetPlayerPos(playerid, 223.043991, 1289.259888,	1082.199951); 
		}
        if (PlayerToPoint(playerid, 5.0, 3623.3540, -0644.1443, 11.7826)) // GroveHouse2
		{
			SetPlayerInterior(playerid, 1);
			SetPlayerPos(playerid, 223.043991, 1289.259888,	1082.199951); 
		}
		return 1;
	}
Brackets are the key.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)