02.07.2014, 17:42
Use IsPlayerInRangeOfPoint
You just need fire station coordinates (/save or /rs ingame)
e.g
You just need fire station coordinates (/save or /rs ingame)
e.g
pawn Код:
CMD:call911( playerid, params[ ] ) // Example command
{
// Your commands go here, e.g :
SendClientMessage( playerid, -1, "You have called 911. Paramedics on building will hear your call. Please wait for respond." );
// Other things ...
// Now, add this (loop to check players inside 911 building)
for ( new i, j = GetMaxPlayers( ); i < j; ++ i )
{
if ( !IsPlayerConnected( i ) )
continue;
if ( !IsPlayerInRangeOfPoint( i, 10.0, POSITION_X, POSITION_Y, POSITION_Z ) ) // Change this positions
continue;
// Passed all checks, play audio stream
PlayAudioStreamForPlayer( i, "http://example_audio/911.wav" ); // Change to your audio stream
}
return true;
}