From a4e9333ab82943cc1e556fadf83e867137ff0874 Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Fri, 23 Feb 2024 15:47:08 +0000 Subject: [PATCH] 1.0.14 --- functions.lua | 17 +++++++++++++++-- fxmanifest.lua | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/functions.lua b/functions.lua index 17b34fc..44c8147 100644 --- a/functions.lua +++ b/functions.lua @@ -110,7 +110,7 @@ end function makeProp(data, freeze, synced) loadModel(data.prop) - local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z-1.03, freeze or false, synced or false, false) + local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z-1.03, synced and synced or false, synced and synced or false, false) SetEntityHeading(prop, data.coords.w + 180.0) FreezeEntityPosition(prop, freeze and freeze or 0) if Config.System.Debug then @@ -387,7 +387,7 @@ RegisterNetEvent(GetCurrentResourceName()..":Server:ClearDUI", function(data) end) AddEventHandler('onResourceStop', function(r) if r ~= GetCurrentResourceName() then return end - for k, v in pairs(duiList) do + for k, v in pairs(duiList or {}) do for i = 1, #v do RemoveReplaceTexture(tostring(v[i].tex.texd), tostring(v[i].tex.texn)) end @@ -849,6 +849,19 @@ function dupeWarn(src, item, amount) print("^5DupeWarn:^7: (^1"..tostring(src).."^7) ^2Dropped from server - exploit protection detected an item not being found in players inventory^7") end +function breakTool(data) --wip + local durability, slot = getDurability(item) + durability -= data.damage + if not durability then durability = 100 end + if durability <= 0 then + removeItem(data.item, 1) + local breakId = GetSoundId() + PlaySoundFromEntity(breakId, "Drill_Pin_Break", PlayerPedId(), "DLC_HEIST_FLEECA_SOUNDSET", 1, 0) + else + TriggerServerEvent(GetCurrentResourceName()..":server:setMetaData", { item = data.item, slot = slot, metadata = { durability = durability }}) + end +end + function getDurability(item) local lowestSlot = 100 -- anything above your players max slots local durability = nil diff --git a/fxmanifest.lua b/fxmanifest.lua index f3ef6b9..db3dbad 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -1,6 +1,6 @@ name "Jim_Bridge" author "Jimathy" -version "1.0.13" +version "1.0.14" description "Framework Bridge By Jimathy" fx_version "cerulean" game "gta5"