[HELP]How can i make /play play in car im using audio plugin and only in car
#7

Get the vehicle the main player is driving:
Code:
new VehID = GetPlayerVehicleID(playerid);
Check who else is in the car that isn't the driver:
Code:
for(new i = 0; i < GetMaxPlayers(); i++ )
{
if(GetPlayerVehicleID(i) == VehID && GetPlayerVehicleSeat(i) != 0)
Play them the audio.
Code:
Audio_Play(i,audioid, pause, loop, downmix);
So to conclude:

Code:
new VehID = GetPlayerVehicleID(playerid);
for(new i = 0; i < GetMaxPlayers(); i++ )
{
    if(GetPlayerVehicleID(i) == VehID && GetPlayerVehicleSeat(i) != 0)
    {
        Audio_Play(i,audioid, pause, loop, downmix);
    }
}
That will play the audio to everybody but the driver that's in that vehicle.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)