Squirrel/Server/Functions/Vehicles/SetRadio

From Liberty Unleashed Wiki
Revision as of 04:26, 9 March 2010 by Force (Talk | contribs)

Jump to: navigation, search

This function sets a radio channel for the given vehicle. Note that this will only work if someone is in the vehicle.

Syntax

  1. bool Vehicle.SetRadio( int channel )

Arguments

  • channel - The radio channel to be set

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setradio" )
  5. {
  6. if ( player.Vehicle ) player.Vehicle.SetRadio( 2 );
  7. }
  8. }
  9.  

This command will set the radio station, of the vehicle the player is driving, to radio channel 2.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox