Skip to content

Commit

Permalink
Merge pull request #850 from bitpredator/dev
Browse files Browse the repository at this point in the history
chore: modified item images and various corrections
  • Loading branch information
bitpredator authored Sep 29, 2024
2 parents 9f090a5 + bd0ad41 commit d42b747
Show file tree
Hide file tree
Showing 465 changed files with 87 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ INSERT INTO `bpt_items` (`name`, `label`) VALUES
('cottonforbandages', 'cottonforbandages'),
('cotton', 'cotton'),
('ironsheet', 'ironsheet'),
('steelsheet', 'steelsheet'),
('garbage', 'garbage'),
('WEAPON_APPISTOL', 'WEAPON APPISTOL'),
('iron', 'iron'),
Expand Down Expand Up @@ -57,5 +58,6 @@ INSERT INTO `bpt_items` (`name`, `label`) VALUES
('diamond', 'Diamond'),
('marijuana_extract', 'Marijuana extract'),
('medikit', 'Medikit'),
('salmon_fillet', 'Salmon Fillet')
('salmon_fillet', 'Salmon Fillet'),
('armour', 'armour'),
;
35 changes: 35 additions & 0 deletions server-data/resources/[bpt_addons]/bpt_crafting/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,22 @@ Config = {
},
},

["steelsheet"] = {
Level = 0,
Category = "manufacturing",
isGun = false,
Jobs = { "import" },
JobGrades = {},
Amount = 5,
SuccessRate = 100,
requireBlueprint = false,
Time = 60,
Ingredients = {
["steel"] = 1,
["hammer"] = 1,
},
},

["diamond_tip"] = {
Level = 0,
Category = "tools",
Expand Down Expand Up @@ -440,6 +456,23 @@ Config = {
},
},

["armour"] = {
Level = 10,
Category = "ammu",
isGun = false,
Jobs = { "ammu" },
JobGrades = {},
Amount = 1,
SuccessRate = 100,
requireBlueprint = false,
Time = 60,
Ingredients = {
["steelsheet"] = 1,
["ironsheet"] = 1,
["hammer"] = 1,
},
},

["bread"] = {
Level = 0,
Category = "baker",
Expand Down Expand Up @@ -526,6 +559,7 @@ Config = {
"cottonforbandages",
"hammer",
"ironsheet",
"steelsheet",
"recycled_paper",
"paper",
"recycled_plastic",
Expand Down Expand Up @@ -560,6 +594,7 @@ Config = {
"WEAPON_KNUCKLE",
"WEAPON_NIGHTSTICK",
"WEAPON_PISTOL",
"armour",
},
radius = 1.0,
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ INSERT INTO `bpt_items` (`name`, `label`) VALUES
('cottonforbandages', 'cotone per bende'),
('cotton', 'cotone'),
('ironsheet', 'lamiera di ferro'),
('steelsheet', 'lamiera di acciaio'),
('garbage', 'rifiuti'),
('WEAPON_APPISTOL', 'pistola AP'),
('iron', 'Ferro'),
Expand Down Expand Up @@ -54,8 +55,9 @@ INSERT INTO `bpt_items` (`name`, `label`) VALUES
('marijuana', 'marijuana'),
('cannabis', 'Cannabis'),
('diamond_tip', 'Punta di diamante'),
('diamond', 'Diamond'),
('diamond', 'Diamante'),
('marijuana_extract', 'Estratto di marijuana'),
('medikit', 'Medikit'),
('salmon_fillet', 'Filetto di salmone')
('salmon_fillet', 'Filetto di salmone'),
('armour', 'giubbotto antiproiettile')
;
9 changes: 6 additions & 3 deletions server-data/resources/[ox]/ox_inventory/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven

TriggerServerEvent('ox_inventory:updateWeapon', 'throw', nil, weapon.slot)

plyState.invBusy = false
plyState:set('invBusy', false, true)
currentWeapon = nil

RemoveWeaponFromPed(playerPed, weapon.hash)
Expand All @@ -1500,7 +1500,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
end
end)

plyState:set('invBusy', false, false)
plyState:set('invBusy', false, true)
plyState:set('invOpen', false, false)
plyState:set('invHotkeys', true, false)
plyState:set('canUseWeapons', true, false)
Expand Down Expand Up @@ -1609,7 +1609,10 @@ local function giveItemToTarget(serverId, slotId, count)
end

Utils.PlayAnim(0, 'mp_common', 'givetake1_a', 1.0, 1.0, 2000, 50, 0.0, 0, 0, 0)
TriggerServerEvent('ox_inventory:giveItem', slotId, serverId, count or 0)
local notification = lib.callback.await('ox_inventory:giveItem', false, slotId, serverId, count or 0)
if notification then
lib.notify({ type = 'error', description = locale(table.unpack(notification)) })
end
end

exports('giveItemToTarget', giveItemToTarget)
Expand Down
14 changes: 14 additions & 0 deletions server-data/resources/[ox]/ox_inventory/data/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ return {
consume = 0,
},

["steelsheet"] = {
label = "lamiera di acciaio",
weight = 60,
stack = true,
close = false,
consume = 0,
},

["identification"] = {
label = "Identification",
},
Expand Down Expand Up @@ -733,4 +741,10 @@ return {
stack = true,
close = true,
},

["stevo_policebadge"] = {
label = "Police Badge",
weight = 250,
stack = false,
},
}
16 changes: 1 addition & 15 deletions server-data/resources/[ox]/ox_inventory/data/shops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,11 @@ return {
{ name = "water", price = 100 },
{ name = "cola", price = 80 },
{ name = "burger", price = 70 },
},
locations = {
vec3(25.846155, -1346.782471, 29.482056),
},
},

Fishingshop = {
name = "Fishing shop",
blip = {
id = 68,
colour = 69,
scale = 0.8,
},
inventory = {
{ name = "fishingrod", price = 100 },
{ name = "fishbait", price = 80 },
},
locations = {
vec3(-327.639557, -2793.745117, 5.201416),
vec3(25.846155, -1346.782471, 29.482056),
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ local Weapon = require("modules.weapon.client")

RegisterNetEvent("esx_policejob:handcuff", function()
PlayerData.cuffed = not PlayerData.cuffed
LocalPlayer.state:set("invBusy", PlayerData.cuffed, false)
LocalPlayer.state:set('invBusy', PlayerData.cuffed, true)

if not PlayerData.cuffed then
return
Expand All @@ -55,5 +55,5 @@ end)

RegisterNetEvent("esx_policejob:unrestrain", function()
PlayerData.cuffed = false
LocalPlayer.state:set("invBusy", PlayerData.cuffed, false)
LocalPlayer.state:set('invBusy', PlayerData.cuffed, true)
end)
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ end
local success, result = pcall(lib.load, ('modules.bridge.%s.server'):format(shared.framework))

if not success then
lib.print.error(result)
lib = nil
return
error(result, 0)
end

if server.convertInventory then exports('ConvertItems', server.convertInventory) end
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function Inventory.SlotWeight(item, slot, ignoreCount)
end

if item.hash == `WEAPON_PETROLCAN` then
weight += 15000 * (slot.metadata.ammo / 100)
slot.metadata.weight = 15000 * (slot.metadata.ammo / 100)
end

if slot.metadata.components then
Expand Down Expand Up @@ -2403,8 +2403,8 @@ RegisterServerEvent('ox_inventory:closeInventory', function()
end
end)

RegisterServerEvent('ox_inventory:giveItem', function(slot, target, count)
local fromInventory = Inventories[source]
local function giveItem(playerId, slot, target, count)
local fromInventory = Inventories[playerId]
local toInventory = Inventories[target]

if count <= 0 then count = 1 end
Expand All @@ -2414,18 +2414,23 @@ RegisterServerEvent('ox_inventory:giveItem', function(slot, target, count)

if not data then return end

local targetState = Player(target).state
if targetState.invBusy then
return { 'cannot_give', count, data.label }
end

local item = Items(data.name)

if not item or data.count < count or not Inventory.CanCarryItem(toInventory, item, count, data.metadata) or #(GetEntityCoords(fromInventory.player.ped) - GetEntityCoords(toInventory.player.ped)) > 15 then
return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })
return { 'cannot_give', count, data.label }
end

local toSlot = Inventory.GetSlotForItem(toInventory, data.name, data.metadata)
local fromRef = ('%s:%s'):format(fromInventory.id, slot)
local toRef = ('%s:%s'):format(toInventory.id, toSlot)

if activeSlots[fromRef] or activeSlots[toRef] then
return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })
return { 'cannot_give', count, data.label }
end

activeSlots[fromRef] = true
Expand Down Expand Up @@ -2458,9 +2463,12 @@ RegisterServerEvent('ox_inventory:giveItem', function(slot, target, count)
end
end

return TriggerClientEvent('ox_lib:notify', fromInventory.id, { type = 'error', description = locale('cannot_give', count, data.label) })
return { 'cannot_give', count, data.label }
end
end)
end

lib.callback.register('ox_inventory:giveItem', giveItem)
RegisterServerEvent('ox_inventory:giveItem', function(...) giveItem(source, ...) end)

local function updateWeapon(source, action, value, slot, specialAmmo)
local inventory = Inventories[source]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ local Inventory

CreateThread(function()
Inventory = require 'modules.inventory.server'
if not lib then return end

if shared.framework == 'esx' then
local success, items = pcall(MySQL.query.await, 'SELECT * FROM items')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ local function refreshShops()
scenario = target.scenario,
label = label,
groups = shop.groups,
icon = shop.icon,
icon = shop.icon or 'fas fa-shopping-basket',
iconColor = target.iconColor,
onEnter = onEnterShop,
onExit = onExitShop,
Expand Down
8 changes: 4 additions & 4 deletions server-data/resources/[ox]/ox_inventory/server.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
if not lib then return end

require 'modules.bridge.server'
require 'modules.shops.server'
require 'modules.pefcl.server'

if GetConvar('inventory:versioncheck', 'true') == 'true' then
lib.versionCheck('overextended/ox_inventory')
end
Expand All @@ -9,10 +13,6 @@ local db = require 'modules.mysql.server'
local Items = require 'modules.items.server'
local Inventory = require 'modules.inventory.server'

require 'modules.shops.server'
require 'modules.pefcl.server'
require 'modules.bridge.server'

---@param player table
---@param data table?
--- player requires source, identifier, and name
Expand Down
Binary file modified server-data/resources/[ox]/ox_inventory/web/images/CIGARETTE.png
Loading

0 comments on commit d42b747

Please sign in to comment.