housing und dj
This commit is contained in:
parent
112c7b1761
commit
10a5d168d4
731 changed files with 506993 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
if Config.Inventory ~= 'inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
local maxweight = data.maxweight or 10000
|
||||
TriggerEvent('inventory:openInventory', { type = 'stash', id = uniq, title = 'Stash_' .. uniq, weight = maxweight, delay = 100, save = true })
|
||||
end
|
|
@ -0,0 +1,25 @@
|
|||
if Config.Inventory ~= 'codem-inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
local name = uniq
|
||||
local maxweight = data.maxweight or 10000
|
||||
local slot = data.slots or 30
|
||||
exports['codem-inventory']:OpenStash(name, maxweight, slot)
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
if Config.Inventory ~= 'core_inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
TriggerServerEvent('core_inventory:server:openInventory', tostring(uniq):gsub(':', ''):gsub('#', ''):gsub(' ', ''), 'stash', nil, nil)
|
||||
end
|
|
@ -0,0 +1,293 @@
|
|||
if Config.Inventory ~= 'esx_inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
local function BlackMoneyStorage()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'storage',
|
||||
{
|
||||
title = Lang('HOUSING_MENU_STASH_DEFAULT_TITLE'),
|
||||
align = 'right',
|
||||
elements = {
|
||||
{ label = Lang('HOUSING_MENU_STASH_STORE'), value = 's' },
|
||||
{ label = Lang('HOUSING_MENU_STASH_WITHDRAW'), value = 'w' }
|
||||
},
|
||||
},
|
||||
function(data, menu)
|
||||
if data.current.value == 's' then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'putAmount', { title = Lang('HOUSING_MENU_BLACK_MONEY_AMOUNT') }, function(data3, menu3)
|
||||
local amount = tonumber(data3.value)
|
||||
|
||||
if amount == nil then
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
else
|
||||
if amount >= 0 then
|
||||
TriggerServerCallback('qb-houses:server:depositBlackMoney', function(success)
|
||||
if success then
|
||||
Notification(Lang('HOUSING_NOTIFICATION_BLACK_MONEY_SUCCESS'), 'success')
|
||||
else
|
||||
Notification(Lang('HOUSING_NOTIFICATION_CANT_AFFORD'), 'error')
|
||||
end
|
||||
end, amount)
|
||||
menu3.close()
|
||||
else
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
end
|
||||
end
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
elseif data.current.value == 'w' then
|
||||
TriggerServerCallback('qb-houses:server:getBlackMoney', function(count)
|
||||
local elements = {}
|
||||
|
||||
table.insert(elements, { label = Lang('HOUSING_MENU_BLACK_MONEY_NAME') .. ' $' .. count, value = 'black_money' })
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'withdrawItem', {
|
||||
title = Lang('HOUSING_MENU_BLACK_MONEY_WITHDRAW'),
|
||||
align = 'right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'putAmount', { title = Lang('HOUSING_MENU_BLACK_MONEY_AMOUNT') }, function(data3, menu3)
|
||||
local amount = tonumber(data3.value)
|
||||
|
||||
if amount == nil then
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
else
|
||||
if amount >= 0 then
|
||||
TriggerServerCallback('qb-houses:server:withdrawBlackMoney', function(success)
|
||||
if success then
|
||||
Notification(Lang('HOUSING_NOTIFICATION_BLACK_MONEY_SUCCESS_WITHDRAW'), 'success')
|
||||
else
|
||||
Notification(Lang('HOUSING_NOTIFICATION_CANT_AFFORD'), 'error')
|
||||
end
|
||||
end, amount)
|
||||
menu3.close()
|
||||
menu2.close()
|
||||
else
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
end
|
||||
end
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, id)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
local function ItemStorage(id)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'storage',
|
||||
{
|
||||
title = Lang('HOUSING_MENU_STASH_DEFAULT_TITLE'),
|
||||
align = 'right',
|
||||
elements = {
|
||||
{ label = Lang('HOUSING_MENU_STASH_STORE'), value = 's' },
|
||||
{ label = Lang('HOUSING_MENU_STASH_WITHDRAW'), value = 'w' }
|
||||
},
|
||||
},
|
||||
function(data, menu)
|
||||
if data.current.value == 's' then
|
||||
TriggerServerCallback('qb-houses:server:getInventory', function(inv)
|
||||
local elements = {}
|
||||
|
||||
for k, v in pairs(inv['items']) do
|
||||
if v['count'] >= 1 then
|
||||
table.insert(elements, { label = ('x%s %s'):format(v['count'], v['label']), type = 'item', value = v['name'] })
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'storeItem', {
|
||||
title = Lang('HOUSING_MENU_PLAYER_INVENTORY'),
|
||||
align = 'right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'putAmount', { title = 'Amount' }, function(data3, menu3)
|
||||
local amount = tonumber(data3.value)
|
||||
|
||||
if amount == nil then
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
else
|
||||
if amount >= 0 then
|
||||
TriggerServerEvent('qb-houses:server:storeItem', data2.current.type, data2.current.value, tonumber(data3.value), id)
|
||||
menu3.close()
|
||||
menu2.close()
|
||||
else
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
end
|
||||
end
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end)
|
||||
elseif data.current.value == 'w' then
|
||||
TriggerServerCallback('qb-houses:server:getHouseInventory', function(inv)
|
||||
local elements = {}
|
||||
|
||||
for k, v in pairs(inv['items']) do
|
||||
if v['count'] > 0 then
|
||||
table.insert(elements, { label = ('x%s %s'):format(v['count'], v['label']), value = v['name'] })
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'withdrawItem', {
|
||||
title = Lang('HOUSING_MENU_HOUSE_INVENTORY'),
|
||||
align = 'right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'putAmount', { title = 'Amount' }, function(data3, menu3)
|
||||
local amount = tonumber(data3.value)
|
||||
|
||||
if amount == nil then
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
else
|
||||
if amount >= 0 then
|
||||
TriggerServerEvent('qb-houses:server:withdrawItem', 'item', data2.current.value, tonumber(data3.value), id)
|
||||
menu3.close()
|
||||
menu2.close()
|
||||
else
|
||||
Notification(Lang('HOUSING_NOTIFICATION_INVALID_AMOUNT'), 'error')
|
||||
end
|
||||
end
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, id)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
local function WeaponStorage(id)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
TriggerServerCallback('qb-houses:server:getInventory', function(inv)
|
||||
local elements = {}
|
||||
|
||||
for k, v in pairs(inv['weapons']) do
|
||||
table.insert(elements, { label = v['label'], weapon = v['name'], ammo = v['ammo'] })
|
||||
end
|
||||
end)
|
||||
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'storage',
|
||||
{
|
||||
title = Lang('HOUSING_MENU_STASH_DEFAULT_TITLE'),
|
||||
align = 'right',
|
||||
elements = {
|
||||
{ label = Lang('HOUSING_MENU_STASH_STORE'), value = 's' },
|
||||
{ label = Lang('HOUSING_MENU_STASH_WITHDRAW'), value = 'w' }
|
||||
},
|
||||
},
|
||||
function(data, menu)
|
||||
if data.current.value == 's' then
|
||||
TriggerServerCallback('qb-houses:server:getInventory', function(inv)
|
||||
local elements = {}
|
||||
|
||||
for k, v in pairs(inv['weapons']) do
|
||||
table.insert(elements, { label = v['label'], weapon = v['name'], ammo = v['ammo'] })
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'storeItem', {
|
||||
title = Lang('HOUSING_MENU_HOUSE_INVENTORY'),
|
||||
align = 'right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
TriggerServerEvent('qb-houses:server:storeItem', 'weapon', data2.current.weapon, data2.current.ammo, id)
|
||||
menu2.close()
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end)
|
||||
elseif data.current.value == 'w' then
|
||||
TriggerServerCallback('qb-houses:server:getHouseInventory', function(inv)
|
||||
local elements = {}
|
||||
|
||||
for k, v in pairs(inv['weapons']) do
|
||||
table.insert(elements, { label = ('%s | x%s %s'):format(ESX.GetWeaponLabel(v['name']), v['ammo'], 'bullets'), weapon = v['name'], ammo = v['ammo'] })
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'withdrawItem', {
|
||||
title = Lang('HOUSING_MENU_HOUSE_INVENTORY'),
|
||||
align = 'right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
TriggerServerEvent('qb-houses:server:withdrawItem', 'weapon', data2.current.weapon, data2.current.ammo, id)
|
||||
menu2.close()
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, id)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
local function DefaultQbcoreStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
TriggerServerEvent('inventory:server:OpenInventory', 'stash', uniq, data)
|
||||
TriggerEvent('inventory:client:SetCurrentStash', uniq)
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
if Config.Framework == 'qb' then
|
||||
return DefaultQbcoreStash(customData, uniq)
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'storage',
|
||||
{
|
||||
title = Lang('HOUSING_MENU_STASH_DEFAULT_TITLE'),
|
||||
align = 'right',
|
||||
elements = {
|
||||
|
||||
{ label = Lang('HOUSING_MENU_STASH_ITEMS'), value = 'i' },
|
||||
{ label = Lang('HOUSING_MENU_STASH_WEAPONS'), value = 'w' },
|
||||
{ label = Lang('HOUSING_MENU_BLACK_MONEY_NAME'), value = 'b' }
|
||||
},
|
||||
},
|
||||
function(data, menu)
|
||||
if data.current.value == 'i' then
|
||||
ItemStorage()
|
||||
elseif data.current.value == 'w' then
|
||||
WeaponStorage()
|
||||
elseif data.current.value == 'b' then
|
||||
BlackMoneyStorage()
|
||||
end
|
||||
end,
|
||||
function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
if Config.Inventory ~= 'origen_inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
TriggerServerEvent('inventory:server:OpenInventory', 'stash', 'stash_house' .. uniq .. '', data)
|
||||
end
|
|
@ -0,0 +1,39 @@
|
|||
if Config.Inventory ~= 'ox_inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
local ox_inventory = exports.ox_inventory
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
local maxweight = data.maxweight or 10000
|
||||
local slot = data.slots or 30
|
||||
if ox_inventory:openInventory('stash', uniq) == false then
|
||||
TriggerServerEvent('qb-houses:server:RegisterStash', uniq, slot, maxweight)
|
||||
ox_inventory:openInventory('stash', uniq)
|
||||
Debug('Ox Stash', 'Registering new stash', uniq)
|
||||
end
|
||||
end
|
||||
|
||||
exports('lockpick', function()
|
||||
local jobCount = TriggerServerCallbackSync('housing:checkTotalJobCount')
|
||||
if jobCount < Config.RequiredCop then
|
||||
TriggerEvent('qb-houses:sendTextMessage', Lang('HOUSING_NOTIFICATION_NO_POLICES'), 'error')
|
||||
return
|
||||
end
|
||||
TriggerEvent('qb-houses:client:lockpick')
|
||||
end)
|
|
@ -0,0 +1,31 @@
|
|||
if Config.Inventory ~= 'ps-inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
|
||||
TriggerServerEvent('ps-inventory:server:OpenInventory', 'stash', uniq, data)
|
||||
|
||||
TriggerEvent('ps-inventory:client:SetCurrentStash', uniq)
|
||||
end
|
||||
|
||||
RegisterNetEvent('ps-inventory:client:SetCurrentStash', function(stash)
|
||||
CurrentStash = stash
|
||||
end)
|
|
@ -0,0 +1,25 @@
|
|||
if Config.Inventory ~= 'qb-inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
-- if you use old qb-inventory version, uncomment here and remove 'housing:openStash' trigger.
|
||||
-- TriggerServerEvent('inventory:server:OpenInventory', 'stash', uniq, data)
|
||||
-- TriggerEvent('inventory:client:SetCurrentStash', uniq)
|
||||
TriggerServerEvent('housing:openStash', uniq, data)
|
||||
end
|
|
@ -0,0 +1,23 @@
|
|||
if Config.Inventory ~= 'qs-inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
TriggerServerEvent('inventory:server:OpenInventory', 'stash', uniq, data)
|
||||
TriggerEvent('inventory:client:SetCurrentStash', uniq)
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
if Config.Inventory ~= 'tgiann-inventory' then
|
||||
return
|
||||
end
|
||||
|
||||
function openStash(customData, uniq)
|
||||
local data = customData or Config.DefaultStashData
|
||||
local house = CurrentHouse
|
||||
local houseData = Config.Houses[house]
|
||||
if not customData then
|
||||
if houseData.ipl then
|
||||
data = houseData.ipl.stash or data
|
||||
else
|
||||
local shellData = Config.Shells[houseData.tier]
|
||||
if shellData then
|
||||
data = shellData.stash or data
|
||||
end
|
||||
end
|
||||
end
|
||||
uniq = uniq or house
|
||||
uniq = uniq:gsub('-', '_')
|
||||
local maxweight = data.maxweight or 10000
|
||||
exports['tgiann-inventory']:OpenInventory('stash', uniq, {
|
||||
maxweight = maxweight,
|
||||
slots = data.slots or 100,
|
||||
})
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue