SA-MP Forums Archive
[HELP] How can I make more than one /enter and /exit ? - 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] How can I make more than one /enter and /exit ? (/showthread.php?tid=80421)



[HELP] How can I make more than one /enter and /exit ? - FreddeN - 04.06.2009

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


Re: [HELP] How can I make more than one /enter and /exit ? - Gamer007 - 04.06.2009

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.


Re: [HELP] How can I make more than one /enter and /exit ? - Weirdosport - 04.06.2009

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...


Re: [HELP] How can I make more than one /enter and /exit ? - FreddeN - 04.06.2009

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...


Re: [HELP] How can I make more than one /enter and /exit ? - efeX - 04.06.2009

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.