12.06.2011, 02:26
Hey, here are the objects ID and position (two gates, they'll open in opposite directions)
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
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.
Hope that helps.
EDIT: Sorry, I thought you were referring to adding the gate to the main entrance of the base.
Код:
-- 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
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;
}
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 );
EDIT: Sorry, I thought you were referring to adding the gate to the main entrance of the base.

