Esc to clear, Enter to open the best match, click an export to open it in its page
Reference
Data Structures
The shapes of the tables the most-used reads and events return.
Inventory
-- GetInventory(source)
{
player = {
[1] = { item = 'food', amount = 3, metadata = nil },
[3] = { item = 'vehicle_key', amount = 1, metadata = {
vehicleId = 42, plate = 'ABC123', model = 'adder'
}},
},
accessory = {
[4] = { item = 'id_card', amount = 1, metadata = nil }, -- slots 4 and 5 take anything
},
}Vehicle
Every server vehicle read (GetVehicle, GetVehiclesOf and the rest) returns this snapshot, as a copy.
-- GetVehicle(vehicleId)
{
vehicleId = 42,
plate = 'ABC123',
model = 'adder',
displayName = 'Adder', -- from the vehicle catalog; nil for a model it lacks
class = 7, -- the same
vehType = 'automobile',
session = false, -- true: nobody owns it (street traffic, or a temp car)
temp = false, -- true: a SpawnTempVehicle car (a rental, a job van)
secure = false, -- true: can't be lockpicked or hot-wired
owner = { charId = 1, name = 'Sam Reed', online = true },
state = 'out', -- 'out' | 'garaged' | 'impounded'
garage = nil, -- the garage's key while garaged
coords = vector3(-200.5, -1300.2, 31.0),
heading = 180.0,
spawned = true,
entity = 4610, -- nil while not in the world
netId = 88,
locked = false,
stats = { fuel = 85.0, ... },
data = { ... }, -- your resources' keys; always a table
properties = { ... }, -- GTA vehicle properties
storage = { trunk = { slots = 20, maxWeight = 100, used = 12 }, glovebox = { ... } }, -- only when loaded
occupants = { ... }, -- only with { occupants = true }
}Bank transaction
-- whip_core:bank:balanceChanged
{
type = 'deposit', -- 'deposit' | 'withdraw' | 'transfer'
accountId = 1,
amount = 5000,
actorCharId = 1,
newBalance = 15000,
message = 'Paycheck',
ownerCharId = 1, -- a deposit: whose account it is
accountType = 'personal', -- 'personal' | 'savings' | 'shared' | 'business'
label = 'Main', -- the account's name
}
-- a transfer has fromAccountId / toAccountId, fromBalance / toBalance, and
-- fromOwnerCharId, fromAccountType, fromLabel, toOwnerCharId, toAccountType, toLabel