Vehicle.SetRadio

From Liberty Unleashed Wiki
Revision as of 10:48, 11 October 2010 by VRocker (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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