Map directives
fauconjona edited this page Oct 10, 2020
·
4 revisions
Clone this wiki locally
Here you'll find all map directives to use in a map file
createMarkerEvent
Create a marker event
createMarkerEvent Identifier Parameters- Identifier (string): need to be unique
Parameters:
- Type (int): Marker type, you can find them here
- Pos (Vector3): Position
- Scale (Vector3): 3D scale
- Color (object {R, G, B}): RGB color
- MaxDistance (float): Max distance to see the marker
- (Optional) BobUpAndDown (bool): Make the marker go up and down
- (Optional) FaceCamera (bool): Make the marker always facing the camera
- (Optional) Rotate (bool): Make the marker rotate
- (Optional) Accessibility (int): Set accessibility (0 = any, 1 = not in a vehicle, 2 = inside a vehicle)
- (Optional) OnEnter (string): Event triggered when enter in the marker
- (Optional) OnExit (string): Event triggered when exit in the marker
Example:
createMarkerEvent 'FBI_enter' {
Type = 1,
Pos = { X = 111.14, Y = -629.82, Z = 43.23 },
Scale = { X = 2.0, Y = 2.0, Z = 0.3 },
Color = { R = 0, G = 255, B = 127 },
MaxDistance = 30.0
}addTextToMarkerEvent
Add a 3D text to a marker
addTextToMarkerEvent Identifier Parameters- Identifier (string): marker identifier
Parameters:
- Text (string): the text to display
- Font (int): Same as GTAV fonts
- Color (object {R, G, B}): RGB color
- Scale (Vector2): 2D scale
- Pos (Vector3): Position relative to the marker
- MaxDistance (float): Max distance to see the text
Example:
addTextToMarkerEvent 'FBI_enter' {
Text = "Entrance",
Font = 0,
Color = { R = 0, G = 255, B = 127 },
Scale = { X = 0.8, Y = 0.8 },
Pos = { X = 0.0, Y = 0.0, Z = 1.5 },
MaxDistance = 30.0
}addActionToMarkerEvent
Add an event action to a marker
addActionToMarkerEvent Identifier Parameters- Identifier (string): marker identifier
Parameters:
- Action (int) : Trigger type (0: Auto / 1: Control Pressed)
- Callback (string / function): event or callback to trigger
- (Optional) Control (int): Control index, list here
- (Optional) HelpText (string): Help text display when can be triggered
- (Optional) Params (dynamic): parameter to send to the event or callback
Example:
addActionToMarkerEvent 'FBI_enter' {
Action = 1,
Control = 38,
HelpText = "Press ~INPUT_PICKUP~ to enter",
CallBack = "TeleportPlayer",
Params = { x = 113.13, y = -636.51, z = 206.05, heading = 67.09 }
}create3DText
Create a 3D text
create3DText Identifier Parameters- Identifier (string): need to be unique
Parameters:
- Text (string): the text to display
- Font (int): Same as GTAV fonts
- Color (object {R, G, B}): RGB color
- Scale (Vector2): 2D scale
- Pos (Vector3): World position
- MaxDistance (float): Max distance to see the text
Example:
create3DText 'water_text' {
Text = "Water",
Font = 0,
Color = { R = 255, G = 255, B = 255 },
Scale = { X = 0.8, Y = 0.8 },
Pos = { X = 123.24, Y = -624.25, Z = 206.55 },
MaxDistance = 8.0
}createArea
Create an area
createArea Identifier Parameters- Identifier (string): need to be unique
Parameters:
- Type (int): Marker type (Sphere, Circle, Box, Custom)
- Data (object): Shape data
- (Optional) OnEnter (string / function): On enter event or callback
- (Optional) OnExit (string / function): On exit event or callback
- (Optional) Params (dynamic): parameter to send to the event or callback
- (Optional) Debug (bool): Display the area to debug
Example:
createArea 'circle' {
Type = 1,
Data = {
Pos = { X = 98.97, Y = -619.91, Z = 44.31 },
Radius = 3.0
},
Debug = true
}