Help needed with Multiple moveing objects by command
#1

It compiles perfactly but apon testing the objects do not move, Any help welcome
Код:
public OnPlayerCommandText(playerid, cmdtext[])

     	if(strcmp(cmd, "/mdefon", true) == 0) { // Command
		MoveObject(MUF_Tower1, 1035.043, 1124.109, 10.076, 2.0); // Move object up
		MoveObject(MUF_Tower2, 1053.150, 1138.733, 10.076, 2.0); // Move object up
		MoveObject(MUF_Stair1, 1024.954, 1112.197, 12.594, 2.0);
		MoveObject(MUF_Stair2, 1020.921, 1103.657, 17.541, 2.0);
		MoveObject(MUF_Stair3, 1018.094, 1097.522, 22.220, 2.0);
		SendClientMessage(playerid, COLOR_RED, "The Defences are ON"); // Messege to tell it worked
		return 1;
	}
	if(strcmp(cmd, "/mdefoff", true) == 0) { // Command
		MoveObject(MUF_Tower1, 1035.043, 1124.109, -30.076, 2.0); // Move object down
		MoveObject(MUF_Tower2, 1053.150, 1138.733, -30.076, 2.0); // Move object down
		MoveObject(MUF_Stair1, 1024.954, 1112.197, -30.594, 2.0);
		MoveObject(MUF_Stair2, 1020.921, 1103.657, -30.541, 2.0);
		MoveObject(MUF_Stair3, 1018.094, 1097.522, -30.220, 2.0);
		SendClientMessage(playerid, COLOR_GREEN, "The Defences are OFF"); //Messege to tell it worked
Reply
#2

I doubt it compile fine.. you forgot brackets, you don't return any values, and you use cmd instead of cmdtext.
Reply
#3

http://pawn.pastebin.com/m7be6e7f

Try using that. The reasons it failed is probably because your brackets were in the wrong places, and you need a closing bracket like this one. } Also, you needed to set a return for your second command.

EDIT Also, check that your COLOR_RED and COLOR_GREEN 's are defined correctly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)