Skip to content

Commit

Permalink
Independent log for validation kick
Browse files Browse the repository at this point in the history
qb-log still commented for use if that's preferred
  • Loading branch information
TradieKM authored Dec 17, 2023
1 parent 0c34b4d commit f748027
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1719,16 +1719,25 @@ QBCore.Functions.CreateCallback('inventory:requestserver', function(source, cb,
end)

RegisterNetEvent('inventory:statusBreak', function(data)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player then
local CitizenID = Player.PlayerData.citizenid
local discordId = QBCore.Functions.GetIdentifier(src, 'discord'):gsub("discord:", "")
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local discordId = QBCore.Functions.GetIdentifier(src, 'discord'):gsub("discord:", "")
local discordMention = "<@" .. discordId .. ">"
--TriggerEvent("qb-log:server:CreateLog", "inventory", "Player Kicked", "orange", "**" .. discordMention .. " / " .. GetPlayerName(src) .. "** was kicked for inventory timeout. \n\n From: **" .. data.fromInventory .. " \n **To:** " .. data.toInventory .. "**")
DropPlayer(src, "Something went wrong. \n\n If you or the server were experiencing network issues or timing out, simply relaunch your game and reconnect.")
end
end)
local content = {
{
["color"] = '2302179',
["title"] = "**Player Kicked**",
["description"] = "**"..discordMention .. " / "..GetPlayerName(src).."** was kicked for inventory action timeout. \n\n From: **" ..data.fromInventory.." \n **To:** "..data.toInventory.."**",
["footer"] = {
["text"] = "Inventory",
},
}
}
PerformHttpRequest("YOUR_DISCORD_WEBHOOK_LINK", function(err, text, headers) end, 'POST', json.encode({username = "Inventory", embeds = content}), { ['Content-Type'] = 'application/json' })
--TriggerEvent("qb-log:server:CreateLog", "inventory", "Player Kicked", "orange", "**" .. discordMention .. " / " .. GetPlayerName(src) .. "** was kicked for inventory timeout. \n\n From: **" .. data.fromInventory .. " \n **To:** " .. data.toInventory .. "**")
DropPlayer(source, "Something went wrong. \n\n If you or the server were experiencing network issues or timing out, simply relaunch your game and reconnect.")

end)

RegisterNetEvent('inventory:server:SetInventoryData', function(fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)
local src = source
Expand Down

0 comments on commit f748027

Please sign in to comment.