π₯οΈServer Exports
GetJobCategory
This export retrieve the job category for the job requested. Why is it useful? because in some mods as the origen_masterjob (the one we are offering full compatibility), business can be created dynamically ingame with different names; and with this export we can identify the specific job for the user to which job category belong.
-- job_name must be the job you are trying to categorize
exports['p6_bridge']:GetJobCategory(job_name)
For example:
Mechanic business named "exotic_motors" created with origen_masterjob, you want to integrate a mechanic mod that can be used only by all the mechanics (not only this business), with our export you can do this validation quick and easy
if exports['p6_bridge']:GetJobCategory(business_name) == 'mechanic' then
-- Execute the code allowed to mechanics
else
-- Display a notification with an error, player is not a mechanic
end
SendDiscord
This event is used to log to discord a specific action or message using the gateway
-- type: Type of log (alerts, chat, command) you can add new ones in custom/server/logs.lua
-- title: Title of the message
-- message: Message text
-- metadata: Additional metadata of the alert (vehicle model, color, plate, speed, weapon, ammo type, name of the subject, unit)
-- source: source identifier who trigger the log
TriggerEvent('p6_bridge:sendDiscord', type, title, message, source)
CheckIfProtectedItem
This export is used to check if specific item is protected
-- item_name: name of the item to check if its protected or not
exports['p6_bridge']:CheckIfProtectedItem(item_name)
GetProtectedItems
This export return the list of protected items in the case that needs to be used outside of this mod
exports['p6_bridge']:GetProtectedItems()
GetPolicesInDuty
This export return the number of police players connected an on-duty
exports['p6_bridge']:GetPolicesInDuty()
GetMedicsInDuty
This export return the number of EMS players connected an on-duty
exports['p6_bridge']:GetMedicsInDuty()
GetMechanicsInDuty
This export return the number of mechanic players connected an on-duty
exports['p6_bridge']:GetMechanicsInDuty()
GetTaxisInDuty
This export return the number of taxi players connected an on-duty
exports['p6_bridge']:GetTaxisInDuty()
GetBusinessJobCategory
This export return the list of business that belong to this category
-- category: the job category
exports['p6_bridge']:GetBusinessJobCategory(category)
GetBusinessList
This export return the list of business available in the server
exports['p6_bridge']:GetBusinessList()
Last updated