### Configure server.cfg to start r3_servicesmanager Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/installation.mdx Add this line to your server.cfg file to ensure r3_servicesmanager starts on server initialization. It's recommended to place it early in the startup sequence. ```cfg start r3_servicesmanager ``` -------------------------------- ### Introspect RegisteredProvider Methods Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Access methods of a `RegisteredProvider` object to get service details and the raw provider table. This example demonstrates retrieving and using the 'inventory' provider. ```lua -- RegisteredProvider method signatures and return types: -- registration:getService() → string (e.g., "notification") -- registration:getProvider() → table (the raw provider table) -- registration:getPriority() → number (ServicePriority value, 0–4) -- registration:getResource() → string (resource the provider represents) -- registration:getInvokingResource() → string (resource that called register()) -- Full introspection example: local reg = exports.r3_servicesmanager:getRegistration("inventory") if reg then local info = { service = reg:getService(), priority = reg:getPriority(), resource = reg:getResource(), invokingResource = reg:getInvokingResource(), } -- info = { service="inventory", priority=2, resource="ox_inventory", invokingResource="ox_inventory" } -- Directly use the provider local provider = reg:getProvider() local hasItem = provider.hasItem(source, "water_bottle", 1) end ``` -------------------------------- ### Get All Registrations for a Service Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieve a list of all registered providers for a specific service using `getRegistrationsForService`. This is useful for understanding all available implementations. ```lua local registeredProviders = exports.r3_servicesmanager:getRegistrationsForService(service) ``` -------------------------------- ### Register Custom Service with Namespaced Key Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Use custom service keys by namespacing them to avoid collisions. This example shows registering a 'leaderboard' service. ```lua -- Custom service keys are also supported — use a namespaced key to avoid collisions: exports.r3_servicesmanager:register( "myserver:leaderboard", -- custom service key leaderboardProvider, 2, GetCurrentResourceName() ) ``` -------------------------------- ### Get All Known Services Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieve a list of all services that the manager is aware of, meaning they have had at least one provider registered. Use the `getKnownServices` export for this. ```lua local knownServices = exports.r3_servicesmanager:getKnownServices() ``` -------------------------------- ### Get All Registrations for a Resource Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Use `getRegistrationsForResource` to fetch all service providers registered by a particular resource. This helps in debugging or understanding resource contributions. ```lua local registeredProviders = exports.r3_servicesmanager:getRegistrationsForResource(resource) ``` -------------------------------- ### Get Service Provider Registration Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Use `getRegistration` to retrieve the full registration details of the highest priority provider for a service. This allows inspection of the provider, its resource, and priority. ```lua local registeredProvider = exports.r3_servicesmanager:getRegistration(service) ``` -------------------------------- ### Getting All Known Services Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieves a list of all services that are currently known by the services manager, meaning they have at least one provider registered. ```APIDOC ## getKnownServices ### Description Retrieves a list of all services that are currently known by the services manager, meaning they have at least one provider registered. ### Function Signature `local knownServices = exports.r3_servicesmanager:getKnownServices()` ### Returns - `string[]` - A list of services that are known by the services manager. ``` -------------------------------- ### Register a Service Provider Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Use the `register` export to add a new service provider. Ensure you provide all required parameters: service name, provider table, priority, and the resource name. ```lua exports.r3_servicesmanager:register(service, provider, priority, resource) ``` -------------------------------- ### List all providers for a service Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Retrieves all RegisteredProvider objects for a given service key, ordered by priority. Useful for debugging or displaying active providers. ```lua -- admin/server.lua local registrations = exports.r3_servicesmanager:getRegistrationsForService("notification") print("All notification providers (" .. #registrations .. " registered):") for _, reg in ipairs(registrations) do print(string.format( " [priority %d] %s (registered by %s)", reg:getPriority(), reg:getResource(), reg:getInvokingResource() )) end ``` -------------------------------- ### Retrieve all known service keys Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Returns a list of all service keys that have had providers registered, even if they are currently unregistered. Useful for discovery and diagnostics. ```lua -- admin/server.lua local services = exports.r3_servicesmanager:getKnownServices() print("Known services (" .. #services .. "):") for _, service in ipairs(services) do local hasProvider = exports.r3_servicesmanager:isProvidedFor(service) print(string.format(" %-20s %s", service, hasProvider and "✓ active" or "✗ no provider")) end ``` -------------------------------- ### React to new provider registrations Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Handles the `r3_servicesmanager:providerRegistered` event, which is triggered on both client and server when a new provider is registered. The RegisteredProvider object is passed as an argument. ```lua -- monitor/server.lua AddEventHandler("r3_servicesmanager:providerRegistered", function(registration) print(string.format( "[ServicesManager] Provider registered: service=%s, resource=%s, priority=%d", registration:getService(), registration:getResource(), registration:getPriority() )) end) ``` -------------------------------- ### Check if Service is Provided Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Use the `isProvidedFor` export to quickly check if any provider is currently registered for a given service. This is a simple boolean check. ```lua exports.r3_servicesmanager:isProvidedFor(service) ``` -------------------------------- ### List all providers registered by a resource Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Returns all RegisteredProvider objects registered by a specific resource across any service. Handy for inspecting a resource's contributions. ```lua -- admin/server.lua local resource = "esx_core" local registrations = exports.r3_servicesmanager:getRegistrationsForResource(resource) if #registrations == 0 then print(resource .. " has not registered any providers") else print(resource .. " provides the following services:") for _, reg in ipairs(registrations) do print(" - " .. reg:getService() .. " (priority " .. reg:getPriority() .. ")") end end ``` -------------------------------- ### Register a Notification Service Provider Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Registers a custom notification provider for the 'notification' service. Ensure the provider implements the expected interface. This registration is tied to the resource's lifecycle. ```lua -- providers/my_notifications/client.lua -- Implement the "notification" service interface local notificationProvider = { send = function(message, notificationType, duration) -- Custom notification implementation using, e.g., ox_lib lib.notify({ title = message, type = notificationType, duration = duration }) end } -- Register on resource start AddEventHandler("onResourceStart", function(resourceName) if resourceName ~= GetCurrentResourceName() then return end -- ServicePriority values: Lowest=0, Low=1, Normal=2, High=3, Highest=4 exports.r3_servicesmanager:register( "notification", -- service key notificationProvider, -- provider table 2, -- priority: Normal (recommended, make configurable) GetCurrentResourceName() -- auto-unregister when this resource stops ) print("[my_notifications] Registered notification provider") end) ``` -------------------------------- ### List of Predefined Service Keys Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt R3 ServicesManager includes fifteen predefined service keys for common functionalities like banking, inventory, and notifications. Custom keys are also supported. ```lua -- Complete list of built-in service keys: local SERVICES = { "banking", -- Account balances, deposits, withdrawals "callback", -- Server-to-client callback utilities "contextMenu", -- In-world context menus (e.g., ox_lib, qb-menu) "economy", -- Player money / wallet "employment", -- Player job / grade information "identity", -- Player name, date of birth, etc. "inventory", -- Item management (add, remove, check) "metadata", -- Arbitrary player metadata storage "notification", -- On-screen notifications / alerts "playerState", -- Player alive/dead status, etc. "progress", -- Progress bars / circles "stash", -- Persistent shared stashes "target", -- World targeting (e.g., ox_target, qb-target) "textUI", -- On-screen text labels "usableItems", -- Registering usable inventory items } ``` -------------------------------- ### Checking if a Service is Provided For Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Checks if there is currently any provider registered for a given service. ```APIDOC ## isProvidedFor ### Description Checks if there is currently any provider registered for a given service. ### Function Signature `exports.r3_servicesmanager:isProvidedFor(service)` ### Parameters #### Parameters - **service** (`string`) - The service to check if there is a provider registered for it. ### Returns - `boolean` - `true` if a provider is registered for the service, `false` otherwise. ``` -------------------------------- ### Load and Use Notification Service Provider Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Loads the highest-priority active provider for the 'notification' service and calls its 'send' method. Always check if a provider is available before attempting to use it. ```lua -- any_consumer_script/client.lua local function sendNotification(message, notificationType) local provider = exports.r3_servicesmanager:load("notification") if not provider then -- Fallback: no notification provider registered yet print("[warn] No notification provider available, message: " .. message) return end -- Call the method defined by the service interface provider.send(message, notificationType or "info", 5000) end -- Usage sendNotification("Welcome to the server!", "success") sendNotification("Insufficient funds.", "error") ``` -------------------------------- ### Load a Service Provider Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieve the highest priority registered provider for a given service using the `load` export. Returns `nil` if no provider is found. ```lua local serviceProvider = exports.r3_servicesmanager:load(service) ``` -------------------------------- ### Render Service Cards with Nextra Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/src/app/r3_servicesmanager/services/page.mdx Dynamically renders service cards using Nextra's Cards component. Ensure the 'services' array is correctly imported and formatted. ```javascript import { Cards } from "nextra/components" import { services } from "./services"; {services.map((service) => ( } title={service.label} href={`services/${service.key}`} /> ))} ``` -------------------------------- ### React to Provider Removals with `providerUnregistered` Event Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Listen for the `r3_servicesmanager:providerUnregistered` event to dynamically react when a service provider is removed. This is useful for implementing fallback mechanisms. ```lua -- monitor/server.lua AddEventHandler("r3_servicesmanager:providerUnregistered", function(registration) print(string.format( "[ServicesManager] Provider unregistered: service=%s, resource=%s", registration:getService(), registration:getResource() )) -- Re-check if a fallback is still available if exports.r3_servicesmanager:isProvidedFor(registration:getService()) then local fallback = exports.r3_servicesmanager:getRegistration(registration:getService()) print(" Falling back to: " .. fallback:getResource() .. " (priority " .. fallback:getPriority() .. ")") else print(" No fallback available for " .. registration:getService()) end end) ``` -------------------------------- ### Loading a Service Provider Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieves the currently registered service provider with the highest priority for a given service. ```APIDOC ## load ### Description Retrieves the currently registered service provider with the highest priority for a given service. ### Function Signature `local serviceProvider = exports.r3_servicesmanager:load(service)` ### Parameters #### Parameters - **service** (`string`) - The service to load the provider for. ### Returns - `table` - The currently registered provider for the service with the highest priority. - `nil` - If there is no provider registered for the service. ``` -------------------------------- ### Retrieving All Registrations for a Service Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieves a list of all registered providers for a specific service, ordered by priority. ```APIDOC ## getRegistrationsForService ### Description Retrieves a list of all registered providers for a specific service, ordered by priority. ### Function Signature `local registeredProviders = exports.r3_servicesmanager:getRegistrationsForService(service)` ### Parameters #### Parameters - **service** (`string`) - The service to get the registrations for. ### Returns - `RegisteredProvider[]` - A list of registered providers for the service. ``` -------------------------------- ### load — Load the active provider for a service Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Retrieves the provider table with the highest priority currently registered for the given service. Returns `nil` if no provider is registered. ```APIDOC ## load ### Description Retrieves the provider table with the highest priority currently registered for the given service. Returns `nil` if no provider is registered, so callers should always guard against that case. ### Method `exports.r3_servicesmanager:load(serviceKey)` ### Parameters - **serviceKey** (string) - The name of the service to load. ### Response - **providerTable** (table | nil) - The highest-priority provider table for the service, or `nil` if no provider is registered. ### Request Example ```lua -- any_consumer_script/client.lua local function sendNotification(message, notificationType) local provider = exports.r3_servicesmanager:load("notification") if not provider then print("[warn] No notification provider available, message: " .. message) return end provider.send(message, notificationType or "info", 5000) end sendNotification("Welcome to the server!", "success") ``` ``` -------------------------------- ### getKnownServices Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Fetches a list of all service keys that have ever had a provider registered. This is useful for service discovery and diagnostics. ```APIDOC ## getKnownServices ### Description Returns a list of every service key that has ever had a provider registered (including services whose providers have since been unregistered). Useful for discovery and diagnostics. ### Method `exports.r3_servicesmanager:getKnownServices()` ### Response - **services** (table) - A list of known service keys (strings). ### Request Example ```lua local services = exports.r3_servicesmanager:getKnownServices() ``` ### Response Example ```lua -- Example output: -- notification ✓ active -- banking ✓ active -- inventory ✗ no provider -- progress ✓ active ``` ``` -------------------------------- ### Retrieving All Registrations for a Resource Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieves a list of all service registrations associated with a specific resource. ```APIDOC ## getRegistrationsForResource ### Description Retrieves a list of all service registrations associated with a specific resource. ### Function Signature `local registeredProviders = exports.r3_servicesmanager:getRegistrationsForResource(resource)` ### Parameters #### Parameters - **resource** (`string`) - The resource to get the registrations for. ### Returns - `RegisteredProvider[]` - A list of registered providers for the resource. ``` -------------------------------- ### register — Register a service provider Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Registers a provider table under a named service key with a given priority. The provider is automatically unregistered when the specified resource stops. It's recommended to use ServicePriority.Normal (2) and make it configurable. ```APIDOC ## register ### Description Registers a provider table under a named service key with a given priority. The provider will be automatically unregistered when the specified resource stops. ### Method `exports.r3_servicesmanager:register(serviceKey, providerTable, priority, resourceName)` ### Parameters - **serviceKey** (string) - The name of the service to register under. - **providerTable** (table) - A table containing functions that implement the service interface. - **priority** (number) - The priority of this provider. Higher numbers indicate higher priority. Recommended value is 2 (Normal). - **resourceName** (string) - The name of the resource that this provider belongs to. Used for automatic unregistration. ### Request Example ```lua -- providers/my_notifications/client.lua local notificationProvider = { send = function(message, notificationType, duration) lib.notify({ title = message, type = notificationType, duration = duration }) end } AddEventHandler("onResourceStart", function(resourceName) if resourceName ~= GetCurrentResourceName() then return end exports.r3_servicesmanager:register( "notification", notificationProvider, 2, -- Priority: Normal GetCurrentResourceName() ) print("[my_notifications] Registered notification provider") end) ``` ``` -------------------------------- ### Retrieving a Registration Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Retrieves the complete registration details for the highest priority provider of a given service. ```APIDOC ## getRegistration ### Description Retrieves the complete registration details for the highest priority provider of a given service. This allows inspection of the active provider, its resource, and priority. ### Function Signature `local registeredProvider = exports.r3_servicesmanager:getRegistration(service)` ### Parameters #### Parameters - **service** (`string`) - The service to get the registration for. ### Returns - `RegisteredProvider` - The full registration of the currently registered provider for the service with the highest priority. - `nil` - If there is no provider registered for the service. ``` -------------------------------- ### Retrieve Notification Service Registration Details Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Retrieves the full registration metadata for the highest-priority 'notification' service provider. This allows inspection of the serving resource, priority, and direct access to the provider object. ```lua -- debug/server.lua local registration = exports.r3_servicesmanager:getRegistration("notification") if registration then print("Service: " .. registration:getService()) -- Output: Service: notification print("Providing resource: " .. registration:getResource()) -- Output: Providing resource: my_notifications print("Registered by: " .. registration:getInvokingResource()) -- Output: Registered by: my_notifications print("Priority: " .. tostring(registration:getPriority())) -- Output: Priority: 2 -- Access the raw provider table if needed local provider = registration:getProvider() provider.send("Test via registration object", "info", 3000) else print("No notification provider registered") end ``` -------------------------------- ### Registering a Service Provider Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/usage.mdx Registers a service provider for a given service with a specified priority. The provider is automatically unregistered if the associated resource stops. ```APIDOC ## register ### Description Registers a service provider for a given service with a specified priority. The provider is automatically unregistered if the associated resource stops. ### Function Signature `exports.r3_servicesmanager:register(service, provider, priority, resource)` ### Parameters #### Parameters - **service** (`string`) - The service to register. - **provider** (`table`) - A table of functions implementing the defined interface for the service. - **priority** (`ServicePriority`) - The priority of the provider. It is recommended to use priority `2` and make it configurable for server owners. - **resource** (`string`) - The resource this provider provides the service for. The provider will be unregistered automatically if this resource stops. Usually you should put `GetCurrentResourceName()` here. ### Returns - `nil` ``` -------------------------------- ### getRegistration — Retrieve full registration metadata Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Returns the full `RegisteredProvider` object for the highest-priority active provider. This is useful for inspecting which resource is currently serving a service and at what priority. ```APIDOC ## getRegistration ### Description Returns the full `RegisteredProvider` object for the highest-priority active provider. Useful for inspecting which resource is currently serving a service and at what priority. ### Method `exports.r3_servicesmanager:getRegistration(serviceKey)` ### Parameters - **serviceKey** (string) - The name of the service to get registration details for. ### Response - **registration** (RegisteredProvider | nil) - The `RegisteredProvider` object for the highest-priority service, or `nil` if no provider is registered. ### Request Example ```lua -- debug/server.lua local registration = exports.r3_servicesmanager:getRegistration("notification") if registration then print("Service: " .. registration:getService()) print("Providing resource: " .. registration:getResource()) print("Registered by: " .. registration:getInvokingResource()) print("Priority: " .. tostring(registration:getPriority())) local provider = registration:getProvider() provider.send("Test via registration object", "info", 3000) else print("No notification provider registered") end ``` ``` -------------------------------- ### getRegistrationsForService Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Lists all registered providers for a given service key. This is useful for debugging and administrative tasks to view active providers. ```APIDOC ## getRegistrationsForService ### Description Returns all `RegisteredProvider` objects registered under a service key, ordered by priority. Useful for debugging or building admin tooling that shows all active providers. ### Method `exports.r3_servicesmanager:getRegistrationsForService(serviceKey)` ### Parameters #### Path Parameters - **serviceKey** (string) - Required - The key of the service to retrieve registrations for. ### Response - **registrations** (table) - A list of `RegisteredProvider` objects. ### Request Example ```lua local registrations = exports.r3_servicesmanager:getRegistrationsForService("notification") ``` ### Response Example ```lua -- Example output: -- [priority 3] ox_lib_notifications (registered by ox_lib_notifications) -- [priority 2] my_notifications (registered by my_notifications) -- [priority 1] default_notifications (registered by default_notifications) ``` ``` -------------------------------- ### ServicePriority Enum and Configuration Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Utilize the `ServicePriority` enum (0-4) to control provider precedence. Configure notification priority using a `Config` table. ```lua -- ServicePriority reference values local ServicePriority = { Lowest = 0, -- Emergency fallback / last resort Low = 1, -- Non-preferred alternative Normal = 2, -- Recommended default for most providers High = 3, -- Preferred over Normal (e.g., server's chosen framework) Highest = 4, -- Reserved for overrides (use sparingly) } -- Pattern: make priority configurable in a Config table so server owners can tune it Config = Config or {} Config.NotificationPriority = Config.NotificationPriority or ServicePriority.Normal exports.r3_servicesmanager:register( "notification", myProvider, Config.NotificationPriority, GetCurrentResourceName() ) ``` -------------------------------- ### RegisteredProvider Object Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/types.mdx Represents a registration of a provider for a specific service. ```APIDOC ## RegisteredProvider A registration of a provider for a service. ### Methods - **getService()**: `string` - Returns the service the provider offers. - **getProvider()**: `table` - Returns the provider object. - **getPriority()**: [`ServicePriority`](#servicepriority) - Returns the priority of the provider. - **getResource()**: `string` - Returns the resource the provider was registered for. - **getInvokingResource()**: `string` - Returns the resource that initiated the provider registration. ``` -------------------------------- ### isProvidedFor Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Checks if a service currently has at least one active provider registered. Use this as a guard before calling `load` to handle missing providers gracefully. ```APIDOC ## isProvidedFor ### Description Returns a boolean indicating whether at least one provider is currently registered for the given service. Use this as a guard before calling `load` when a missing provider should be handled gracefully. ### Method `exports.r3_servicesmanager:isProvidedFor(serviceKey)` ### Parameters #### Path Parameters - **serviceKey** (string) - Required - The key of the service to check. ### Response - **isProvided** (boolean) - True if the service has an active provider, false otherwise. ### Request Example ```lua local hasProvider = exports.r3_servicesmanager:isProvidedFor("progress") ``` ### Response Example ```lua -- Example output: -- true -- false ``` ``` -------------------------------- ### Check if a service has an active provider Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Checks if at least one provider is currently registered for a service. Use this as a guard before calling `load` to handle missing providers gracefully. ```lua -- any_script/client.lua local function showProgressBar(label, duration, callback) if not exports.r3_servicesmanager:isProvidedFor("progress") then -- No progress provider; simulate instant completion print("[warn] No progress provider, skipping animation") if callback then callback(true) end return end local provider = exports.r3_servicesmanager:load("progress") provider.start({ label = label, duration = duration, onFinish = function() if callback then callback(true) end end, onCancel = function() if callback then callback(false) end end, }) end showProgressBar("Picking lock...", 5000, function(completed) if completed then print("Lock picked!") else print("Action cancelled.") end end) ``` -------------------------------- ### getRegistrationsForResource Source: https://context7.com/r3ps4j/r3ps4j.github.io/llms.txt Retrieves all providers registered by a specific resource across any service. This function helps in inspecting a resource's contributions to the service manager. ```APIDOC ## getRegistrationsForResource ### Description Returns all `RegisteredProvider` objects that a specific resource has registered across any service. Handy for inspecting what a given resource contributes to the service manager. ### Method `exports.r3_servicesmanager:getRegistrationsForResource(resourceName)` ### Parameters #### Path Parameters - **resourceName** (string) - Required - The name of the resource to retrieve registrations for. ### Response - **registrations** (table) - A list of `RegisteredProvider` objects registered by the specified resource. ### Request Example ```lua local resource = "esx_core" local registrations = exports.r3_servicesmanager:getRegistrationsForResource(resource) ``` ### Response Example ```lua -- Example output: -- esx_core provides the following services: -- - employment (priority 2) -- - identity (priority 2) -- - economy (priority 2) -- - banking (priority 2) ``` ``` -------------------------------- ### ServicePriority Enum Source: https://github.com/r3ps4j/r3ps4j.github.io/blob/master/content/r3_servicesmanager/types.mdx Represents the priority level of a service provider. ```APIDOC ## ServicePriority The priority of a service provider. ### Fields - **Lowest**: 0 - **Low**: 1 - **Normal**: 2 - **High**: 3 - **Highest**: 4 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.