0.0.1
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
local moduleType = "banking" -- Module category
|
||||
local moduleName = "default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
Nothing to edit, the code is internal
|
||||
]]
|
||||
@@ -0,0 +1,27 @@
|
||||
local moduleType = "banking" -- Module category
|
||||
local moduleName = "example" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
-- This is just an EXAMPLE, so you have to edit it to make it work
|
||||
Integrations[moduleType][moduleName].getSocietyMoney = function(societyName)
|
||||
local money = exports['example-banking']:getMoney(societyName)
|
||||
return money
|
||||
end
|
||||
|
||||
-- This is just an EXAMPLE, so you have to edit it to make it work
|
||||
Integrations[moduleType][moduleName].giveMoneyToSociety = function(societyName, amount)
|
||||
local success = exports['example-banking']:giveMoney(societyName, amount)
|
||||
return success -- Return true if success, false if not
|
||||
end
|
||||
|
||||
-- This is just an EXAMPLE, so you have to edit it to make it work
|
||||
Integrations[moduleType][moduleName].removeMoneyFromSociety = function(societyName, amount)
|
||||
local success = exports['example-banking']:removeMoney(societyName, amount)
|
||||
return success -- Return true if success, false if not
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
local moduleType = "banking" -- Module category
|
||||
local moduleName = "okokbanking" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
Integrations[moduleType][moduleName].getSocietyMoney = function(societyName)
|
||||
local money = exports['okokBanking']:GetAccount(societyName)
|
||||
return money
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].giveMoneyToSociety = function(societyName, amount)
|
||||
local success = exports['okokBanking']:AddMoney(societyName, amount)
|
||||
return success -- Return true if success, false if not
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].removeMoneyFromSociety = function(societyName, amount)
|
||||
local success = exports['okokBanking']:RemoveMoney(societyName, amount)
|
||||
return success -- Return true if success, false if not
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
local moduleType = "boss" -- Module category
|
||||
local moduleName = "default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
Nothing to edit, the code is internal
|
||||
]]
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
local moduleType = "boss" -- Module category
|
||||
local moduleName = "example" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
-- Example function to modify the employees list
|
||||
-- This function is called before returning the employees list to the client
|
||||
-- You can modify the employees table to add or filter employees
|
||||
Integrations[moduleType][moduleName].modifyEmployeesList = function(employeesArray, jobName)
|
||||
-- Example: Do your edits to the employeesArray
|
||||
|
||||
return employeesArray -- Return the modified employees list
|
||||
end
|
||||
|
||||
--- Example function to modify the fire employee behavior
|
||||
--- This function is called when an employee is fired
|
||||
--- @return boolean|nil true if the employee is fired, nil if you don't want to edit the default behavior
|
||||
Integrations[moduleType][moduleName].fireEmployee = function(playerId, employeeIdentifier, jobName)
|
||||
-- Write your code if you want to
|
||||
|
||||
-- nil will not edit the default behavior, so if nil is returned, after this function finish the default fire employee will start
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Example function to modify the recruit player behavior
|
||||
-- This function is called before recruiting a player
|
||||
-- @return boolean|nil true if the player is recruited, nil if you don't want to edit the default behavior
|
||||
Integrations[moduleType][moduleName].recruitPlayer = function(playerId, targetId, jobName)
|
||||
-- nil will not edit the default behavior, so if nil is returned, after this function finish the default recruit player will start
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Example function to modify the change grade behavior
|
||||
-- This function is called before changing an employee's grade
|
||||
-- @return boolean|nil true if the grade is changed, nil if you don't want to edit the default behavior
|
||||
Integrations[moduleType][moduleName].changeGradeToEmployee = function(playerId, employeeIdentifier, newGrade, jobName)
|
||||
-- Write your code if you want to
|
||||
|
||||
-- nil will not edit the default behavior, so if nil is returned, after this function finish the default change grade will start
|
||||
return nil
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":temporary_garage:vehicleSpawned", function(vehicle, vehicleName, vehiclePlate)
|
||||
TriggerEvent("vehiclekeys:client:SetOwner", Framework.trim(vehiclePlate))
|
||||
end)
|
||||
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":permanent_garage:vehicleSpawned", function(vehicle, vehicleName, vehiclePlate)
|
||||
TriggerEvent("vehiclekeys:client:SetOwner", Framework.trim(vehiclePlate))
|
||||
end)
|
||||
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":garage_owned:vehicleSpawned", function(vehicle, vehicleName, vehiclePlate)
|
||||
TriggerEvent("vehiclekeys:client:SetOwner", Framework.trim(vehiclePlate))
|
||||
end)
|
||||
@@ -0,0 +1,7 @@
|
||||
local moduleType = "menu" -- Module category
|
||||
local moduleName = "menu_default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
@@ -0,0 +1,7 @@
|
||||
local moduleType = "menu"
|
||||
local moduleName = "ox_lib"
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
@@ -0,0 +1,13 @@
|
||||
local moduleType = "notify" -- Module category
|
||||
local moduleName = "default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
Nothing to edit, the code is internal
|
||||
]]
|
||||
@@ -0,0 +1,14 @@
|
||||
local moduleType = "notify" -- Module category
|
||||
local moduleName = "example" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
Integrations[moduleType][moduleName].showNotification = function(message, coloredMessage)
|
||||
-- ADD YOUR EXPORT HERE, THIS IS JUST AN EXAMPLE
|
||||
exports["notification_script"]:notify(message)
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
local moduleType = "notify" -- Module category
|
||||
local moduleName = "origen_notify" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
Integrations[moduleType][moduleName].showNotification = function(message, coloredMessage)
|
||||
-- ADD YOUR EXPORT HERE, THIS IS JUST AN EXAMPLE
|
||||
exports["origen_notify"]:ShowNotification(message)
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
local moduleType = "notify" -- Module category
|
||||
local moduleName = "ox_lib" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].showNotification = function(uncoloredMessage, message)
|
||||
lib.notify({
|
||||
title = uncoloredMessage,
|
||||
})
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
local moduleType = "outfits" -- Module category
|
||||
local moduleName = "default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
Nothing to edit, the code is internal
|
||||
]]
|
||||
|
||||
-- This function has to return true if you want to use external menu, false to use Jobs Creator menu
|
||||
Integrations[moduleType][moduleName].openExternalMenu = function()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,187 @@
|
||||
local moduleType = "outfits" -- Module category
|
||||
local moduleName = "illenium" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
|
||||
local function convertComponentsToOutfit(components, props)
|
||||
if not components or not props then return end
|
||||
|
||||
local outfit = {}
|
||||
|
||||
-- Map component IDs to outfit keys
|
||||
local componentMap = {
|
||||
[1] = {name = "mask_1", color = "mask_2"},
|
||||
[3] = {name = "arms", color = "arms_2"},
|
||||
[4] = {name = "pants_1", color = "pants_2"},
|
||||
[5] = {name = "bags_1", color = "bags_2"},
|
||||
[6] = {name = "shoes_1", color = "shoes_2"},
|
||||
[7] = {name = "chain_1", color = "chain_2"},
|
||||
[8] = {name = "tshirt_1", color = "tshirt_2"},
|
||||
[9] = {name = "bproof_1", color = "bproof_2"},
|
||||
[10] = {name = "decals_1", color = "decals_2"},
|
||||
[11] = {name = "torso_1", color = "torso_2"}
|
||||
}
|
||||
|
||||
-- Convert each component
|
||||
for _, component in ipairs(components) do
|
||||
local mapping = componentMap[component.component_id]
|
||||
if mapping then
|
||||
outfit[mapping.name] = component.drawable
|
||||
outfit[mapping.color] = component.texture
|
||||
end
|
||||
end
|
||||
|
||||
-- Search for props with prop_id 0 (helmet) and 1 (glasses)
|
||||
for _, prop in ipairs(props) do
|
||||
if prop.prop_id == 0 then
|
||||
outfit.helmet_1 = prop.drawable
|
||||
outfit.helmet_2 = prop.texture
|
||||
elseif prop.prop_id == 1 then
|
||||
outfit.glasses_1 = prop.drawable
|
||||
outfit.glasses_2 = prop.texture
|
||||
end
|
||||
end
|
||||
|
||||
return outfit
|
||||
end
|
||||
|
||||
local function convertOutfitToComponents(outfit)
|
||||
if not outfit then return end
|
||||
|
||||
local components = {}
|
||||
local props = {}
|
||||
|
||||
-- Map outfit keys to component IDs
|
||||
local componentMap = {
|
||||
{id = 1, drawable = "mask_1", texture = "mask_2"},
|
||||
{id = 3, drawable = "arms", texture = "arms_2"},
|
||||
{id = 4, drawable = "pants_1", texture = "pants_2"},
|
||||
{id = 5, drawable = "bags_1", texture = "bags_2"},
|
||||
{id = 6, drawable = "shoes_1", texture = "shoes_2"},
|
||||
{id = 7, drawable = "chain_1", texture = "chain_2"},
|
||||
{id = 8, drawable = "tshirt_1", texture = "tshirt_2"},
|
||||
{id = 9, drawable = "bproof_1", texture = "bproof_2"},
|
||||
{id = 10, drawable = "decals_1", texture = "decals_2"},
|
||||
{id = 11, drawable = "torso_1", texture = "torso_2"}
|
||||
}
|
||||
|
||||
-- Convert outfit to components
|
||||
for _, mapping in ipairs(componentMap) do
|
||||
-- Always add component even if not in outfit, defaulting to -1
|
||||
table.insert(components, {
|
||||
component_id = mapping.id,
|
||||
drawable = outfit[mapping.drawable] or -1,
|
||||
texture = outfit[mapping.texture] or 0
|
||||
})
|
||||
end
|
||||
|
||||
-- Always add props with default -1 values
|
||||
props = {
|
||||
{
|
||||
prop_id = 0,
|
||||
drawable = outfit.helmet_1 or -1,
|
||||
texture = outfit.helmet_2 or -1
|
||||
},
|
||||
{
|
||||
prop_id = 1,
|
||||
drawable = outfit.glasses_1 or -1,
|
||||
texture = outfit.glasses_2 or 0
|
||||
}
|
||||
}
|
||||
|
||||
return components, props
|
||||
end
|
||||
|
||||
-- This function has to open saved player outfits menu from your own script
|
||||
Integrations[moduleType][moduleName].openWardrobe = function()
|
||||
TriggerEvent(EXTERNAL_EVENTS_NAMES["illenium-appearance:client:openOutfitMenu"])
|
||||
end
|
||||
|
||||
--[[
|
||||
return true will call openJobOutfits, so getPlayerClothes and setPlayerClothes will be ignored
|
||||
return false will override current getPlayerClothes and setPlayerClothes functions, using Jobs Creator menu
|
||||
]]
|
||||
Integrations[moduleType][moduleName].openExternalMenu = function()
|
||||
return false
|
||||
end
|
||||
|
||||
-- This function has to open saved job outfits menu from your own script, completely replacing Jobs Creator job outfit feature
|
||||
Integrations[moduleType][moduleName].openJobOutfits = function()
|
||||
TriggerEvent(EXTERNAL_EVENTS_NAMES["illenium-apearance:client:outfitsCommand"], true)
|
||||
end
|
||||
|
||||
-- This function has return current player's outfit. The required format is shown below
|
||||
Integrations[moduleType][moduleName].getPlayerClothes = function()
|
||||
local ped = PlayerPedId()
|
||||
local components = exports['illenium-appearance']:getPedComponents(ped)
|
||||
local props = exports['illenium-appearance']:getPedProps(ped)
|
||||
|
||||
-- Convert illenium-appearance format to the required format
|
||||
local outfit = convertComponentsToOutfit(components, props)
|
||||
return outfit
|
||||
end
|
||||
|
||||
-- This function has set current player's outfit. The required format is shown below
|
||||
Integrations[moduleType][moduleName].setPlayerClothes = function(outfit, saveAfterRestart)
|
||||
local ped = PlayerPedId()
|
||||
|
||||
-- Convert the required format to illenium-appearance format using the conversion function
|
||||
local components, props = convertOutfitToComponents(outfit)
|
||||
|
||||
-- Set components one by one
|
||||
for _, component in pairs(components) do
|
||||
exports['illenium-appearance']:setPedComponent(ped, component)
|
||||
end
|
||||
|
||||
-- Set props one by one
|
||||
for _, prop in pairs(props) do
|
||||
exports['illenium-appearance']:setPedProp(ped, prop)
|
||||
end
|
||||
|
||||
if saveAfterRestart then
|
||||
-- Save the appearance to the database
|
||||
local appearance = exports['illenium-appearance']:getPedAppearance(ped)
|
||||
TriggerServerEvent('illenium-appearance:server:saveAppearance', appearance)
|
||||
end
|
||||
end
|
||||
|
||||
-- EXAMPLE FORMAT FOR OUTFIT
|
||||
--[[
|
||||
------------------------------
|
||||
| Key | Value |
|
||||
|---------------|------------|
|
||||
| tshirt_1 | NUMBER |
|
||||
| tshirt_2 | NUMBER |
|
||||
| torso_1 | NUMBER |
|
||||
| torso_2 | NUMBER |
|
||||
| decals_1 | NUMBER |
|
||||
| decals_2 | NUMBER |
|
||||
| arms | NUMBER |
|
||||
| arms_2 | NUMBER |
|
||||
| pants_1 | NUMBER |
|
||||
| pants_2 | NUMBER |
|
||||
| shoes_1 | NUMBER |
|
||||
| shoes_2 | NUMBER |
|
||||
| mask_1 | NUMBER |
|
||||
| mask_2 | NUMBER |
|
||||
| bproof_1 | NUMBER |
|
||||
| bproof_2 | NUMBER |
|
||||
| chain_1 | NUMBER |
|
||||
| chain_2 | NUMBER |
|
||||
| helmet_1 | NUMBER |
|
||||
| helmet_2 | NUMBER |
|
||||
| glasses_1 | NUMBER |
|
||||
| glasses_2 | NUMBER |
|
||||
| bags_1 | NUMBER |
|
||||
| bags_2 | NUMBER |
|
||||
------------------------------
|
||||
]]
|
||||
@@ -0,0 +1,79 @@
|
||||
local moduleType = "outfits" -- Module category
|
||||
local moduleName = "rcore_clothingV2" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
|
||||
-- This function has to open saved player outfits menu from your own script
|
||||
Integrations[moduleType][moduleName].openWardrobe = function()
|
||||
TriggerEvent('rcore_clothing:openChangingRoom')
|
||||
end
|
||||
|
||||
--[[
|
||||
return true will call openJobOutfits, so getPlayerClothes and setPlayerClothes will be ignored
|
||||
return false will override current getPlayerClothes and setPlayerClothes functions, using Jobs Creator menu
|
||||
]]
|
||||
Integrations[moduleType][moduleName].openExternalMenu = function()
|
||||
return false
|
||||
end
|
||||
|
||||
-- This function has to open saved job outfits menu from your own script, completely replacing Jobs Creator job outfit feature
|
||||
Integrations[moduleType][moduleName].openJobOutfits = function()
|
||||
TriggerEvent('rcore_clothing:openJobChangingRoom', Framework.getPlayerJob())
|
||||
end
|
||||
|
||||
-- This function has return current player's outfit. The required format is shown below
|
||||
Integrations[moduleType][moduleName].getPlayerClothes = function()
|
||||
local promise = promise.new()
|
||||
|
||||
TriggerEvent('skinchanger:getSkin', function(skin)
|
||||
promise:resolve(skin)
|
||||
end)
|
||||
|
||||
return Citizen.Await(promise)
|
||||
end
|
||||
|
||||
-- This function has set current player's outfit. The required format is shown below
|
||||
Integrations[moduleType][moduleName].setPlayerClothes = function(outfit, saveAfterRestart)
|
||||
TriggerEvent('skinchanger:loadSkin', outfit)
|
||||
end
|
||||
|
||||
-- EXAMPLE FORMAT FOR OUTFIT
|
||||
--[[
|
||||
------------------------------
|
||||
| Key | Value |
|
||||
|---------------|------------|
|
||||
| tshirt_1 | NUMBER |
|
||||
| tshirt_2 | NUMBER |
|
||||
| torso_1 | NUMBER |
|
||||
| torso_2 | NUMBER |
|
||||
| decals_1 | NUMBER |
|
||||
| decals_2 | NUMBER |
|
||||
| arms | NUMBER |
|
||||
| arms_2 | NUMBER |
|
||||
| pants_1 | NUMBER |
|
||||
| pants_2 | NUMBER |
|
||||
| shoes_1 | NUMBER |
|
||||
| shoes_2 | NUMBER |
|
||||
| mask_1 | NUMBER |
|
||||
| mask_2 | NUMBER |
|
||||
| bproof_1 | NUMBER |
|
||||
| bproof_2 | NUMBER |
|
||||
| chain_1 | NUMBER |
|
||||
| chain_2 | NUMBER |
|
||||
| helmet_1 | NUMBER |
|
||||
| helmet_2 | NUMBER |
|
||||
| glasses_1 | NUMBER |
|
||||
| glasses_2 | NUMBER |
|
||||
| bags_1 | NUMBER |
|
||||
| bags_2 | NUMBER |
|
||||
------------------------------
|
||||
]]
|
||||
@@ -0,0 +1,16 @@
|
||||
local moduleType = "progressbar" -- Module category
|
||||
local moduleName = "jaksam" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].start = function(time, text, hexColor)
|
||||
Dialogs.startProgressBar(time, text, hexColor)
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
local moduleType = "progressbar" -- Module category
|
||||
local moduleName = "ox_lib" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].start = function(time, text, hexColor)
|
||||
lib.progressBar({
|
||||
duration = time,
|
||||
label = text,
|
||||
})
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
local moduleType = "progressbar" -- Module category
|
||||
local moduleName = "qb_core" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].start = function(time, text, hexColor)
|
||||
QBCore.Functions.Progressbar("jobs_creator_progressbar", text, time - 1000, false, false, {})
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
local moduleType = "search_player" -- Module category
|
||||
local moduleName = "default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
@@ -0,0 +1,42 @@
|
||||
local moduleType = "search_player" -- Module category
|
||||
local moduleName = "jaksam_inventory" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
local function canOpenTarget(ped)
|
||||
local isPedDead = IsPedDeadOrDying(ped, false)
|
||||
local isDeadAnim = IsEntityPlayingAnim(ped, 'dead', 'dead_a', 3)
|
||||
local configFlag120 = GetPedConfigFlag(ped, 120, true)
|
||||
local isArrestingIdle = IsEntityPlayingAnim(ped, 'mp_arresting', 'idle', 3)
|
||||
local isHandsupBase = IsEntityPlayingAnim(ped, 'missminuteman_1ig_2', 'handsup_base', 3)
|
||||
local isHandsupEnter = IsEntityPlayingAnim(ped, 'missminuteman_1ig_2', 'handsup_enter', 3)
|
||||
local isMuggingHandsup = IsEntityPlayingAnim(ped, 'random@mugging3', 'handsup_standing_base', 3)
|
||||
|
||||
return isPedDead
|
||||
or isDeadAnim
|
||||
or configFlag120
|
||||
or isArrestingIdle
|
||||
or isHandsupBase
|
||||
or isHandsupEnter
|
||||
or isMuggingHandsup
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].search = function(targetServerId)
|
||||
local targetPly = GetPlayerFromServerId(targetServerId)
|
||||
local targetPed = GetPlayerPed(targetPly)
|
||||
if(not canOpenTarget(targetPed)) then
|
||||
notifyClient(getLocalizedText("actions:the_player_must_be_handcuffed"))
|
||||
return
|
||||
end
|
||||
|
||||
local scriptName = "jaksam_inventory"
|
||||
exports[scriptName]:openInventory(targetServerId)
|
||||
end
|
||||
@@ -0,0 +1,33 @@
|
||||
local moduleType = "search_player" -- Module category
|
||||
local moduleName = "ox_inventory" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
local function canOpenTarget(ped)
|
||||
return IsPedFatallyInjured(ped)
|
||||
or IsEntityPlayingAnim(ped, 'dead', 'dead_a', 3)
|
||||
or GetPedConfigFlag(ped, 120, true)
|
||||
or IsEntityPlayingAnim(ped, 'mp_arresting', 'idle', 3)
|
||||
or IsEntityPlayingAnim(ped, 'missminuteman_1ig_2', 'handsup_base', 3)
|
||||
or IsEntityPlayingAnim(ped, 'missminuteman_1ig_2', 'handsup_enter', 3)
|
||||
or IsEntityPlayingAnim(ped, 'random@mugging3', 'handsup_standing_base', 3)
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].search = function(targetServerId)
|
||||
local targetPed = GetPlayerPed(targetServerId)
|
||||
if(not canOpenTarget(targetPed)) then
|
||||
notifyClient(getLocalizedText("actions:the_player_must_be_handcuffed"))
|
||||
return
|
||||
end
|
||||
|
||||
local scriptName = Utils.getScriptName("ox_inventory")
|
||||
exports[scriptName]:openInventory('player', targetServerId)
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
local moduleType = "skillcheck" -- Module category
|
||||
local moduleName = "jaksam" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
-- You can edit down here
|
||||
Integrations[moduleType][moduleName].start = function(difficulty, speed)
|
||||
local success = Dialogs.skillcheck(difficulty, speed)
|
||||
|
||||
return success
|
||||
end
|
||||
|
||||
-- To cancel minigame before ends
|
||||
Integrations[moduleType][moduleName].cancel = function()
|
||||
Dialogs.cancelSkillcheck()
|
||||
end
|
||||
@@ -0,0 +1,22 @@
|
||||
local moduleType = "skillcheck" -- Module category
|
||||
local moduleName = "ox_lib" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
-- You can edit down here
|
||||
Integrations[moduleType][moduleName].start = function(difficulty, speed)
|
||||
local success = lib.skillCheck("hard")
|
||||
return success
|
||||
end
|
||||
|
||||
-- To cancel minigame before ends
|
||||
Integrations[moduleType][moduleName].cancel = function()
|
||||
if not lib.skillCheckActive() then return end
|
||||
|
||||
lib.cancelSkillCheck()
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
local moduleType = "stash" -- Module category
|
||||
local moduleName = "default" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
@@ -0,0 +1,18 @@
|
||||
local moduleType = "stash" -- Module category
|
||||
local moduleName = "hc_inventory" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[ You can edit below here ]]
|
||||
Integrations[moduleType][moduleName].open =
|
||||
function(type, markerId)
|
||||
local id = type .. "_" .. markerId
|
||||
TriggerServerEvent(
|
||||
Utils.eventsPrefix .. ":hc_inventory:server:stashNew", id)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
local info = {
|
||||
maxweight = 1000000,
|
||||
slots = 50
|
||||
-- label = "Stash" -- Uncomment this line if you want a fixed label
|
||||
}
|
||||
|
||||
-- hc_inventory requirement for stash
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":hc_inventory:server:stashNew",
|
||||
function(stashId)
|
||||
local playerId = source
|
||||
local scriptName = Utils.getScriptName("hc_inventory")
|
||||
exports[scriptName]:openExternalStash(playerId, stashId, info)
|
||||
end)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
local moduleType = "stash" -- Module category
|
||||
local moduleName = "jaksam_inventory" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[ You can edit below here ]]
|
||||
Integrations[moduleType][moduleName].open = function(type, markerId)
|
||||
local id = "job_stash_" .. markerId
|
||||
exports['jaksam_inventory']:openInventory(id)
|
||||
end
|
||||
@@ -0,0 +1,66 @@
|
||||
--[[ You can edit below here ]]
|
||||
local STASH_CONFIG = {
|
||||
slots = 50,
|
||||
weight = 100000,
|
||||
}
|
||||
|
||||
local function extractAllowedJobsFromMarker(marker)
|
||||
if marker.job_name == "public_marker" then return nil end
|
||||
|
||||
if marker.grades_type == "minimumGrade" then
|
||||
return { [marker.job_name] = marker.min_grade }
|
||||
end
|
||||
|
||||
local minGrade = math.huge
|
||||
local grades = json.decode(marker.specific_grades)
|
||||
|
||||
for gradeId, _ in pairs(grades) do
|
||||
gradeId = tonumber(gradeId)
|
||||
|
||||
minGrade = math.min(minGrade, gradeId)
|
||||
end
|
||||
|
||||
if minGrade == math.huge then
|
||||
minGrade = 0
|
||||
end
|
||||
|
||||
return { [marker.job_name] = minGrade }
|
||||
end
|
||||
|
||||
local function isMarkerDifferentForEachPlayer(marker)
|
||||
local markerData = json.decode(marker.data)
|
||||
if marker.type ~= "armory" then return false end
|
||||
|
||||
return markerData?.isShared and true or false
|
||||
end
|
||||
|
||||
local function registerStashes()
|
||||
if(config.modules.stash ~= "jaksam_inventory") then return end
|
||||
|
||||
local scriptName = "jaksam_inventory"
|
||||
|
||||
local results = MySQL.Sync.fetchAll('SELECT id, job_name, type, coords, label, grades_type, specific_grades, min_grade, data FROM jobs_data WHERE type="stash" OR type="safe" OR type="armory"')
|
||||
for i=1, #results do
|
||||
local currentMarker = results[i]
|
||||
local stashId = "job_stash_" .. currentMarker.id
|
||||
local coords = vecFromTable(json.decode(currentMarker.coords) or {})
|
||||
local jobs = extractAllowedJobsFromMarker(currentMarker)
|
||||
|
||||
local stash = {
|
||||
id = stashId,
|
||||
label = currentMarker.label,
|
||||
maxSlots = STASH_CONFIG.slots,
|
||||
maxWeight = STASH_CONFIG.weight,
|
||||
isPrivate = isMarkerDifferentForEachPlayer(currentMarker),
|
||||
coords = vecFromTable(coords),
|
||||
allowedJobs = jobs,
|
||||
}
|
||||
|
||||
exports[scriptName]:registerStash(stash)
|
||||
end
|
||||
|
||||
print("^2" .. #results .. " jaksam_inventory stashes registered^7")
|
||||
end
|
||||
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":refreshMarkers", registerStashes)
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":serverConfigLoadedOnStart", registerStashes)
|
||||
@@ -0,0 +1,17 @@
|
||||
local moduleType = "stash" -- Module category
|
||||
local moduleName = "ox_inventory" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
local scriptName = Utils.getScriptName("ox_inventory") -- DO NOT EDIT! If you want to edit the name, you can do it in-game
|
||||
|
||||
--[[ You can edit below here ]]
|
||||
Integrations[moduleType][moduleName].open = function(type, markerId)
|
||||
local id = "job_stash_" .. markerId
|
||||
exports[scriptName]:openInventory('stash', id)
|
||||
end
|
||||
@@ -0,0 +1,56 @@
|
||||
--[[ You can edit below here ]]
|
||||
local STASH_CONFIG = {
|
||||
slots = 50,
|
||||
weight = 100000,
|
||||
}
|
||||
|
||||
local function extractAllowedJobsFromMarker(marker)
|
||||
if marker.job_name == "public_marker" then return nil end
|
||||
|
||||
if marker.grades_type == "minimumGrade" then
|
||||
return { [marker.job_name] = marker.min_grade }
|
||||
end
|
||||
|
||||
local minGrade = math.huge
|
||||
local grades = json.decode(marker.specific_grades)
|
||||
|
||||
for gradeId, _ in pairs(grades) do
|
||||
gradeId = tonumber(gradeId)
|
||||
|
||||
minGrade = math.min(minGrade, gradeId)
|
||||
end
|
||||
|
||||
if minGrade == math.huge then
|
||||
minGrade = 0
|
||||
end
|
||||
|
||||
return { [marker.job_name] = minGrade }
|
||||
end
|
||||
|
||||
local function isMarkerDifferentForEachPlayer(marker)
|
||||
local markerData = json.decode(marker.data)
|
||||
if marker.type ~= "armory" then return false end
|
||||
|
||||
return markerData?.isShared and true or false
|
||||
end
|
||||
|
||||
local function registerStashes()
|
||||
if(config.modules.stash ~= "ox_inventory") then return end
|
||||
|
||||
local scriptName = Utils.getScriptName("ox_inventory") -- DO NOT EDIT! If you want to edit the name, you can do it in-game
|
||||
|
||||
local results = MySQL.Sync.fetchAll('SELECT id, job_name, type, coords, label, grades_type, specific_grades, min_grade, data FROM jobs_data WHERE type="stash" OR type="safe" OR type="armory"')
|
||||
for i=1, #results do
|
||||
local currentMarker = results[i]
|
||||
local stashId = "job_stash_" .. currentMarker.id
|
||||
local coords = vecFromTable(json.decode(currentMarker.coords) or {})
|
||||
local jobs = extractAllowedJobsFromMarker(currentMarker)
|
||||
|
||||
exports[scriptName]:RegisterStash(stashId, currentMarker.label, STASH_CONFIG.slots, STASH_CONFIG.weight, isMarkerDifferentForEachPlayer(currentMarker), jobs, vecFromTable(coords))
|
||||
end
|
||||
|
||||
print("^2" .. #results .. " OX stashes registered^7")
|
||||
end
|
||||
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":refreshMarkers", registerStashes)
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":serverConfigLoadedOnStart", registerStashes)
|
||||
@@ -0,0 +1,15 @@
|
||||
local moduleType = "stash" -- Module category
|
||||
local moduleName = "qb-inventory" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[ You can edit below here ]]
|
||||
Integrations[moduleType][moduleName].open = function(type, markerId)
|
||||
local id = type .. "_" .. markerId
|
||||
TriggerServerEvent(Utils.eventsPrefix .. ":qb-inventory:server:stashNew", id)
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
local info = {
|
||||
maxweight = 1000000,
|
||||
slots = 50,
|
||||
--label = "Stash" -- Uncomment this line if you want a fixed label
|
||||
}
|
||||
|
||||
-- New qb-inventory requirement for stash
|
||||
RegisterNetEvent(Utils.eventsPrefix .. ":qb-inventory:server:stashNew", function(stashId)
|
||||
local playerId = source
|
||||
local scriptName = Utils.getScriptName("qb-inventory") -- DO NOT EDIT! If you want to edit the name, you can do it in-game
|
||||
exports[scriptName]:OpenInventory(playerId, stashId, info)
|
||||
end)
|
||||
@@ -0,0 +1,20 @@
|
||||
local moduleType = "textui" -- Module category
|
||||
local moduleName = "esxTextUI" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].show = function(message)
|
||||
ESX.TextUI(message, "info")
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].hide = function()
|
||||
ESX.HideUI()
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
local moduleType = "textui" -- Module category
|
||||
local moduleName = "jg-textui" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].show = function(message)
|
||||
exports['jg-textui']:DrawText(message)
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].hide = function()
|
||||
exports['jg-textui']:HideText()
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
local moduleType = "textui" -- Module category
|
||||
local moduleName = "none" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].show = function(message)
|
||||
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].hide = function()
|
||||
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
local moduleType = "textui" -- Module category
|
||||
local moduleName = "ox_lib" -- THIS module name
|
||||
|
||||
-- Don't touch, required to appear in in-game settings
|
||||
Integrations.modules = Integrations.modules or {}
|
||||
Integrations.modules[moduleType] = Integrations.modules[moduleType] or {}
|
||||
Integrations[moduleType] = Integrations[moduleType] or {}
|
||||
Integrations[moduleType][moduleName] = {}
|
||||
table.insert(Integrations.modules[moduleType], moduleName)
|
||||
|
||||
--[[
|
||||
You can edit below here
|
||||
]]
|
||||
Integrations[moduleType][moduleName].show = function(message)
|
||||
lib.showTextUI(message)
|
||||
end
|
||||
|
||||
Integrations[moduleType][moduleName].hide = function()
|
||||
lib.hideTextUI()
|
||||
end
|
||||
Reference in New Issue
Block a user