for( new e; e < MAX_ENTRANCES; e ++ )
{
if( IsPlayerInRangeOfPoint( playerid, 1.5, EntranceInfo [ e ] [ eX ], EntranceInfo [ e ] [ eY ], EntranceInfo [ e ] [ eZ ] ) && tdShown [ playerid ] == false )
{
tdShown [ playerid ] = true;
TextDrawShowForPlayer( playerid, EnterExitHelp );
}
else if( tdShown [ playerid ] == true && !IsPlayerInRangeOfPoint( playerid, 1.5, EntranceInfo [ e ] [ eX ], EntranceInfo [ e ] [ eY ], EntranceInfo [ e ] [ eZ ] ) )
{
tdShown [ playerid ] = false;
TextDrawHideForPlayer( playerid, EnterExitHelp );
}
}
for( new e; e < MAX_ENTRANCES; e ++ )
{
if( IsPlayerInRangeOfPoint( playerid, 1.5, EntranceInfo [ e ] [ eX ], EntranceInfo [ e ] [ eY ], EntranceInfo [ e ] [ eZ ] ) && tdShown [ playerid ] == false )
{
tdShown [ playerid ] = true;
TextDrawShowForPlayer( playerid, EnterExitHelp );
break;
}
else if( tdShown [ playerid ] == true && !IsPlayerInRangeOfPoint( playerid, 1.5, EntranceInfo [ e ] [ eX ], EntranceInfo [ e ] [ eY ], EntranceInfo [ e ] [ eZ ] ) )
{
tdShown [ playerid ] = false;
TextDrawHideForPlayer( playerid, EnterExitHelp );
}
}
You don't need to re-check the conditions you tested for. You could simply write "else", which would stop an extra function call and variable look-up.
|