Help for audio music
#1

Hi everyone,
I need some solutions to make all the passengers of a vehicle hear the same audiostream which the driver is listening to, Some solutions?
Reply
#2

By using a for loop
pawn Код:
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
    if( GetPlayerVehicleID( i ) == GetPlayerVehicleID( playerid ))
    {
        //audiostream here
    }
}
or foreach
pawn Код:
foreach( new i : Player )
{
    if( GetPlayerVehicleID( i ) == GetPlayerVehicleID( playerid ))
    {
        //audiostream here
    }
}
Reply
#3

this will give the same for all the cars but i have already a radio system and every one can choose his radio, i want that just the driver can do that
Reply
#4

Quote:
Originally Posted by Witnec
Посмотреть сообщение
this will give the same for all the cars
That really depends where you put this.

Quote:
Originally Posted by Witnec
Посмотреть сообщение
but i have already a radio system and every one can choose his radio, i want that just the driver can do that
Then simply do an if-statement with states
pawn Код:
if( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER )
{
    //disallow
}
else
{
    //allow
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)