Custom · origen_zones
The custom/ folder contains open-source files excluded from escrow. Modify these to adapt the resource to your framework, notification system, and access control logic.
custom/
├── client.lua
└── server.luacustom/client.lua
notify(msg, type)
Sends a notification to the local player. Called internally when the server triggers a notification event.
| Parameter | Type | Description |
|---|---|---|
msg | string | Notification message body |
type | string | Notification type — 'inform' | 'error' | 'success' |
The default implementation uses lib.notify from ox_lib. Replace the body to use your own notification system:
function notify(msg, type)
-- type = 'inform' or 'error' or 'success'
lib.notify({
title = locale('notify.title'),
description = msg,
duration = 7000,
position = 'top',
type = type
})
endExample — using a custom notification resource:
function notify(msg, type)
TriggerEvent('myNotify:send', msg, type)
endZone enter / exit hooks
These net events fire every time a player enters or exits any zone. Use them to add custom logic tied to zone transitions.
origen_zones:client:onPlayerEnterZone
Triggered on the client when the local player enters a zone.
RegisterNetEvent('origen_zones:client:onPlayerEnterZone', function(zoneName)
-- zoneName: internal name of the zone entered
debugPrint('Entered zone ' .. zoneName)
end)origen_zones:client:onPlayerExitZone
Triggered on the client when the local player exits a zone.
RegisterNetEvent('origen_zones:client:onPlayerExitZone', function(zoneName)
-- zoneName: internal name of the zone exited
debugPrint('Exited zone ' .. zoneName)
end)custom/server.lua
isPlayerStaff(src) → boolean
Returns true if the player is considered staff. Used to gate access to the admin panel and zone management commands.
Checks against Config.GroupPermissions using both framework groups and FiveM Ace Permissions.
| Parameter | Type | Description |
|---|---|---|
src | number | Player server ID |
Example — add a custom staff check:
function isPlayerStaff(src)
-- Custom override: check against your own system
return exports['my_permissions']:IsAdmin(src)
endgetPlayerJobName(src) → string
Returns the lowercase job name of the player. Returns an empty string '' if the job could not be retrieved.
Used internally by isPlayerWhitelistedForZone to match against the zone's whitelistJobs option.
| Parameter | Type | Description |
|---|---|---|
src | number | Player server ID |
isPlayerWhitelistedForZone(src, options) → boolean
Returns true if the player is whitelisted for a given zone, bypassing enforcement rules (damage prevention, disarm, speed limit, etc.).
| Parameter | Type | Description |
|---|---|---|
src | number | Player server ID |
options | table | Zone options table (from the zone definition) |
Whitelist is granted when at least one of the following is true:
options.whitelistStaff == trueandisPlayerStaff(src)returnstrue- The player's job name matches one of the entries in
options.whitelistJobs
Whitelisted players bypass enforcement rules but are still physically inside the zone. The playerInZone() export still returns true for them.