Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 187 KiB |
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
BIN
resources/[inventory]/qs-inventory/html/images/blood_1000.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
resources/[inventory]/qs-inventory/html/images/blood_250.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
resources/[inventory]/qs-inventory/html/images/blood_500.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
resources/[inventory]/qs-inventory/html/images/blood_750.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 247 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 186 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 208 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 200 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 59 KiB |
84
resources/[jobs]/[weapons]/force-sling/server/callbacks.lua
Normal file
|
@ -0,0 +1,84 @@
|
|||
local positions = {}
|
||||
local presets = {}
|
||||
local positionsFile = 'positions.json'
|
||||
local presetsFile = 'presets.json'
|
||||
|
||||
-- Load saved positions from JSON file
|
||||
local function LoadPositions()
|
||||
local file = LoadResourceFile(GetCurrentResourceName(), 'json/' .. positionsFile)
|
||||
if file then
|
||||
positions = json.decode(file) or {}
|
||||
end
|
||||
end
|
||||
|
||||
-- Load saved presets from JSON file
|
||||
local function LoadPresets()
|
||||
local file = LoadResourceFile(GetCurrentResourceName(), 'json/' .. presetsFile)
|
||||
if file then
|
||||
presets = json.decode(file) or {}
|
||||
end
|
||||
end
|
||||
|
||||
-- Save positions to JSON file
|
||||
local function SavePositions()
|
||||
SaveResourceFile(GetCurrentResourceName(), 'json/' .. positionsFile, json.encode(positions), -1)
|
||||
end
|
||||
|
||||
-- Save presets to JSON file
|
||||
local function SavePresets()
|
||||
SaveResourceFile(GetCurrentResourceName(), 'json/' .. presetsFile, json.encode(presets), -1)
|
||||
end
|
||||
|
||||
-- Load data when resource starts
|
||||
CreateThread(function()
|
||||
LoadPositions()
|
||||
LoadPresets()
|
||||
end)
|
||||
|
||||
lib.callback.register('force-sling:callback:getCachedPositions', function(source)
|
||||
return positions
|
||||
end)
|
||||
|
||||
lib.callback.register('force-sling:callback:getCachedPresets', function(source)
|
||||
return presets
|
||||
end)
|
||||
|
||||
lib.callback.register('force-sling:callback:isPlayerAdmin', function(source)
|
||||
local src = source
|
||||
-- Add your admin check logic here
|
||||
-- Example for QBCore:
|
||||
-- local Player = QBCore.Functions.GetPlayer(src)
|
||||
-- return Player.PlayerData.admin or false
|
||||
|
||||
-- For testing, returning true
|
||||
return {isAdmin = true}
|
||||
end)
|
||||
|
||||
lib.callback.register('force-sling:callback:resetWeaponPositions', function(source, weapon)
|
||||
local src = source
|
||||
if weapon then
|
||||
positions[weapon] = nil
|
||||
else
|
||||
positions = {}
|
||||
end
|
||||
SavePositions()
|
||||
return positions
|
||||
end)
|
||||
|
||||
RegisterNetEvent('force-sling:server:saveWeaponPosition', function(position, rotation, weapon, weaponName, boneId, isPreset)
|
||||
local src = source
|
||||
local data = {
|
||||
coords = position,
|
||||
rot = rotation,
|
||||
boneId = boneId
|
||||
}
|
||||
|
||||
if isPreset then
|
||||
presets[weaponName] = data
|
||||
SavePresets()
|
||||
else
|
||||
positions[weaponName] = data
|
||||
SavePositions()
|
||||
end
|
||||
end)
|
||||
|