Squirrel/Server/Functions/Vehicles/SetRadio

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Vehicle.SetRadio}}
 
This function sets a radio channel for the given vehicle. Note that this will only work if someone is in the vehicle.
 
This function sets a radio channel for the given vehicle. Note that this will only work if someone is in the vehicle.
  
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 ===

Latest revision as of 10:48, 11 October 2010

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.

[edit] Syntax

  1. bool Vehicle.SetRadio( int channel )

[edit] Arguments

  • channel - The radio channel to be set

[edit] 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.

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox