That auto opens it too.
pawn Код:
public OnGameModeInit( ) {
gate = CreateObject( 980, 2287.30004883, 605.29998779, 12.50,0.0, 0.0, 359.98901367 );
SetTimer( "gatecheck", 1000, 1 );
return true;
}
public OnPlayerCommandText( playerid, cmdtext[ ] ) {
if( !strcmp( cmdtext, "/open", true, 5 ) )
return MoveObject( gate, 2287.30004883, 605.29998779, 6.50, 7 ), true;
return false;
}
forward gatecheck( );
public gatecheck( ) {
new
Float:x
,Float:y
,Float:z
,c = 0
;
GetObjectPos( gate, x, y, z );
if( x != 2287.30004883 && y != 605.29998779 && z != 12.50 ) {
for( new i = 0; i < MAX_PLAYERS; i++ )
if( IsPlayerInRangeOfPoint( i, 5.0, x, y, z ) )
c++;
if( c == 0 )
MoveObject( gate, 2287.30004883, 605.29998779, 12.50, 7 );
}
return true;
}
Untested.