Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sure-developer.com/llms.txt

Use this file to discover all available pages before exploring further.

Player

The player module is available on the client. It is automatically exposed as sure.player when @sure_lib/init.lua runs on the client.
local player = sure.player
player.waitUntilLoaded()

Shortcuts

PropertyReturns
player.dataCurrent ESX.GetPlayerData() table.
player.loadedCurrent ESX.IsPlayerLoaded() result.
player.pedPlayerPedId().
player.healthGetEntityHealth(PlayerPedId()).
player.armorGetEntityArmor(PlayerPedId()).
player.coordsGetEntityCoords(PlayerPedId()).
player.vehiclecache.vehicle.
player.serverIdcache.serverId.
player.currentVehiclePropertiesESX.Game.GetVehicleProperties(cache.vehicle) or nil.
player.waitUntilLoaded()Waits until ESX reports that the player is loaded.

Inventory, accounts, and loadout lookup

The module returns live ESX lists and adds string-key lookup helpers.
local bread = sure.player.inventory.bread

if bread and bread.count > 0 then
  print(('Bread count: %s'):format(bread.count))
end
Loadout lookup normalizes weapon names, so pistol, weapon_pistol, and WEAPON_PISTOL resolve to the same ESX loadout entry.

Startup pattern

CreateThread(function()
  sure.player.waitUntilLoaded()

  print(('Loaded as server id %s'):format(sure.player.serverId))
  print(('Current health: %s'):format(sure.player.health))
end)