Author Topic: Vehicle Stereo disable music  (Read 548 times)

On a server with ambience as music, you don't want people driving cars around with beach waves or wind blasting out of their car speakers. I would, however, love them to go around listening to a 'radio station'. Can somebody make an add-on that lets me choose what players can use in the vehicle stereo?



i'm guessing it would be modifying this part of the code
Code: [Select]
package VehicleStereo
{
function serverCmdSetWrenchData(%client,%data)
{
if (%client.wrenchBrick.isStereo == true)
{
// If it's a special brick, we play the music

if (isObject(%client.wrenchBrick.mount) == true)
{
// If the vehicle still exists, that is

if (getWord(getField(%data,1),1) $= "0")
{
// Stop any music if they picked "NONE"

%client.wrenchBrick.mount.stopAudio(0);
}
else
{
// Otherwise let's play the music they picked

%client.wrenchBrick.mount.playAudio(0,getWord(getField(%data,1),1));
}
}
}
else
{
// Otherwise we let the brick update normally

Parent::serverCmdSetWrenchData(%client,%data);
}
}

function WheeledVehicle::delete(%this)
{
if (isObject(%this.stereoHandler) == true)
{
// Cleaning up the handlers that were made

%this.stereoHandler.delete();
}

Parent::delete(%this);
}

function FlyingVehicle::delete(%this)
{
if (isObject(%this.stereoHandler) == true)
{
// Cleaning up the handlers that were made

%this.stereoHandler.delete();
}

Parent::delete(%this);
}
};
activatePackage(VehicleStereo);
need to do some testing to see what values %client.wrenchBrick.mount.playAudio(0,getWord(getField(%data,1),1)); has, not sure if it's doing it by names or IDs
if it's by names, it shouldn't be too difficult to make a command or hardcoded addon to whitelist/blacklist some of the music