Skip to content

Commit

Permalink
fix: fixed an issue that prevented repair kits from being used
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jul 25, 2024
1 parent e703020 commit ed156a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ AddEventHandler("esx_mechanicjob:onHijack", function()
end
end)

RegisterNetEvent("esx_mechanicjob:onFixkit")
AddEventHandler("esx_mechanicjob:onFixkit", function()
RegisterNetEvent("esx_mechanicjob:onfixkit")
AddEventHandler("esx_mechanicjob:onfixkit", function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ AddEventHandler("esx_mechanicjob:onNPCJobMissionCompleted", function()
TriggerClientEvent("esx:showNotification", source, TranslateCap("your_comp_earned") .. total)
end)

ESX.RegisterUsableItem("fixkit", function()
local source = source
ESX.RegisterUsableItem("fixkit", function(source)
local _ = source
local xPlayer = ESX.GetPlayerFromId(source)

xPlayer.removeInventoryItem("fixkit", 1)

TriggerClientEvent("esx_mechanicjob:onFixkit", source)
TriggerClientEvent("esx_mechanicjob:onfixkit", source)
TriggerClientEvent("esx:showNotification", source, TranslateCap("you_used_repair_kit"))
end)

Expand Down
3 changes: 1 addition & 2 deletions server-data/resources/[ox]/ox_inventory/data/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ return {

["fixkit"] = {
label = "kit di riparazione",
weight = 100,
consume = 1,
weight = 3,
stack = true,
close = true,
},
Expand Down

0 comments on commit ed156a3

Please sign in to comment.