| GetZoneFromID (identifier) |
GetZoneFromID function. |
| DeleteZone (identifier) |
DeleteZone function. |
| IsCoordsInAnyZones (coords) |
GetZones function. |
| IsPlayerInZone (player, zone) |
IsPlayerInZone function. |
| GetPlayersInZone (zone) |
GetPlayersInZone function. |
| GetAmountOfPlayersInZone (zone) |
GetAmountOfPlayersInZone function. |
| IsAnyPlayerInZone (zone) |
IsAnyPlayerInZone function. |
| GetPlayerZones (player) |
GetPlayerZones function. |
| TriggerEventInZone (zone, event, ...) |
TriggerEventInZone function. |
| AddPropToZone (zone, id, propData) |
AddPropToZone function. |
| RemovePropFromZone (zone, id) |
RemovePropFromZone function. |
| UpdatePropModelInZone (zone, id, model) |
UpdatePropModelInZone function. |
| UpdatePropCoordsInZone (zone, id, coords, offsets) |
UpdatePropCoordsInZone function. |
| UpdatePropTextInZone (zone, id, text) |
UpdatePropTextInZone function. |
| GetPropsFromZone (zone) |
GetPropsFromZone function. |
| AddVehicleToZone (zone, id, vehData) |
AddVehicleToZone function. |
| RemoveVehicleFromZone (zone, id) |
RemoveVehicleFromZone function. |
| UpdateVehicleInZone (zone, id, VehicleData) |
UpdateVehicleInZone function. |
| UpdateVehicleTextInZone (zone, id, text) |
UpdateVehicleTextInZone function. |
| UpdateVehicleModelInZone (zone, id, model) |
UpdateVehicleModelInZone function. |
| GetVehicleFromZone (zone, id) |
GetVehicleFromZone function. |
| GetVehiclesFromZone (zone) |
GetVehiclesFromZone function. |
| AddPedToZone (zone, id, pedData) |
AddPedToZone function. |
| RemovePedFromZone (zone, id) |
RemovePedFromZone function. |
| GetPedsFromZone (zone) |
GetPedsFromZone function. |
| GetPedFromZone (zone, id) |
GetPedFromZone function. |
| TriggerEvent (eventName, ...) |
TriggerEvent sub-function. |
| RegisterContextMenu (src, menu) |
RegisterContextMenu function. |
| DeleteContextMenu (src, menu) |
DeleteContextMenu function. |
| DeleteContextMenus (src) |
DeleteContextMenus function. |
| CreateInputDialog (src, name, options) |
CreateInputDialog function. |
-
GetZoneFromID (identifier)
-
GetZoneFromID function.
If the zone or circle with the identifier "central_park" exists, it will be stored in the variable 'zone'.
If no such zone or circle exists, 'zone' will be nil.
Parameters:
- identifier
A unique identifier for the zone or circle
Returns:
The zone or circle corresponding to the identifier, or nil if no such zone or circle exists
Usage:
local zone = exports.jones_util:GetZoneFromID("central_park")
-
DeleteZone (identifier)
-
DeleteZone function.
This function deletes a zone or circle with the given identifier.
If the zone or circle exists and has members, it will make each member leave the zone or circle.
It then removes the zone or circle from the zones and circles tables.
If the zone or circle does not exist, it prints a message to the console.
This will delete the zone or circle with the identifier "central_park" if it exists.
Parameters:
- identifier
A unique identifier for the zone or circle
Usage:
exports.jones_util:DeleteZone("central_park")
-
IsCoordsInAnyZones (coords)
-
GetZones function.
This function checks if the given coordinates are inside any of the defined zones or circles.
It iterates over all zones and checks if the coordinates are inside the zone using the GetInside function.
It also iterates over all circles and checks if the coordinates are within the circle's distance from its center.
If the coordinates are inside a zone or a circle, it adds the zone or circle's id to the currentZones table.
It returns the currentZones table which contains the ids of all zones and circles the coordinates are inside of.
Parameters:
- coords
A table containing x, y, and z coordinates
Returns:
table containing the ids of all zones and circles the coordinates are inside of.
Usage:
local zones = exports.jones_util:IsCoordsInAnyZones({x = 100, y = 200, z = 300})
-
IsPlayerInZone (player, zone)
-
IsPlayerInZone function.
This function checks if the given player is inside the given zone or circle.
Parameters:
- player
The player's server id
- zone
The zone or circle's id
Returns:
boolean
Usage:
local isPlayerInZone = exports.jones_util:IsPlayerInZone(1, "central_park")
-
GetPlayersInZone (zone)
-
GetPlayersInZone function.
This function returns a table containing the server ids of all players inside the given zone or circle.
Parameters:
- zone
The zone or circle's id
Returns:
table
Usage:
local players = exports.jones_util:GetPlayersInZone("central_park")
-
GetAmountOfPlayersInZone (zone)
-
GetAmountOfPlayersInZone function.
This function returns the amount of players inside the given zone or circle.
Parameters:
- zone
The zone or circle's id
Returns:
number
Usage:
local amount = exports.jones_util:GetAmountOfPlayersInZone("central_park")
-
IsAnyPlayerInZone (zone)
-
IsAnyPlayerInZone function.
This function checks if there are any players inside the given zone or circle.
Parameters:
- zone
The zone or circle's id
Returns:
boolean
Usage:
local isAnyPlayerInZone = exports.jones_util:IsAnyPlayerInZone("central_park")
-
GetPlayerZones (player)
-
GetPlayerZones function.
This function returns a table containing the ids of all zones and circles the given player is inside.
Parameters:
- player
The player's server id
Returns:
table
Usage:
local zones = exports.jones_util:GetPlayerZones(1)
-
TriggerEventInZone (zone, event, ...)
-
TriggerEventInZone function.
This function triggers an event in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- event
The event to be triggered
- ...
The arguments to be passed to the event
Usage:
exports.jones_util:TriggerEventInZone("central_park", "event_name", ...)
-
AddPropToZone (zone, id, propData)
-
AddPropToZone function.
This function adds a prop to the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
A unique identifier for the prop
- propData
A table containing the prop's data
{
model: string,
x: number,
y: number,
z: number,
h: number,
offsets: vector3
interaction: {
["interaction_id"] = {
name: string,
icon: string,
id: string,
condition: function
}
}
See also:
Usage:
exports.jones_util:AddPropToZone("central_park", "prop-1", {model = "prop_bench_01a", x = 100, y = 200, z = 300, h = 0, offsets = vector3(0.0, 0.0, 0.0)})
-
RemovePropFromZone (zone, id)
-
RemovePropFromZone function.
This function removes a prop from the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The prop's unique identifier
Usage:
exports.jones_util:RemovePropFromZone("central_park", "prop-1")
-
UpdatePropModelInZone (zone, id, model)
-
UpdatePropModelInZone function.
This function updates the model of a prop in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The prop's unique identifier
- model
The prop's new model
Usage:
exports.jones_util:UpdatePropModelInZone("central_park", "prop-1", "prop_bench_01b")
-
UpdatePropCoordsInZone (zone, id, coords, offsets)
-
UpdatePropCoordsInZone function.
This function updates the coordinates of a prop in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The prop's unique identifier
- coords
A table containing the prop's new coordinates
- offsets
A vector3 containing the prop's new offsets
Usage:
exports.jones_util:UpdatePropCoordsInZone("central_park", "prop-1", {x = 100, y = 200, z = 300})
-
UpdatePropTextInZone (zone, id, text)
-
UpdatePropTextInZone function.
This function updates the display text of a prop in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The prop's unique identifier
- text
The prop's new display text
Usage:
exports.jones_util:UpdatePropTextInZone("central_park", "prop-1", "Prop Name")
-
GetPropsFromZone (zone)
-
GetPropsFromZone function.
This function returns a table containing all the props in the given zone or circle.
Parameters:
- zone
The zone or circle's id
Returns:
table
See also:
Usage:
local props = exports.jones_util:GetPropsFromZone("central_park")
-
AddVehicleToZone (zone, id, vehData)
-
AddVehicleToZone function.
This function adds a vehicle to the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
A unique identifier for the vehicle
- vehData
A table containing the vehicle's data
See also:
Usage:
exports.jones_util:AddVehicleToZone("central_park", "vehicle-1", {model = "adder", x = 100, y = 200, z = 300, h = 0, props = {}})
-
RemoveVehicleFromZone (zone, id)
-
RemoveVehicleFromZone function.
This function removes a vehicle from the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The vehicle's unique identifier
Usage:
exports.jones_util:RemoveVehicleFromZone("central_park", "vehicle-1")
-
UpdateVehicleInZone (zone, id, VehicleData)
-
UpdateVehicleInZone function.
This function updates the model and props of a vehicle in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The vehicle's unique identifier
- VehicleData
A table containing the vehicle's new props
See also:
Usage:
exports.jones_util:UpdateVehicleInZone("central_park", "vehicle-1", {model = "adder", props = {}})
-
UpdateVehicleTextInZone (zone, id, text)
-
UpdateVehicleTextInZone function.
This function updates the display text of a vehicle in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The vehicle's unique identifier
- text
The vehicle's new display text
Usage:
exports.jones_util:UpdateVehicleTextInZone("central_park", "vehicle-1", "Vehicle Name")
-
UpdateVehicleModelInZone (zone, id, model)
-
UpdateVehicleModelInZone function.
This function updates the model of a vehicle in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The vehicle's unique identifier
- model
The vehicle's new model
Usage:
exports.jones_util:UpdateVehicleModelInZone("central_park", "vehicle-1", "adder")
-
GetVehicleFromZone (zone, id)
-
GetVehicleFromZone function.
This function returns a table containing the vehicle in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The vehicle's unique identifier
Returns:
VehicleData
See also:
Usage:
local vehicle = exports.jones_util:GetVehicleFromZone("central_park", "vehicle-1")
-
GetVehiclesFromZone (zone)
-
GetVehiclesFromZone function.
This function returns a table containing all the vehicles in the given zone or circle.
Parameters:
- zone
The zone or circle's id
Returns:
table
containing all the vehicles in the given zone or circle.
See also:
Usage:
local vehicles = exports.jones_util:GetVehiclesFromZone("central_park")
-
AddPedToZone (zone, id, pedData)
-
AddPedToZone function.
This function adds a ped to the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
A unique identifier for the ped
- pedData
A table containing the ped's data
See also:
Usage:
exports.jones_util:AddPedToZone("central_park", "ped-1", {model = "a_m_m_beach_01", x = 100, y = 200, z = 300, h = 0})
-
RemovePedFromZone (zone, id)
-
RemovePedFromZone function.
This function removes a ped from the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The ped's unique identifier
Usage:
exports.jones_util:RemovePedFromZone("central_park", "ped-1")
-
GetPedsFromZone (zone)
-
GetPedsFromZone function.
This function returns a table containing all the peds in the given zone or circle.
Parameters:
- zone
The zone or circle's id
Returns:
table
See also:
Usage:
local peds = exports.jones_util:GetPedsFromZone("central_park")
-
GetPedFromZone (zone, id)
-
GetPedFromZone function.
This function returns a table containing the ped in the given zone or circle.
Parameters:
- zone
The zone or circle's id
- id
The ped's unique identifier
Returns:
PedData
See also:
Usage:
local ped = exports.jones_util:GetPedFromZone("central_park", "ped-1")
-
TriggerEvent (eventName, ...)
-
TriggerEvent sub-function.
This function triggers an event in the zone or circle.
Parameters:
- eventName
The event to be triggered
- ...
The arguments to be passed to the event
Usage:
exports.jones_util:GetZoneFromID("central_park").TriggerEvent("event_name", ...)
-
RegisterContextMenu (src, menu)
-
RegisterContextMenu function.
This function registers a context menu for the given player.
Parameters:
- src
The player's server id
- menu
The context menu to be registered
Usage:
exports.jones_util:RegisterContextMenu(1, {
id = "example",
title = "Example",
options = {
{
name = "Option 1",
icon = "fas fa-user",
execute = function(src)
print(src)
end
},
}
})
-
DeleteContextMenu (src, menu)
-
DeleteContextMenu function.
This function deletes a context menu for the given player.
Parameters:
- src
The player's server id
- menu
The context menu to be deleted
Usage:
exports.jones_util:DeleteContextMenu(1, "example")
-
DeleteContextMenus (src)
-
DeleteContextMenus function.
This function deletes all context menus for the given player.
Parameters:
- src
The player's server id
Usage:
exports.jones_util:DeleteContextMenus(1)
-
CreateInputDialog (src, name, options)
-
CreateInputDialog function.
This function creates an input dialog for the given player.
Parameters:
- src
The player's server id
- name
The input dialog's name
- options
The arguments to be passed to the input dialog
Usage:
exports.jones_util:CreateInputDialog(1, "example", {"first row", "second row"})