[I Need] Script For Area 51 Gate To be open?
#5

Hey, here are the objects ID and position (two gates, they'll open in opposite directions)
Код:
-- Closed Position
2927 -> 215.941, 1874.571, 13.903
2929 -> 211.842, 1874.571, 13.903
-- Opened Position
2927 -> 219.941, 1874.571, 13.903
2929 -> 207.842, 1874.571, 13.903
-- Credits to Yom for the positions
And it really depends how you would like them to be opened. Here is an example when an administrator types /opengate to open and /closegate to close
pawn Код:
ZCMD:opengate( playerid, params[ ] ) {

   if( !IsPlayerAdmin( playerid ) )
      return 1;

   MoveObject( a51_gate[ 0 ], 219.941, 1874.571, 13.903, 0.5 );
   MoveObject( a51_gate[ 1 ], 207.842, 1874.571, 13.903, 0.5 );
   return 1;
}

ZCMD:closegate( playerid, params[ ] ) {

   if( !IsPlayerAdmin( playerid ) )
      return 1;

   MoveObject( a51_gate[ 0 ], 215.941, 1874.571, 13.903, 0.5 );
   MoveObject( a51_gate[ 1 ], 211.842, 1874.571, 13.903, 0.5 );
   return 1;
}
You can, of course, expand on these commands to include other checks, such as if the gate is already open or not. With this, you'll also need to declare the a51_gate variable and create the objects themselves.
pawn Код:
// Above main() function
new a51_gate[ 2 ];

// Under OnGameModeInit( ) or OnFilterScriptInit, depending on your script
a51_gate[ 0 ] = CreateObject( 2927, 215.941, 1874.571, 13.903, 0.00, 0.00, 0.00 );
a51_gate[ 1 ] = CreateObject( 2929, 211.842, 1874.571, 13.903, 0.00, 0.00, 0.00 );
Hope that helps.

EDIT: Sorry, I thought you were referring to adding the gate to the main entrance of the base.
Reply


Messages In This Thread
[I Need] Script For Area 51 Gate To be open? - by Bmxerlmao5288 - 12.06.2011, 02:05
Re: [I Need] Script For Area 51 Gate To be open? - by Forever Alone - 12.06.2011, 02:22
Re: [I Need] Script For Area 51 Gate To be open? - by Tee - 12.06.2011, 02:22
Re: [I Need] Script For Area 51 Gate To be open? - by Lorenc_ - 12.06.2011, 02:25
Re: [I Need] Script For Area 51 Gate To be open? - by Bakr - 12.06.2011, 02:26
Re: [I Need] Script For Area 51 Gate To be open? - by marwan - 12.06.2011, 07:59
Re: [I Need] Script For Area 51 Gate To be open? - by Bmxerlmao5288 - 12.06.2011, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)