Events
Last updated on
Network, host-wide and local events of the hauling module.
opx:net:hauling:hello
Client → server. Subscribe. Sent at start and on character load. Answered with a snapshot, the seller list and an answer.
TriggerServerEvent('opx:net:hauling:hello')opx:net:hauling:begin
Client → server. Starts a bar.
TriggerServerEvent('opx:net:hauling:begin', step, subject)- step:
string—pickup,loadordeliver - subject:
string— crate prop id (pickup), vehicle id (load) or seller NPC id (deliver)
opx:net:hauling:finish
Client → server. The bar finished; the server checks its own clock and completes the step.
TriggerServerEvent('opx:net:hauling:finish')opx:net:hauling:abort
Client → server. The bar was cancelled. A pickup claim is released; a carry continues.
TriggerServerEvent('opx:net:hauling:abort', reason)- reason:
string
opx:net:hauling:drop
Client → server. Puts the carried crate down.
TriggerServerEvent('opx:net:hauling:drop', { yaw = yaw, z = groundZ })- drop:
table|number—{ yaw, z }oryawz: the client's ground height, used only within 1.5 m of the player's own Z
opx:net:hauling:snapshot
Server → client. Every crate, in parts of 24.
RegisterNetEvent('opx:net:hauling:snapshot', function(part) end)- part:
table—{ first, done, crates }- each crate:
id, site, x, y, z, bucket, where(ground,claimed,carried)
- each crate:
opx:net:hauling:crate
Server → client. One crate changed.
RegisterNetEvent('opx:net:hauling:crate', function(crate) end)- crate:
table— same shape as a snapshot crate
opx:net:hauling:gone
Server → client. One crate left the world.
RegisterNetEvent('opx:net:hauling:gone', function(propId) end)- propId:
string
opx:net:hauling:sellers
Server → client. The seller NPCs.
RegisterNetEvent('opx:net:hauling:sellers', function(sellers) end)- sellers:
{ npc, site, dropoff }[]—npcis a decimal string
opx:net:hauling:run
Server → client. Draw a bar for this step.
RegisterNetEvent('opx:net:hauling:run', function(run) end)- run:
table—{ id, step, durationMs, site }
opx:net:hauling:answer
Server → client. Verdict for the last request.
RegisterNetEvent('opx:net:hauling:answer', function(ok, reason, heldId) end)- ok:
boolean - reason?:
string— see Refusal codes - heldId:
string|false— the carried crate id, orfalse
opx:on:hauling:sold
Server, host-wide. Crates were sold and paid. Every server resource hears it; see public server events.
AddEventHandler('opx:on:hauling:sold', function(playerId, sale) end)- playerId:
number - sale:
table—{ citizenId, site, dropoff, count, pay, each, currency }
opx:on:hauling:decision
Client, local. Every verdict. Only handlers inside opx_infinity's client hear it.
AddEventHandler('opx:on:hauling:decision', function(verdict) end)- verdict:
table—{ ok, reason?, carrying }