Squirrel/Server/Functions/Vehicles/SetRadio

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
Line 21: Line 21:
 
</code>
 
</code>
  
This command will turn set the radio station of the vehicle the player is driving to radio channel 2.
+
This command will set the radio station, of the vehicle the player is driving, to radio channel 2.
  
 
=== Notes ===
 
=== Notes ===

Revision as of 04:26, 9 March 2010

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