Simple /enter command problem
#1

So I have this code for my server I'm working on, I want to make it to where you type /enter to enter a building, and /exit to leave the building. Here is the code:

Code:
	if (strcmp("/enter", cmdtext, true, 6) == 1)
	{
		if (PlayerToPoint(playerid, Float:10, Float:2104.8997, Float:-1806.4668, Float:14.1484) == 0)
		{
			SetPlayerInterior(playerid, 5);
			SetPlayerPos(playerid, Float:372.3520, Float:-131.6543, Float:1001.4922);
			SendClientMessage(playerid, 0xffffffff, "Welcome to the Pizza Parlor");
			SetPlayerFacingAngle(playerid, Float:0.0);
			return 1;
		}
		else if (PlayerToPoint(playerid, Float:10, Float:1554.9174, Float:-1675.5553, Float:15.5010) == 0)
		{
		  SetPlayerInterior(playerid, 6);
		  SetPlayerPos(playerid, Float:246.7840, Float:63.9002, Float:1003.6406);
		  SendClientMessage(playerid, 0xffffffff, "Welcome to the Police Department");
		  return 1;
 		}
 		else
 		{
 		  SendClientMessage(playerid, 0xff0000AA, "ERROR: You can't enter here!");
		}
The command works when the "If" lines all have the final parameter " == 0)" but then the command will teleport you to the Pizzaria, regardless of your location. When the "If" lines are set to == 1, I get the message "SERVER: Unknown Command". It's probably something simple that I'm missing, and I'm still new with "if". Please help, and thanks in advance.

P.S. I have a feeling that it is failing due to the "If" lines.
Reply


Messages In This Thread
Simple /enter command problem - by Annihalation - 15.07.2009, 23:10
Re: Simple /enter command problem - by woot - 15.07.2009, 23:14
Re: Simple /enter command problem - by Annihalation - 15.07.2009, 23:21
Re: Simple /enter command problem - by Annihalation - 15.07.2009, 23:28
Re: Simple /enter command problem - by Abernethy - 15.07.2009, 23:30
Re: Simple /enter command problem - by Annihalation - 15.07.2009, 23:39
Re: Simple /enter command problem - by Annihalation - 16.07.2009, 00:20
Re: Simple /enter command problem - by Abernethy - 16.07.2009, 04:49
Re: Simple /enter command problem - by Annihalation - 16.07.2009, 05:03
Re: Simple /enter command problem - by woot - 16.07.2009, 08:56

Forum Jump:


Users browsing this thread: 3 Guest(s)