13.09.2012, 15:58
Check if the player is in range of a specific house:
Check if the player is in range of any house:
Код:
stock IsPlayerInRangeOfHouse( playerid, Float:Range, houseid ) { if( IsPlayerInRangeOfPoint( playerid, Range, House[ houseid ][ hExtPosX ], House[ houseid ][ hExtPosY ], House[ houseid ][ hExtPosZ ] ) ); return 1; return 0; }
Код:
stock IsPlayerInRangeOfAnyHouse( playerid, Float:Range ) { for( new houseid = 0; houseid < MAX_HOUSES; houseid ++ ) if( IsPlayerInRangeOfPoint( playerid, Range, House[ houseid ][ hExtPosX ], House[ houseid ][ hExtPosY ], House[ houseid ][ hExtPosZ ] ) ); return houseid; return 0; }