OrigenNetwork
Docs

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.

text
custom/
├── client.lua
└── server.lua

custom/client.lua

notify(msg, type)

Sends a notification to the local player. Called internally when the server triggers a notification event.

ParameterTypeDescription
msgstringNotification message body
typestringNotification type — 'inform' | 'error' | 'success'

The default implementation uses lib.notify from ox_lib. Replace the body to use your own notification system:

lua
function notify(msg, type)
    -- type = 'inform' or 'error' or 'success'
    lib.notify({
        title       = locale('notify.title'),
        description = msg,
        duration    = 7000,
        position    = 'top',
        type        = type
    })
end

Example — using a custom notification resource:

lua
function notify(msg, type)
    TriggerEvent('myNotify:send', msg, type)
end

Zone 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.

lua
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.

lua
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.

ParameterTypeDescription
srcnumberPlayer server ID

Example — add a custom staff check:

lua
function isPlayerStaff(src)
    -- Custom override: check against your own system
    return exports['my_permissions']:IsAdmin(src)
end

getPlayerJobName(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.

ParameterTypeDescription
srcnumberPlayer 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.).

ParameterTypeDescription
srcnumberPlayer server ID
optionstableZone options table (from the zone definition)

Whitelist is granted when at least one of the following is true:

  • options.whitelistStaff == true and isPlayerStaff(src) returns true
  • 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.