Adding audio stream
#2

Use IsPlayerInRangeOfPoint
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;
}
Reply


Messages In This Thread
Adding audio stream - by ShiffeyTheGamer - 02.07.2014, 17:21
Re: Adding audio stream - by greentarch - 02.07.2014, 17:42
Re: Adding audio stream - by ShiffeyTheGamer - 02.07.2014, 17:48
Re: Adding audio stream - by greentarch - 02.07.2014, 17:57
Re: Adding audio stream - by ShiffeyTheGamer - 02.07.2014, 20:11
Re: Adding audio stream - by ShiffeyTheGamer - 07.07.2014, 02:06
Re: Adding audio stream - by nmader - 07.07.2014, 02:23

Forum Jump:


Users browsing this thread: 1 Guest(s)