Skip to content

Commit

Permalink
Citation item for ox_inv fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lenzh authored and MonkeyWhisper committed Oct 4, 2023
1 parent e57abcc commit 9a6de01
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1825,15 +1825,27 @@ local function giveCitationItem(src, citizenId, fine, incidentId)
local PlayerName = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
local Officer = QBCore.Functions.GetPlayer(src)
local OfficerFullName = '(' .. Officer.PlayerData.metadata.callsign .. ') ' .. Officer.PlayerData.charinfo.firstname .. ' ' .. Officer.PlayerData.charinfo.lastname

local info = {}
local date = os.date("%Y-%m-%d %H:%M")
local info = {
citizenId = citizenId,
fine = "$"..fine,
date = date,
incidentId = "#"..incidentId,
officer = OfficerFullName,
}
if Config.InventoryForWeaponsImages == "ox_inventory" then
info = {
description = {
'Citizen ID: ' .. citizenId ' \n',
'Fine: $ ' .. fine ' \n',
'Date: ' .. date ' \n',
'Incitent ID: # ' .. incidentId ' \n',
'Officer: ' .. OfficerFullName
}
}
else
info = {
citizenId = citizenId,
fine = "$"..fine,
date = date,
incidentId = "#"..incidentId,
officer = OfficerFullName,
}
end
Player.Functions.AddItem('mdtcitation', 1, false, info)
TriggerClientEvent('QBCore:Notify', src, PlayerName.." (" ..citizenId.. ") received a citation!")
if Config.QBManagementUse then
Expand Down

0 comments on commit 9a6de01

Please sign in to comment.