This commit is contained in:
Max 2025-06-12 13:52:05 +02:00
commit 8675f42753
37 changed files with 84 additions and 0 deletions

View file

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

View file

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 247 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

View file

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

View file

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

View 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)