Auto-sync 2026-04-15 20:40
This commit is contained in:
parent
24b522c959
commit
40fb303e3f
@ -185,8 +185,8 @@ function RemoveMoney(source, type, value)
|
||||
Player.removeMoney(value)
|
||||
end
|
||||
if type == 'black_money' then
|
||||
Player.removeAccountMoney('black_money', value)
|
||||
end
|
||||
Player.removeAccountMoney('black_money', value)
|
||||
end
|
||||
elseif Config.Framework == 'qb' or Config.Framework == 'oldqb' then
|
||||
if type == 'bank' then
|
||||
Player.Functions.RemoveMoney('bank', value)
|
||||
@ -209,8 +209,8 @@ function AddMoney(source, type, value)
|
||||
Player.addMoney(value)
|
||||
end
|
||||
if type == 'black_money' then
|
||||
Player.addAccountMoney('black_money', value)
|
||||
end
|
||||
Player.addAccountMoney('black_money', value)
|
||||
end
|
||||
elseif Config.Framework == 'qb' or Config.Framework == 'oldqb' then
|
||||
if type == 'bank' then
|
||||
Player.Functions.AddMoney('bank', value)
|
||||
@ -232,7 +232,6 @@ function GetPlayerMoney(source, value)
|
||||
if value == 'cash' then
|
||||
return Player.getMoney()
|
||||
end
|
||||
-- FÜGE DIESE ZEILEN HINZU:
|
||||
if value == 'black_money' then
|
||||
return Player.getAccount('black_money').money
|
||||
end
|
||||
@ -264,7 +263,6 @@ Citizen.CreateThread(function()
|
||||
if itemData then
|
||||
if itemData.name == 'cash' then
|
||||
AddMoney(Player.PlayerData.source, 'cash', amount)
|
||||
-- AddItem(Player.PlayerData.source, 'cash', amount)
|
||||
else
|
||||
AddItem(Player.PlayerData.source, itemData.name, amount)
|
||||
end
|
||||
@ -290,7 +288,6 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end, "admin")
|
||||
|
||||
|
||||
Core.Commands.Add(Config.Commands['clearinv'], "Clear Player Inventory (Admin Only)",
|
||||
{ { name = "id", help = "Player ID" } }, false, function(source, args)
|
||||
local id = tonumber(args[1])
|
||||
@ -361,13 +358,12 @@ Citizen.CreateThread(function()
|
||||
local Player = Core.GetPlayerFromId(id)
|
||||
if Player then
|
||||
if itemData then
|
||||
-- ✅ FIX: black_money geht jetzt als normales Item ins Inventar
|
||||
if itemData.name == 'cash' then
|
||||
Player.addMoney(amount)
|
||||
elseif itemData.name == 'black_money' then
|
||||
Player.addAccountMoney('black_money', amount)
|
||||
else
|
||||
AddItem(Player.source, itemData.name, amount)
|
||||
end
|
||||
Player.addMoney(amount)
|
||||
else
|
||||
AddItem(Player.source, itemData.name, amount)
|
||||
end
|
||||
if Config.UseDiscordWebhooks then
|
||||
local discorddata = {
|
||||
playername = GetName(Player.source),
|
||||
@ -476,6 +472,7 @@ end)
|
||||
AddEventHandler('playerDropped', function()
|
||||
handlePlayerUnload(source)
|
||||
end)
|
||||
|
||||
function SavePlayerInventory(id)
|
||||
local identifier = Identifier[tonumber(id)]
|
||||
if not identifier then
|
||||
@ -512,14 +509,10 @@ end
|
||||
function CheckIfAdmin(source)
|
||||
local src = source
|
||||
local Player = GetPlayer(src)
|
||||
|
||||
-- Add this check to prevent indexing a nil 'Player'
|
||||
if not Player then
|
||||
return false
|
||||
if not Player then
|
||||
return false
|
||||
end
|
||||
|
||||
if Config.Framework == 'esx' or Config.Framework == 'oldesx' then
|
||||
-- Also check if getGroup exists, just in case
|
||||
if Player.getGroup then
|
||||
return CheckPermissions(Player.getGroup())
|
||||
end
|
||||
@ -568,7 +561,6 @@ Citizen.CreateThread(function()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if not item.ammotype then
|
||||
item.ammotype = Config.Itemlist[item.name].ammotype or nil
|
||||
end
|
||||
@ -589,7 +581,6 @@ Citizen.CreateThread(function()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if not item.ammotype then
|
||||
item.ammotype = Config.Itemlist[item.name].ammotype or nil
|
||||
end
|
||||
@ -626,42 +617,6 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
-- RegisterServerEvent('codem-inventory:server:UseItem', function(slot, name)
|
||||
-- local src = source
|
||||
-- local identifier = Identifier[tonumber(src)]
|
||||
-- if not identifier then
|
||||
-- TriggerClientEvent('codem-inventory:client:notification', src,
|
||||
-- Locales[Config.Language].notification['IDENTIFIERNOTFOUND'])
|
||||
-- return
|
||||
-- end
|
||||
|
||||
-- local playerInventory = PlayerServerInventory[identifier] and PlayerServerInventory[identifier].inventory
|
||||
-- if not playerInventory then
|
||||
-- TriggerClientEvent('codem-inventory:client:notification', src,
|
||||
-- Locales[Config.Language].notification['PLAYERINVENTORYNOTFOUND'])
|
||||
-- debugprint('DİKKAT ENVANTER BULUNAMADI 1415 SATIR')
|
||||
-- return
|
||||
-- end
|
||||
-- local itemData = playerInventory[tostring(slot)]
|
||||
-- if not itemData then
|
||||
-- TriggerClientEvent('codem-inventory:client:notification', src,
|
||||
-- Locales[Config.Language].notification['ITEMNOTFOUNDINGIVENSLOT'])
|
||||
-- return
|
||||
-- end
|
||||
-- if itemData.name == name then
|
||||
-- if itemData.shouldClose then
|
||||
-- TriggerClientEvent('codem-inventory:client:closeInventory', src)
|
||||
-- end
|
||||
-- if Config.Framework == 'qb' or Config.Framework == 'oldqb' then
|
||||
-- UseItem(itemData.name, src, itemData)
|
||||
-- else
|
||||
-- Core.UseItem(src, itemData.name, itemData)
|
||||
-- end
|
||||
-- end
|
||||
-- end)
|
||||
|
||||
|
||||
RegisterServerEvent('codem-inventory:server:UseItem', function(slot, name)
|
||||
local src = source
|
||||
local identifier = Identifier[tonumber(src)]
|
||||
@ -694,7 +649,7 @@ RegisterServerEvent('codem-inventory:server:UseItem', function(slot, name)
|
||||
debugprint('Removing broken item from inventory')
|
||||
RemoveItem(src, itemData.name, itemData.amount, slot)
|
||||
end
|
||||
return
|
||||
return
|
||||
else
|
||||
TriggerEvent('codem-inventory:server:checkdurabilityUsedItem', src, itemData, identifier)
|
||||
end
|
||||
@ -747,7 +702,6 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
local niltable = {}
|
||||
local result = ExecuteSql("SELECT * FROM codem_new_stash")
|
||||
@ -762,4 +716,4 @@ Citizen.CreateThread(function()
|
||||
for k, v in pairs(niltable) do
|
||||
print('ERROR : nil item index pls check : ' .. v)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
Loading…
x
Reference in New Issue
Block a user