Squirrel/Server/Functions/Vehicles/Marker
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example 2. Setting) |
(→Example) |
||
(One intermediate revision by one user not shown) | |||
Line 13: | Line 13: | ||
* '''value''' - The type of the blip. For reference, check [[Squirrel/Server/Constants#Radar_Blip_Types|here]]. | * '''value''' - The type of the blip. For reference, check [[Squirrel/Server/Constants#Radar_Blip_Types|here]]. | ||
− | == Example | + | == Example == |
This will tell the player the type of the marker on their vehicle when they type '/marker'. | This will tell the player the type of the marker on their vehicle when they type '/marker'. | ||
Line 20: | Line 20: | ||
function onPlayerCommand( plr, cmd, text ) | function onPlayerCommand( plr, cmd, text ) | ||
{ | { | ||
− | if ( cmd == " | + | if ( cmd == "Arrow" ) |
{ | { | ||
local veh = plr.Vehicle; | local veh = plr.Vehicle; | ||
if ( veh ) | if ( veh ) | ||
− | + | veh.Marker = BLIPTYPE_ARROWONLY; | |
else | else | ||
− | MessagePlayer( "You are not in a vehicle", plr ); | + | MessagePlayer( "[#00ff00]*System* [#ff0000]You are not in a vehicle", plr ); |
} | } | ||
return 1; | return 1; | ||
+ | } | ||
+ | |||
+ | function onPlayerExitingVehicle( player, vehicle ) | ||
+ | { | ||
+ | vehicle.Marker = false; | ||
+ | |||
+ | return 0; | ||
} | } | ||
</code> | </code> |
Latest revision as of 14:21, 10 August 2013
This function sets/returns the vehicles radar marker type.
[edit] Syntax
int vehicle.Marker
vehicle.Marker = int value
[edit] Arguments
- value - The type of the blip. For reference, check here.
[edit] Example
This will tell the player the type of the marker on their vehicle when they type '/marker'.
function onPlayerCommand( plr, cmd, text ) { if ( cmd == "Arrow" ) { local veh = plr.Vehicle; if ( veh ) veh.Marker = BLIPTYPE_ARROWONLY; else MessagePlayer( "[#00ff00]*System* [#ff0000]You are not in a vehicle", plr ); } return 1; } function onPlayerExitingVehicle( player, vehicle ) { vehicle.Marker = false; return 0; }
[edit] Notes
The function MessagePlayer and event onPlayerCommand were used in these examples. More info about them in the corresponding pages.
[edit] Related Functions
- CreateVehicle
- FindVehicle
- GetClosestVehicle
- GetVehicleCount
- GetVehicleHandlingData
- GetVehicleIDFromName
- GetVehicleName
- SetVehicleHandlingData
- Vehicle.Alpha
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.EngineDamage
- Vehicle.Explode
- Vehicle.Fix
- Vehicle.GetAddon
- Vehicle.GetPassenger
- Vehicle.GetHandlingData
- Vehicle.GetWheelStatus
- Vehicle.Health
- Vehicle.ID
- Vehicle.IdleRespawnTime
- Vehicle.IdleTime
- Vehicle.LightState
- Vehicle.Locked
- Vehicle.Marker
- Vehicle.MarkerScale
- Vehicle.MarkerSprite
- Vehicle.Model
- Vehicle.OneTime
- Vehicle.PassengerCount
- Vehicle.Pos
- Vehicle.Remove
- Vehicle.Respawn
- Vehicle.RespawnTime
- Vehicle.RGBColour1
- Vehicle.RGBColour2
- Vehicle.SetHandlingData
- Vehicle.SetWheelStatus
- Vehicle.SpawnAngle
- Vehicle.SpawnPos
- Vehicle.SetAddon
- Vehicle.SetEngineState
- Vehicle.SetRadio
- Vehicle.Siren
- Vehicle.SirenLight
- Vehicle.TaxiLight
- Vehicle.Velocity
- Vehicle.VirtualWorld
- Vehicle.Wrecked