Game helpers

Models, animations, nearby entities, vehicles, weapons and the coordinates tool.

Small client helpers for models, animations, vehicles, players, weapons and raycasts.

Loading assets

ObsiLib.game.requestModel('prop_tool_box_04')
ObsiLib.game.requestAnimDict('mini@repair')

Nearby entities

local vehicle, distance = ObsiLib.game.closestVehicle(nil, 5.0)
local playerId, ped, dist = ObsiLib.game.closestPlayer(nil, 3.0)
local hit, coords, entity = ObsiLib.game.raycast(25.0)

Vehicles

local props = ObsiLib.game.vehicleProps(vehicle)
ObsiLib.game.setVehicleProps(vehicle, props)

ObsiLib.game.getFuel(vehicle)
ObsiLib.game.setFuel(vehicle, 100)     -- through the detected fuel resource

ObsiLib.game.vehicleType(vehicle)      -- 'car' | 'motorcycle' | 'boat' | ...
ObsiLib.game.vehicleLocked(vehicle)
ObsiLib.game.vehicleLightsOn(vehicle)
ObsiLib.game.vehicleEngineOn(vehicle)

ObsiLib.vehicle.giveKeys(vehicle)      -- client-side key resources

Weapons

ObsiLib.game.weaponInfo()              -- { hash, clip, total }

Coordinates tool

/obsicoords toggles a pointer that prints the coordinates you click. Rename or disable it with ObsiConfig.DevTools.CoordsCommand.