The resource registers four server exports for inventory item use. Activity menus communicate through net events and NUI callbacks; there is no general client export to open every activity.
Inventory exports#
| Export | Items |
|---|---|
useCanoe | canoe |
useWaterBoard | paddleboard, surfboard_sunset_ray, surfboard_sea_drifter, surfboard_lifeguard, surfboard_venice_02 |
useGroundGear | roller_skates, skateboard, hoverboard |
useUtilityVehicles | flatbed_hand_truck, palet_truck, rub_trolley |
These use the ox_inventory server item callback signature (event, item, inventory). On usingItem, the resource validates the item/player, starts deployment, and returns false to stop the inventory's normal use flow. Do not treat them as unrestricted spawn functions.
Example item entry in ox_inventory/data/items.lua:
['skateboard'] = {
label = 'Skateboard',
weight = 3800,
stack = false,
close = true,
consume = 0,
client = { image = 'nui://0r-activities/items/images/skateboard.png' },
server = { export = '0r-activities.useGroundGear' }
},
Complete definitions are in install/ox_inventory.lua and install/qb_items.lua. Non-OX usable-item registration is handled through the selected QB/Qbox/ESX framework where available; other setups need their inventory's equivalent registration.
Custom diving payout#
Set these fields in config/diving.lua → rewards:
rewards = {
account = 'cash',
customResource = 'my-economy',
customExport = 'payActivity',
},
The receiving server export accepts (source, amount, account, reason):
-- In my-economy/server.lua
exports('payActivity', function(source, amount, account, reason)
-- Credit the player through your economy integration here.
-- Return true only after payment succeeds; return false on failure.
return false -- Replace after implementing the payout.
end)
reason is 'treasure-diving'. A configured, running custom resource is used before the built-in Qbox/QB/ESX payout. Return false or raise an error on failed payment so cargo remains eligible for retry. Leave both custom fields empty to use the framework bridge.
Lobby net events#
These are internal extension points. Preserve the built-in proximity, membership, capacity, and session checks when extending the menus.
Client → server prefix: 0r-activities:server:.
| Event suffix | Arguments | Purpose |
|---|---|---|
createActivityLobby | lobbyId, activity, selected, context? | Create a group lobby / invite selected player IDs |
respondActivityLobby | id, accepted | Respond to an existing invitation |
setActivityLobbyDriver | id, playerId | Host selects a driver from lobby members |
startActivityLobby | id | Host requests group launch |
leaveActivityLobby | id | Leave or close a lobby |
lobbyId is the configured activity identifier; id is the numeric session ID returned by the server. Activity-specific contexts and identifiers are defined in server/activity_lobbies.lua.
Server → client prefix: 0r-activities:client:.
| Event suffix | Arguments | Purpose |
|---|---|---|
activityLobbyInvite | id, ownerName, title, timeout | Invitation; timeout is in seconds |
activityLobbyState | state | Member list, roles, capacity, and start eligibility |
activityLobbyClosed | id, message, launched | Lobby closes or hands off to an activity |
notify | message, notificationType?, durationMilliseconds? | Show a notification through the selected backend |
Example: observe lobby changes from another client resource:
RegisterNetEvent('0r-activities:client:activityLobbyState', function(state)
print(('Activity lobby %s: %d members'):format(state.id, #state.members))
end)