Scripting/Server/Functions/vehicle.Radio
(v0.4-beta+) The radio station of a car: 0 RADIO_DEFAULT, 1-9 the game's stations (RADIO_HEAD .. RADIO_CHATTERBOX), 10 RADIO_MP3 (a client without the MP3 player hears nothing), 11 RADIO_OFF, RADIO_CUSTOM + n a custom station. Setting it tunes the radio of everybody in the car. The driver's own retuning is synced to the passengers (and every custom station plays the same song at the same second for all listeners). Event onPlayerChangeRadio(player, vehicle, station). server.conf passenger_radio on (default) lets only the driver tune; off lets passengers tune too. SetPassengerRadio(bool) changes it at run time.
Syntax
vehicle.RadioSetPassengerRadio(locked)GetPassengerRadio()Arguments
- bool locked
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "radio" )
{
local veh = player.Vehicle;
if ( !veh ) return MessagePlayer( "Sit in a vehicle first.", player );
veh.Radio();
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- CreateVehicle
- CreateObject
- CreatePickup
- CreateWeaponPickup
- CreateSphere
- CreateClientSphere
- CreateCheckpoint
- CreateClientCheckpoint
- FindCheckpoint
- GetCheckpointCount
- CreateBlip
- CreateClientBlip
Section: Creating world entities
Categories: Server functions | Creating world entities