Whats the problem of this script?
#1

this is the script

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/aao", true) == 0) {
MoveObject(gate,-2038.645996,-80.268478,35.359375,2.00);
SendClientMessage(playerid, COLOR_RED, "The Gate is opening now.");
return 1;
}
if(strcmp(cmdtext, "/aac", true) == 0) {
MoveObject(gate,-2044.336182,-80.107742,35.210938,2.00);
SendClientMessage(playerid, COLOR_RED, "The Gate is closing now.");
}
return 1;
if(strcmp(cmdtext, "/aao", true) == 0) {
MoveObject(gate2,-2055.712646,-80.279343,35.359375,2.00);
SendClientMessage(playerid, COLOR_RED, "The Gate is opening now.");
return 1;
}
if(strcmp(cmdtext, "/aac", true) == 0) {
MoveObject(gate2,-2049.752686,-80.108330,35.210938,2.00);
SendClientMessage(playerid, COLOR_RED, "The Gate is closing now.");
}
return 1;
}
return 0;
}
}


i whave fix a lot of problems but this one... not (this comes out when i press F5)

C:\Documents and Settings\Gebruiker\Bureaublad\gta server\gamemodes\island.pwn(430) : warning 217: loose indentation
C:\Documents and Settings\Gebruiker\Bureaublad\gta server\gamemodes\island.pwn(435) : warning 225: unreachable code
C:\Documents and Settings\Gebruiker\Bureaublad\gta server\gamemodes\island.pwn(446) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

the "return 1" under your acc commands need to be inside the brackets.

Also...you realize you are using the same 2 commands for 4 separate routines, right?
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 if(strcmp(cmdtext, "/aao", true) == 0) {
   MoveObject(gate,-2038.645996,-80.268478,35.359375,2.00);
   SendClientMessage(playerid, COLOR_RED, "The Gate is opening now.");
   return 1;
   }
   if(strcmp(cmdtext, "/aac", true) == 0) {
   MoveObject(gate,-2044.336182,-80.107742,35.210938,2.00);
   SendClientMessage(playerid, COLOR_RED, "The Gate is closing now.");
   return 1;     
   }
   if(strcmp(cmdtext, "/aao", true) == 0) {
   MoveObject(gate2,-2055.712646,-80.279343,35.359375,2.00);
   SendClientMessage(playerid, COLOR_RED, "The Gate is opening now."); // change 2nd "/aao" to something else you already used one
   return 1;
   }
   if(strcmp(cmdtext, "/aac", true) == 0) {
   MoveObject(gate2,-2049.752686,-80.108330,35.210938,2.00);
   SendClientMessage(playerid, COLOR_RED, "The Gate is closing now."); // change 2nd "/aac" to something else you already used one
   }
   return 1;
  }
  return 0;
 }
}
Reply


Forum Jump:


Users browsing this thread: