remove more unneeded functions

This commit is contained in:
Kakarot
2025-06-01 15:42:49 -05:00
parent 8f883ccd2a
commit 28753848dc
5 changed files with 10 additions and 147 deletions
+3 -27
View File
@@ -18,8 +18,8 @@ AddEventHandler('playerDropped', function(reason)
QBCore.Players[src] = nil
end)
AddEventHandler("onResourceStop", function(resName)
for i,v in pairs(QBCore.UsableItems) do
AddEventHandler('onResourceStop', function(resName)
for i, v in pairs(QBCore.UsableItems) do
if v.resource == resName then
QBCore.UsableItems[i] = nil
end
@@ -36,7 +36,7 @@ if readyFunction ~= nil then
local DatabaseInfo = QBCore.Functions.GetDatabaseInfo()
if not DatabaseInfo or not DatabaseInfo.exists then return end
local result = MySQL.query.await('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ? AND TABLE_NAME = "bans";', {DatabaseInfo.database})
local result = MySQL.query.await('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ? AND TABLE_NAME = "bans";', { DatabaseInfo.database })
if result and result[1] then
bansTableExists = true
end
@@ -223,26 +223,6 @@ RegisterServerEvent('baseevents:leftVehicle', function(veh, seat, modelName)
TriggerClientEvent('QBCore:Client:VehicleInfo', src, data)
end)
-- Items
-- This event is exploitable and should not be used. It has been deprecated, and will be removed soon.
RegisterNetEvent('QBCore:Server:UseItem', function(item)
print(string.format('%s triggered QBCore:Server:UseItem by ID %s with the following data. This event is deprecated due to exploitation, and will be removed soon. Check qb-inventory for the right use on this event.', GetInvokingResource(), source))
QBCore.Debug(item)
end)
-- This event is exploitable and should not be used. It has been deprecated, and will be removed soon. function(itemName, amount, slot)
RegisterNetEvent('QBCore:Server:RemoveItem', function(itemName, amount)
local src = source
print(string.format('%s triggered QBCore:Server:RemoveItem by ID %s for %s %s. This event is deprecated due to exploitation, and will be removed soon. Adjust your events accordingly to do this server side with player functions.', GetInvokingResource(), src, amount, itemName))
end)
-- This event is exploitable and should not be used. It has been deprecated, and will be removed soon. function(itemName, amount, slot, info)
RegisterNetEvent('QBCore:Server:AddItem', function(itemName, amount)
local src = source
print(string.format('%s triggered QBCore:Server:AddItem by ID %s for %s %s. This event is deprecated due to exploitation, and will be removed soon. Adjust your events accordingly to do this server side with player functions.', GetInvokingResource(), src, amount, itemName))
end)
-- Non-Chat Command Calling (ex: qb-adminmenu)
RegisterNetEvent('QBCore:CallCommand', function(command, args)
@@ -279,7 +259,3 @@ QBCore.Functions.CreateCallback('QBCore:Server:CreateVehicle', function(source,
local veh = QBCore.Functions.CreateAutomobile(source, model, coords, warp)
cb(NetworkGetNetworkIdFromEntity(veh))
end)
--QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, amount)
-- https://github.com/qbcore-framework/qb-inventory/blob/e4ef156d93dd1727234d388c3f25110c350b3bcf/server/main.lua#L2066
--end)