Module cl_objects
Object System
Functions
| CreateObject (id, modelHash, x, y, z, h, netMissionEntity, doorFlag, freeze, interaction, zone, offsets, text) | CreateObject function. |
| FreezeObject (id, state) | FreezeObject function. |
| GetObjects () | GetObjects function. |
| DeleteObject (id) | DeleteObject function. |
| DeleteAllObjects () | DeleteAllObjects function. |
| GetObject (id) | GetObject function. |
| DoesObjectExist (id) | DoesObjectExist function. |
| UpdateObjectCoords (id, x, y, z, h) | UpdateObjectCoords function. |
| GetClosetObjectWithModel (coords, model) | GetClosetObjectWithModel function. |
| GetClosetObjectWithModels (coords, models) | GetClosetObjectWithModels function. |
| IsSafeToSpawn (coords) | IsSafeToSpawn function. |
Functions
- CreateObject (id, modelHash, x, y, z, h, netMissionEntity, doorFlag, freeze, interaction, zone, offsets, text)
-
CreateObject function.
This function creates an object.
Parameters:
- id The object id. string
- modelHash The object model hash. string
- x The object x position. number
- y The object y position. number
- z The object z position. number
- h The object heading. number
- netMissionEntity The object net mission entity. boolean
- doorFlag The object door flag. boolean
- freeze The object freeze. boolean
- interaction The object interaction. table
- zone The object zone. string
- offsets The object offsets. table
- text The object text. string
Returns:
-
number
Usage:
local object = exports.jones_util:CreateObject("object", "prop_cs_ciggy_01", 0, 0, 0, 0, false, false, true, {}, "zone", "Crafting Bench")
- FreezeObject (id, state)
-
FreezeObject function.
This function freezes an object.
Parameters:
- id The object id. string
- state The object state. boolean
Usage:
exports.jones_util:FreezeObject(object, true)
- GetObjects ()
-
GetObjects function.
This function returns the objects table.
Returns:
Usage:
local objects = exports.jones_util:GetObjects()
- DeleteObject (id)
-
DeleteObject function.
This function deletes an object.
Parameters:
- id The object id. string
Usage:
exports.jones_util:DeleteObject(object) - DeleteAllObjects ()
-
DeleteAllObjects function.
This function deletes all objects.
Usage:
exports.jones_util:DeleteAllObjects() - GetObject (id)
-
GetObject function.
This function returns an object.
Parameters:
- id The object id. string
Returns:
-
number
Usage:
local object = exports.jones_util:GetObject(object)
- DoesObjectExist (id)
-
DoesObjectExist function.
This function checks if an object exists.
Parameters:
- id The object id. string
Returns:
-
boolean
Usage:
local object = exports.jones_util:DoesObjectExist(object)
- UpdateObjectCoords (id, x, y, z, h)
-
UpdateObjectCoords function.
This function updates an object's coords.
Parameters:
- id The object id. string
- x The object x position. number
- y The object y position. number
- z The object z position. number
- h The object heading. number
Usage:
exports.jones_util:UpdateObjectCoords(object, 0, 0, 0, 0)
- GetClosetObjectWithModel (coords, model)
-
GetClosetObjectWithModel function.
This function returns the closest object with a model.
Parameters:
- coords The object coordinates. vector3
- model The object model. string
Returns:
-
number
Usage:
local object = exports.jones_util:GetClosetObjectWithModel(vector3(0, 0, 0), "prop_cs_ciggy_01")
- GetClosetObjectWithModels (coords, models)
-
GetClosetObjectWithModels function.
This function returns the closest object with models.
Parameters:
- coords The object coordinates. vector3
- models The object models. table
Returns:
-
number
Usage:
local object = exports.jones_util:GetClosetObjectWithModels(vector3(0, 0, 0), {"prop_cs_ciggy_01", "prop_cs_ciggy_01"})
- IsSafeToSpawn (coords)
-
IsSafeToSpawn function.
This function checks if it is safe to spawn an object.
Parameters:
- coords The object coordinates. vector3
Returns:
-
boolean
Usage:
local object = exports.jones_util:IsSafeToSpawn(vector3(0, 0, 0))