SA-MP Forums Archive
[Help] Autogates - 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: [Help] Autogates (/showthread.php?tid=86903)



[Help] Autogates - [mad]MLK - 16.07.2009

hey heres my script is there anything wrong i get a compile error but i dont know if i have done it like the tutorial said:

Код:
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(498) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
(the error is on the return 1; line)

Код:
public isPlayerInArea()
  {
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
      GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
      if (X <= 2047 && X >= 2031 && Y <= 2779 && Y >= 2769)
      /* This line is the important one!. Here, is where you change those numbers, by the ones
      you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
      doesn't matter*/

      {
      MoveObject(maingate, 222.00, 1875.53, 13.80, 1); // MoveObject(ObjectID, X, Y, Z, speed); - Object id is the "New"
      }
      else // else means that if nothing is in it, perform this action:
      {
      MoveObject(maingate, 214.45, 1875.53, 13.80, 1); // This will close the gate
      }
   }
   
	return 1;
}



Re: [Help] Autogates - refshal - 16.07.2009

pawn Код:
public isPlayerInArea()
{
new Float:X, Float:Y, Float:Z; //We use this to store player position
for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
{
GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
if (X <= 2047 && X >= 2031 && Y <= 2779 && Y >= 2769)
/* This line is the important one!. Here, is where you change those numbers, by the ones
you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
doesn't matter*/

{
MoveObject(maingate, 222.00, 1875.53, 13.80, 1); // MoveObject(ObjectID, X, Y, Z, speed); - Object id is the "New"
}
else // else means that if nothing is in it, perform this action:
{
MoveObject(maingate, 214.45, 1875.53, 13.80, 1); // This will close the gate
}
}



Re: [Help] Autogates - [mad]MLK - 16.07.2009

when i do that i get this:

Код:
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(498) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(498) : error 004: function "OnObjectMoved" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(503) : warning 225: unreachable code
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(503) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(503) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(508) : warning 225: unreachable code
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(508) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(508) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(510) : error 017: undefined symbol "pickupid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(512) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(513) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(516) : error 017: undefined symbol "pickupid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(518) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(519) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(521) : error 017: undefined symbol "pickupid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(523) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(524) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(525) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(526) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(527) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(528) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(529) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(530) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(531) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(536) : warning 225: unreachable code
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(536) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(536) : error 004: function "OnPlayerSelectedMenuRow" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(539) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(543) : error 017: undefined symbol "row"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: [Help] Autogates - refshal - 16.07.2009

You must have done something wrong. Placed it wrong, or missed a bracket. Because I didn't edit the script, I just deleted the space in your lines.


Re: [Help] Autogates - saiberfun - 16.07.2009

pawn Код:
public isPlayerInArea()
{
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
      GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
      if (X <= 2047 && X >= 2031 && Y <= 2779 && Y >= 2769)
      /* This line is the important one!. Here, is where you change those numbers, by the ones
      you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
      doesn't matter*/


      {
      MoveObject(maingate, 222.00, 1875.53, 13.80, 1); // MoveObject(ObjectID, X, Y, Z, speed); - Object id is the "New"
      }
      else // else means that if nothing is in it, perform this action:
      {
      MoveObject(maingate, 214.45, 1875.53, 13.80, 1); // This will close the gate
      }
   }
   
return 1;
}



Re: [Help] Autogates - [mad]MLK - 16.07.2009

hey eddy i just copied and pasted that code in its place =/ and saiberfun i get errors on the return 1; line again with that:
Код:
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(498) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: [Help] Autogates - refshal - 16.07.2009

pawn Код:
forward IsPlayerInArea();
public IsPlayerInArea()
{
  new Float:X, Float:Y, Float:Z; //We use this to store player position
  for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
  {
    GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
    if (X <= 2047 && X >= 2031 && Y <= 2779 && Y >= 2769)
    /* This line is the important one!. Here, is where you change those numbers, by the ones
    you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
    doesn't matter*/

    {
    MoveObject(maingate, 222.00, 1875.53, 13.80, 1); // MoveObject(ObjectID, X, Y, Z, speed); - Object id is the "New"
    }
    else // else means that if nothing is in it, perform this action:
    {
    MoveObject(maingate, 214.45, 1875.53, 13.80, 1); // This will close the gate
    }
  }
}



Re: [Help] Autogates - [mad]MLK - 16.07.2009

hmm that compiles without errors but my gates dont open


Re: [Help] Autogates - [mad]MLK - 17.07.2009

*Bump* Since forum fixed.


Re: [Help] Autogates - Jakku - 27.09.2009

Quote:
Originally Posted by [mad
MLK (dino-host.net) ]
when i do that i get this:

Код:
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(498) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(498) : error 004: function "OnObjectMoved" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(503) : warning 225: unreachable code
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(503) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(503) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(508) : warning 225: unreachable code
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(508) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(508) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(510) : error 017: undefined symbol "pickupid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(512) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(513) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(516) : error 017: undefined symbol "pickupid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(518) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(519) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(521) : error 017: undefined symbol "pickupid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(523) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(524) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(525) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(526) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(527) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(528) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(529) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(530) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(531) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(536) : warning 225: unreachable code
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(536) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(536) : error 004: function "OnPlayerSelectedMenuRow" is not implemented
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(539) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Chris\Desktop\Stunt City\gamemodes\NewServer.pwn(543) : error 017: undefined symbol "row"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
If there are 26 errors, you're missing a bracket