Squirrel/Server/Functions/Vehicles/Marker

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Vehicle.Marker}} {{ScriptingChangesIn0.1.0.12}} This function sets/returns the vehicles radar marker type. == Syntax == <code>int vehicle.Marker</code> <code>…')
 
m (Typo fix (and -> an))
Line 35: Line 35:
 
== Example 2. Setting ==
 
== Example 2. Setting ==
  
This will set the vehicles marker to and arrow when they type '/arrowmarker'.
+
This will set the vehicles marker to an arrow when they type '/arrowmarker'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">

Revision as of 03:42, 10 April 2012

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sets/returns the vehicles radar marker type.

Syntax

  1. int vehicle.Marker
  1. vehicle.Marker = int value

Arguments

  • value - The type of the blip. For reference, check here.

Example 1. Returning

This will tell the player the type of the marker on their vehicle when they type '/marker'.

  1.  
  2. function onPlayerCommand( plr, cmd, text )
  3. {
  4. if ( cmd == "marker" )
  5. {
  6. local veh = plr.Vehicle;
  7. if ( veh )
  8. MessagePlayer( "This vehicle has marker type - " + veh.Marker, plr );
  9. else
  10. MessagePlayer( "You are not in a vehicle", plr );
  11. }
  12. return 1;
  13. }
  14.  

Example 2. Setting

This will set the vehicles marker to an arrow when they type '/arrowmarker'.

  1.  
  2. function onPlayerCommand( plr, cmd, text )
  3. {
  4. if ( cmd == "arrowmarker" )
  5. {
  6. local veh = plr.Vehicle;
  7. if ( veh )
  8. veh.Marker = BLIPTYPE_ARROWONLY;
  9. else
  10. MessagePlayer( "You are not in a vehicle", plr );
  11. }
  12. return 1;
  13. }
  14.  

Notes

The function MessagePlayer and event onPlayerCommand were used in these examples. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox