11.02.2011, 16:07
pawn Код:
public OnGameModeInit( )
{
SetTimer( "opengate", (1 * 1000), 1 );
SetTimer( "closegate", (1 * 1000), 1 );
return true;
}
pawn Код:
forward opengate( );
public opengate( )
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerInRangeOfPoint( i, 5.0, Float:x, Float:y, Float:z ) ) // CHANGE THE X, Y, Z
MoveObject( Minigame, 1845.92114258,-1898.49877930,36.24028015,3 );
}
return true;
}
pawn Код:
forward closegate( );
public closegate( )
{
new a = 0;
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerInRangeOfPoint( i, 5.0, Float:x, Float:y, Float:z ) ) // CHANGE THE X, Y, Z TOO
{
a++;
}
}
if ( a == 0 ) // If no one is close to the gates, it will close them!
MoveObject( Minigame, 1877.67846680,-1875.85620117,36.24028015,3 );
return true;
}