Squirrel/Server/Functions/Vehicles/Marker

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Typo fix (and -> an))
(Example 2. Setting)
Line 25: Line 25:
 
if ( veh )
 
if ( veh )
 
MessagePlayer( "This vehicle has marker type - " + veh.Marker, plr );
 
MessagePlayer( "This vehicle has marker type - " + veh.Marker, plr );
else
 
MessagePlayer( "You are not in a vehicle", plr );
 
}
 
 
return 1;
 
}
 
</code>
 
 
== Example 2. Setting ==
 
 
This will set the vehicles marker to an arrow when they type '/arrowmarker'.
 
 
<code lang="squirrel">
 
function onPlayerCommand( plr, cmd, text )
 
{
 
if ( cmd == "arrowmarker" )
 
{
 
local veh = plr.Vehicle;
 
if ( veh )
 
veh.Marker = BLIPTYPE_ARROWONLY;
 
 
else
 
else
 
MessagePlayer( "You are not in a vehicle", plr );
 
MessagePlayer( "You are not in a vehicle", plr );

Revision as of 14:19, 10 August 2013

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.  

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