Appearance
Request
Reference for the request API.
WARNING
These options are blocking, it's recommended to call inside of a thread or job.
Functions
request.control
Requests control of an entity.
lua
---@param entity integer
---@param force_ownership? bool
function request.control(entity, force_ownership?): boolrequest.model
Requests a model to be loaded.
lua
---@param model string|integer
function request.model(model): boolrequest.weapon
Requests a weapon to be loaded.
lua
---@param model string|integer
function request.weapon(model): boolrequest.dict
Requests a dictionary to be loaded.
lua
---@param dictionary string
function request.dict(dictionary): boolrequest.anim
Requests an animation to be loaded.
lua
---@param animation string
function request.anim(animation): boolrequest.particle
Requests a particle to be loaded.
lua
---@param particle string
function request.particle(particle): boolExamples
lua
local natives = require('natives')
util.create_job(function()
local hash = joaat('player_two')
if request.model(hash) then
natives.set_player_model(players.me().id, hash)
end
end)