[HELP] Creating Gates
#1

Made my first attempt at creating gates.

Here it is.

Код:
	
//******************************************* GATES ************************************************//
	pd1 = CreateObject(969, 1539.631104, -1632.148315, 12.549690, 0.000000, 0.000000, -270.000001124);
	pd2 = CreateObject(11327, 1589.443604, -1638.348755, 14.877016, 0.000000, 0.859436692696, -89.999981276);

	//*************************************** GATE COMMANDS *******************************//
	else if (strcmp(cmd, "/pdgate", true) == 0)
	{
	  //if(!hasPermission(playerid,PER_PDACC)){ return 1;}
			tmp = strtok(cmdtext, idx);
 			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pdgate [open/close]
			}

			else if (strcmp("open",tmp,true) == 0)
			{
				MoveObject(pd1, 1539.631104, -1632.148315, 16.124636, SPEED);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "MESSAGE: LSPD Gate Opened");
		  }
		  
		  else if (strcmp("close",tmp,true) == 0)
			{
				MoveObject(pd1, 1539.631104, -1632.148315, 12.549690, SPEED);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "MESSAGE: LSPD Gate Opened");
		  }
		 	else SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: You're not allowed to use this command");
		}

		return 1;
	}
Pawn compiler crashes. Obviously. Forgive me, it's my first time.

Yes, I have defined the two gates. PD1 and PD2, but Ive only created the command for PD1. Could someone correct my code?

Thanks.
Reply
#2

else if (strcmp(cmd, "/pdgate", true) == 0)

id say just delete the else O_O
dunno why it should be on the command line
and if that won't work add it again n check ur brackets
Reply
#3

'READ THIS BEFORE POSTING! This goes for Godfather posts too!'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)