SA-MP Forums Archive
Whats the problem of this script? - 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: Whats the problem of this script? (/showthread.php?tid=82181)



Whats the problem of this script? - Thommetje - 16.06.2009

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.


Re: Whats the problem of this script? - kaisersouse - 16.06.2009

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?


Re: Whats the problem of this script? - *ToM* - 16.06.2009

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;
 }
}