ed
This commit is contained in:
parent
f333947ed9
commit
032ec698d8
50 changed files with 27 additions and 5845 deletions
|
|
@ -1,45 +0,0 @@
|
|||
if GetResourceState('es_extended') ~= 'started' then return end
|
||||
|
||||
ESX = exports.es_extended:getSharedObject()
|
||||
|
||||
function ShowNotification(text)
|
||||
ESX.ShowNotification(text)
|
||||
end
|
||||
|
||||
function GetPlayersInArea(coords, radius)
|
||||
local coords = coords or GetEntityCoords(PlayerPedId())
|
||||
local radius = radius or 3.0
|
||||
local list = ESX.Game.GetPlayersInArea(coords, radius)
|
||||
local players = {}
|
||||
for _, player in pairs(list) do
|
||||
if player ~= PlayerId() then
|
||||
players[#players + 1] = player
|
||||
end
|
||||
end
|
||||
return players
|
||||
end
|
||||
|
||||
RegisterNetEvent(GetCurrentResourceName()..":showNotification", function(text)
|
||||
ShowNotification(text)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded')
|
||||
AddEventHandler('esx:playerLoaded',function(xPlayer, isNew, skin)
|
||||
TriggerServerEvent("pickle_consumables:initializePlayer")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("pickle_consumables:executeStatus", function(status, value)
|
||||
if value >= 0 then
|
||||
TriggerEvent('esx_status:add', status, value)
|
||||
else
|
||||
TriggerEvent('esx_status:remove', status, value)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Inventory Fallback
|
||||
|
||||
CreateThread(function()
|
||||
Wait(100)
|
||||
if InitializeInventory then return InitializeInventory() end -- Already loaded through inventory folder.
|
||||
print("The only supported inventory for ESX is ox_inventory and qs-inventory, if you would like to port to a different inventory, please use the example shown in the inventory folder.")
|
||||
end)
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
if GetResourceState('es_extended') ~= 'started' then return end
|
||||
|
||||
RegisterUsableItem = nil
|
||||
Framework = "ESX"
|
||||
ESX = exports.es_extended:getSharedObject()
|
||||
|
||||
function ShowNotification(target, text)
|
||||
TriggerClientEvent(GetCurrentResourceName()..":showNotification", target, text)
|
||||
end
|
||||
|
||||
function GetIdentifier(source)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
return xPlayer.identifier
|
||||
end
|
||||
|
||||
function SetPlayerMetadata(source, key, data)
|
||||
-- No player metadata in ESX.
|
||||
end
|
||||
|
||||
function AddMoney(source, count)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
xPlayer.addMoney(count)
|
||||
end
|
||||
|
||||
function RemoveMoney(source, count)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
xPlayer.removeMoney(count)
|
||||
end
|
||||
|
||||
function GetMoney(source)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
return xPlayer.getMoney()
|
||||
end
|
||||
|
||||
function CheckPermission(source, permission)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local name = xPlayer.job.name
|
||||
local rank = xPlayer.job.grade
|
||||
local group = xPlayer.getGroup()
|
||||
if permission.jobs[name] and permission.jobs[name] <= rank then
|
||||
return true
|
||||
end
|
||||
for i=1, #permission.groups do
|
||||
if group == permission.groups[i] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Status
|
||||
|
||||
function ExecuteStatus(source, statuses)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
for k,v in pairs(statuses) do
|
||||
if Config.MaxValues[k] then
|
||||
local value = (0.01 * v) * Config.MaxValues[k]
|
||||
TriggerClientEvent("pickle_consumables:executeStatus", source, k, value)
|
||||
else
|
||||
Config.ExternalStatus(source, k, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Inventory Fallback
|
||||
|
||||
CreateThread(function()
|
||||
Wait(100)
|
||||
if not UsableItem then
|
||||
RegisterUsableItem = function(name, cb)
|
||||
ESX.RegisterUsableItem(name, function(source, item, data)
|
||||
if not data then data = {} end
|
||||
cb(source, data.metadata, data.slot)
|
||||
end)
|
||||
end
|
||||
end
|
||||
if InitializeInventory then return InitializeInventory() end -- Already loaded through inventory folder.
|
||||
end)
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
local DefaultMax = 1000000
|
||||
|
||||
for k,v in pairs(Config.MaxValues) do
|
||||
if v < 1 then
|
||||
Config.MaxValues[k] = DefaultMax
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue