Wert Evidence System
You can access the setup information you need about this product
Last updated
You can access the setup information you need about this product
Last updated
1 - Upload the script folder to the location of your resources
2 - Load sql file in your database loadme.sql
3 - Add the required items listed below to your inventory
4 - Upload the item images among the other item images in your inventory
5 - Check config and editable file settings. If you are using different systems, you can make the necessary adjustments in these files, such as for ox_inventory
, ox_lib
, etc.
6 - Installation successful, have a good funs
There are many ox settings available in the files, if you want, you can configure them.
If you want to use ox_lib, please check if this link is enabled on fxmanifest.check it out from inside lua. this must be turned on before you can use ox_lib. After opening it, it will be enough to use the refresh and ensure commands.
Add the following items to your inventory list appropriately.
["blood_evidence"] = {
["name"] = "blood_evidence",
["label"] = "Blood Evidence Bag",
["weight"] = 0,
["type"] = "item",
["image"] = "blood_evidence.png",
["unique"] = true,
["useable"] = true,
["expire"] = nil,
["shouldClose"] = false,
["combinable"] = nil,
["description"] = "An evidence bag with a blood sample inside"
},
["casing_evidence"] = {
["name"] = "casing_evidence",
["label"] = "Casing Evidence Bag",
["weight"] = 0,
["type"] = "item",
["image"] = "casing_evidence.png",
["unique"] = true,
["useable"] = true,
["expire"] = nil,
["shouldClose"] = false,
["combinable"] = nil,
["description"] = "An evidence bag with a casing sample inside"
},
ITEM IMAGES
IMPOTANT STEP!
If you are an ox_inventory
user, please add the following codes to the specified location as shown in the photo
LOCATION : ox_inventory/modules/items/client.lua
Item('blood_evidence', function(data, slot)
local metadata = slot.metadata
if not metadata or not metadata.dnadata then return end
TriggerEvent("wert-evidence:inceleme", slot, metadata.dnadata)
end)
Item('casing_evidence', function(data, slot)
local metadata = slot.metadata
if not metadata or not metadata.dnadata then return end
TriggerEvent("wert-evidence:inceleme", slot, metadata.dnadata)
end)
In the default version, both the old and new versions of ox_inventory
and qb-inventory
are prepared to be compatible. If you are using an additional inventory system, please check the editable_client
and editable_server
files and adjust functions like weapon serial numbers and item usage according to the inventory you are using.
Config = {}
Config.UseTarget = true
Config.DebugPoly = false
Config.OxLib = true
Config.OxInventory = true
Config.InventoryImagesFileExtansion = "ox_inventory/web/images" -- For the ox inventory : ox_inventory/web/images
Config.UseInventoryImagesForWeapons = true -- If u set false this settings script check `Config.CustomWeaponImages`
Config.CustomWeaponImages = {
-- ['item_name'] = 'url',
}
Config.BloodExampleHealtCheck = 10 -- Leave a blood sample when the player's health value decreases by 10.
-- Data older than 7 days is deleted, thus providing data optimization on the database side.
-- If you don't want any data to be deleted, you can set the active value to false below.
Config.DatabaseExpireSystem = {
active = true,
cleartime = 7, -- Day so now (7 Day)
}
Config.UIEvidenceListCount = 25 -- For example list the last 25 evidence if u want edit here. must > 1
Config.BloodEvidenceItem = "blood_evidence"
Config.CasingEvidenceItem = "casing_evidence"
-- If you want to differentiate between different bullet casings more easily, you can enable this setting.
-- It adds the last 3 (count in config) characters of the casing's serial number data to the end of the interaction text.
-- Example: For a casing evidence with the serial number '1gs5lew83gmb', the displayed interaction text would be [H] Collect (gmb). Additionally, you can set the location through the lang file if you want.
Config.AddIntoInteractionTextSerialLastChars = {
active = true,
where = 'left', -- 'left', 'right' (Should the last three characters or the first three characters be displayed?)
count = 3,
clearshow = true, -- Should it also appear in shell casing cleanup interactions?
}
Config.Microscopes = {
{
coord = vector3(483.55, -988.56, 30.69),
heading = 268.23,
sizeA = 0.7,
sizeB = 0.7,
minZ = 30.19,
maxZ = 31.4,
distance = 1.5,
job = {["police"] = 3}, -- | [job] = grade | ıf u dont want any job requied set nil or remove this data row
-- !IMPORANT
-- * Each microscope have special examine position (Use evidence item and start examine)
evidence_examine_zone = {
zone_type = 'box', -- 'poly', 'circle', 'box'
zone = {
-- Box zone example
coord = vector3(482.65, -988.65, 30.69),
length = 0.8,
width = 1.0,
heading = 0,
-- # Other zone types examples : 'poly'
-- Poly zone example
--[[ coord = {
vector2(483.58633422852, -988.39764404297),
vector2(482.42684936523, -988.2783203125),
vector2(482.35827636719, -989.03393554688),
vector2(483.83999633789, -989.17694091797)
}, ]]
-- Circle zone example 'circle'
--[[ coord = vector3(482.68, -988.66, 30.69),
size = 0.5, ]]
-- info : The multi-zone type setting has been made to make the position that players should be in to examine the evidence more realistic.
},
-- Required fixed settings
minZ = 29.5,
maxZ = 32.5
}
},
}
Config.SystemTargets = {
{
coord = vector3(485.5108, -989.370, 30.689),
heading = 1.92,
sizeA = 0.7,
sizeB = 0.7,
minZ = 29.69,
maxZ = 31.69,
distance = 1.5, -- If u select no use target it check this distance
icon = "fas fa-desktop",
job = {["police"] = 0}, -- | [job] = grade | ıf u dont want any job requied set nil or remove this job data row
},
}
-- !IMPORTANT : The jobs that we have added to this table can collect the evidence that falls with the light for later examination.
-- The jobs that are outside of this can clean them up to destroy them.
Config.CollectJobs = {
police = true,
ambulance = true,
}
-- # Note access (Jobs and ranks that will have the direct authority to edit and delete grades)
-- In addition, the person who created the report has these permissions, and you can change it from the x setting below
Config.NoteCreatorPermission = true
Config.NoteStuffs = {
police = 4, -- Chief (Boss) This is minimum grade level
ambulance = 4, -- Chief (Boss) This is minimum grade level
}
-- # Interaction settings
Config.CollectOrClearKey = 74 -- https://docs.fivem.net/docs/game-references/controls/
Config.EvidenceSampleRenderDistance = 20.0
Config.CollectOrClearInteractionDistance = 0.5 -- For show text and press key action distance
Config.UseCone = true
Config.UseBloodParticle = true -- If u set false script auto check `Config.NoBloodParticleInteraction`
Config.UseBulletParticle = true -- If u set false script auto check `Config.NoBulletParticleInteraction`
Config.CollectOrClearInteraction = 'wertui' -- 'textui' , 'drawtext' , 'wertui'
Config.NoBloodParticleInteraction = 'marker' -- 'marker' , 'circle'
Config.NoBulletParticleInteraction = 'marker' -- 'marker' , 'circle'
Config.DrawTextZOffset = 0.9
Config.WertUiZOffset = 0.4
Config.DrawBulletParticleOutline = {
active = true,
color = {255, 0, 0, 0} -- rgba
}
Config.BloodCircleSetting = {
zplusoffset = 0.8,
r = 37,
g = 88,
b = 74,
a = 0.38
}
Config.BulletCircleSetting = {
zplusoffset = 0.8,
r = 37,
g = 88,
b = 74,
a = 0.38
}
Config.BloodMarkerSetting = {
type = 28,
zoffset = 0.6,
scale = {0.1, 0.1, 0.1},
rgba = {224, 17, 17, 185},
bobUpAndDown = false,
faceCamera = true,
param = 2,
rotate = false,
textureDict = false,
textureName = false,
drawOnEnts = false
}
Config.BulletMarkerSetting = {
type = 27,
zoffset = 0.8,
scale = {0.2, 0.2, 0.2},
rgba = {17, 64, 224, 185},
bobUpAndDown = false,
faceCamera = true,
param = 2,
rotate = false,
textureDict = false,
textureName = false,
drawOnEnts = false
}
-- # Target Icons
Config.WearGloveTargetIcon = "fas fa-mitten"
Config.RemoveGloveTargetIcon = "fas fa-mitten"
Config.ChangeGloveTargetIcon = "fas fa-mitten"
-- # Glove settings
Config.GloveClothingSystem = 'default' -- Values : 'default', 'fivem-appearance', 'illenium-appearance' | !IMPORTANT you can access more detailed codes from editable_client.lua
-- Glove component id, if u use another comp type for gloves u can change here
Config.GloveComponentId = 3
-- Gloves are a life system. How many examinations can he do with one glove.
-- For example, currently 1. If he makes 1 examination, he will have to wear a new glove to make a different examination.
Config.GloveExamineCount = 1
-- Each ped model have different clothes (slots), so we make detailed settings here for this
Config.GloveTextures = {
[`mp_m_freemode_01`] = {drawableId = 85, textureId = 0, paletteId = 2},
[`mp_f_freemode_01`] = {drawableId = 98, textureId = 0, paletteId = 2},
}
-- # Progressbar Times
Config.ProgressTimes = {
examine = 5000,
change_glove = 3000,
wear_glove = 3000,
remove_glove = 3000,
collect_evidence = 5000,
collect_package = 3000,
examine_prepare = 3000,
}
-- # Animation Settings
Config.AnimationSettings = {
insystem = {
dict = "mp_prison_break",
clip = "hack_loop",
flag = 49,
},
examine = {
dict = "anim@amb@board_room@supervising@",
clip = "dissaproval_01_lo_amy_skater_01",
flag = 48,
},
wearglove = {
dict = 'nmt_3_rcm-10',
clip = 'cs_nigel_dual-10',
flag = 48,
},
removeglove = {
dict = 'nmt_3_rcm-10',
clip = 'cs_nigel_dual-10',
flag = 48,
},
changeglove = {
dict = 'nmt_3_rcm-10',
clip = 'cs_nigel_dual-10',
flag = 48,
},
collect_evidence = {
dict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@',
clip = 'machinic_loop_mechandplayer',
flag = 1,
},
collect_package = {
dict = 'missfam4',
clip = 'base',
flag = 51,
-- Prop settings
pos = vec3(0.16, 0.08, 0.1),
rot = vec3(-130.0, -50.0, 0.0),
bone = 36029
},
examine_prepare = {
dict = 'missfam4',
clip = 'base',
flag = 51,
-- Prop settings
pos = vec3(0.16, 0.08, 0.1),
rot = vec3(-130.0, -50.0, 0.0),
bone = 36029
},
}
-- # No Target Keys
Config.NoTargetSystemInteractionKey = 38
Config.NoTargetMicroscopeWearGloveKey = 38
Config.NoTargetMicroscopeRemoveGloveKey = 38
Config.NoTargetMicroscopeChangeGloveKey = 58
local ESX = exports["es_extended"]:getSharedObject()
local currentWeapon = {}
function CustomNotifVariation(text, style, time)
ESX.ShowNotification(text, style or 'info', time or 3000)
end
function ShowTextUI(text)
if Config.OxLib then
lib.showTextUI(text, {position = 'left-center'})
else
-- Custom text ui
-- If u want use another addon script you need add export or call code here
end
end
function HideTextUI()
if Config.OxLib then
lib.hideTextUI()
else
-- Custom text ui
-- If u want use another addon script you need add export or call code here
end
end
function AppearanceGetPedComponents()
local ped = PlayerPedId()
if Config.GloveClothingSystem == 'default' then
local result = GetPedDrawableVariation(ped, Config.GloveComponentId)
return result
elseif Config.GloveClothingSystem == 'fivem-appearance' then
local result = exports["fivem-appearance"]:getPedComponents(ped)
return result
elseif Config.GloveClothingSystem == 'illenium-appearance' then
local result = exports["illenium-appearance"]:getPedComponents(ped)
return result
end
-- If u use another system for special. U can edit here
end
function AppearanceSetPedComponents(oldtexture)
local ped = PlayerPedId()
if Config.GloveClothingSystem == 'default' then
SetPedComponentVariation(ped, Config.GloveComponentId, oldtexture, 0, 0)
elseif Config.GloveClothingSystem == 'fivem-appearance' then
exports["fivem-appearance"]:setPedComponents(ped, oldtexture)
elseif Config.GloveClothingSystem == 'illenium-appearance' then
exports["illenium-appearance"]:setPedComponents(ped, oldtexture)
end
-- If u use another system for special. U can edit here
end
function DnaGetPlayerImage()
-- If you have another picture data edit this code please
-- You need add get image code here from ur other any script
return nil
end
function WertDrawText3D(x, y, z, text)
-- Use local function instead
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextEntry('STRING')
SetTextCentre(true)
AddTextComponentString(text)
SetDrawOrigin(x, y, z, 0)
DrawText(0.0, 0.0)
local factor = (string.len(text)) / 370
DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
ClearDrawOrigin()
end
function CustomTargetAddBoxZone(data)
exports["qb-target"]:AddBoxZone(data[1], data[2], data[3], data[4], data[5], data[6])
end
function CustomProgressbar(data, cb)
if Config.OxLib then
if lib.progressBar({
duration = data.time,
label = data.label,
useWhileDead = false,
canCancel = true,
disable = {
move = data.move,
combat = data.combat,
mouse = data.mouse,
car = data.car,
},
anim = data.anim,
prop = data.prop,
}) then
cb('true')
else
cb('false')
end
else
-- If u want use any other custom progressbar u can add export here like this
-- This progressbar : https://github.com/qbcore-framework/progressbar
if data.anim then
data.anim.animDict = data.anim.dict
data.anim.anim = data.anim.clip
data.anim.flags = data.anim.flag
end
if data.prop then
data.prop.coords = data.prop.pos
data.prop.rotation = data.prop.rot
end
Progressbar(data.id, data.label, data.time, false, true, {
disableMovement = data.move,
disableCarMovement = data.car,
disableMouse = data.mouse,
disableCombat = data.combat,
}, data.anim or {}, data.prop or {}, {}, function()
cb('true')
end, function()
cb('false')
end)
end
end
function CustomOxInventoryGetWeapon()
local my_weapon = exports.ox_inventory:getCurrentWeapon()
local wepname = my_weapon.name
local serial = my_weapon.metadata and my_weapon.metadata.serial or nil
local image = nil
if Config.UseInventoryImagesForWeapons then
image = 'nui://' .. Config.InventoryImagesFileExtansion .. '/' .. wepname .. '.png'
else image = Config.CustomWeaponImages[wepname] end
return {serial = serial, image = image}
end
function CustomInventoryGetWeapon()
-- QB Inventory
local serial = nil
local image = nil
if currentWeapon then
serial = currentWeapon.info and currentWeapon.info.serie or nil
local wepname = currentWeapon.name
if wepname then
if Config.UseInventoryImagesForWeapons then
local itemInfo = QBCore.Shared.Items[wepname]
if itemInfo and itemInfo.image then image = 'nui://' .. Config.InventoryImagesFileExtansion .. '/' .. itemInfo.image end
else image = Config.CustomWeaponImages[wepname] end
end
end
return {serial = serial, image = image}
end
-- Event
-- New qb inventory and weapons merge
RegisterNetEvent('qb-weapons:client:UseWeapon', function(data, shotbool)
if data then
currentWeapon = data
else
currentWeapon = {}
end
end)
-- Old qb inventory and weapons merge
RegisterNetEvent('inventory:client:UseWeapon', function(data, shotbool)
if data then
currentWeapon = data
else
currentWeapon = {}
end
end)
-- Custom : If u have another system u can add event or export so u can make settings for all!
local ESX = exports["es_extended"]:getSharedObject()
function GetPlayerFullName(src, ply)
if not ply then return LANG.examiner_not_found end
local identifier = ply.getIdentifier()
local response = MySQL.query.await('SELECT `firstname`, `lastname` FROM `users` WHERE `identifier` = ?', {identifier})
if response and response[1] then
local fullname = response[1].firstname .. ' ' .. response[1].lastname
return fullname
else
return ply.getName()
end
end
function GetPlayerJobNameAndGrade(src, ply)
if not ply or not ply.job then return {LANG.examiner_not_job_label, LANG.examiner_not_job_grade} end
local job = ply.job.name or 'Unemployed'
local grade = ply.job.grade_label or 'Civilian'
local level = ply.job.grade or 0
level = tonumber(level)
return {job, grade, level}
end
function GetPlayerGender(src, ply)
if not ply then return LANG.gender_male end
local identifier = ply.getIdentifier()
local gender = MySQL.scalar.await('SELECT `sex` FROM `users` WHERE `identifier` = ? LIMIT 1', {identifier})
if gender and gender == 'm' then
return LANG.gender_male
else
return LANG.gender_female
end
end
function UpdateNoteForAll(src, id)
if not id then return end
local players = ESX.GetPlayers()
for k,v in pairs(players) do
local xPlayer = ESX.GetPlayerFromId(v)
if xPlayer and src ~= xPlayer.source then
TriggerClientEvent('wert-evidence:client:notes-updated', xPlayer.source, tonumber(id))
end
end
end
function GetLabTechnicers(data)
local count = 0
local MergeTable = data
local players = ESX.GetPlayers()
for k,v in pairs(players) do
local xPlayer = ESX.GetPlayerFromId(v)
if xPlayer and xPlayer.job then
local job_name = xPlayer.job.name or 'unemployed'
local job_grade = xPlayer.job.grade or 0
local get_data = MergeTable[job_name]
local get_grade = tonumber(job_grade)
if get_data and get_grade >= get_data then
count = count + 1
end
end
end
return count
end
function CustomAddItem(src, data)
local ply = ESX.GetPlayerFromId(src)
if not ply then return end
-- info : data.data
ply.addInventoryItem(data.item, data.count)
end
function CustomRemoveItem(src, item, count, slot)
local ply = ESX.GetPlayerFromId(src)
if not ply then return end
-- If ur remove function support slot please use it for correct result
ply.removeInventoryItem(item, count)
end
-- # Item Functions
-- Ox inventory item installs please check documents. Documents adress in README.md
if not Config.OxInventory then
-- If u another inventory u must need add item use callbacks like this with infos
--[[ QBCore.Functions.CreateUseableItem(Config.BloodEvidenceItem, function(source, item)
if item and item.info and item.info.dnadata then
TriggerClientEvent("wert-evidence:inceleme", source, item, item.info.dnadata)
end
end)
QBCore.Functions.CreateUseableItem(Config.CasingEvidenceItem, function(source, item)
if item and item.info and item.info.dnadata then
TriggerClientEvent("wert-evidence:inceleme", source, item, item.info.dnadata)
end
end) ]]
end
LANG = {
putbag = "Sample put in evidence bag",
notgloves = "You don't have medical gloves!",
changegloves = "You should change your gloves!",
upload = "Data is uploaded to the system",
gloveschanged = "Gloves changed",
weargloves = "Gloves weared",
removegloves = "Gloves removed",
examine = "Examine",
change_glove = "Gloves changing...",
wear_glove = "Gloves wearing...",
remove_glove = "Gloves removing...",
collect = "[H] Collect",
clear = "[H] Clear",
collecting = "Collecting..",
clearing = "Clearing...",
notusearea = "You cannot do this here, find a microscope",
glovesclean = "Your Gloves Clean!",
wear_glove_label = "Wear Gloves",
remove_glove_label = "Remove Gloves",
open_system_label = 'Evidence System',
weapon_serialno_not_found = 'Unknown',
change_glove_label = 'Change Gloves',
wertui = {
key = 'H',
collect = 'Collect',
clear = 'Clear',
},
process_cancelled = 'Cancelled!',
evidence_not_found = 'No evidence found, it could have been collected or cleaned up!',
collect_package = 'The bag is being closed ...',
examine_prepare = 'The Evidence Is Opening Up ...',
examiner_not_found = 'Unknown',
examiner_not_job_label = 'Civilian',
examiner_not_job_grade = 'Freelancer',
gender_male = 'Male',
gender_female = 'Female',
dna_line_description = 'Blood evidence details are here',
dna_line_match = 'Match',
dna_line_stuff = 'Lab Technician',
dna_line_job = 'Technician Job',
dna_line_grade = 'Technician Grade',
dna_line_date = 'Review Date',
dna_image_label = 'Suspect Photo',
bullet_image_label = 'Weapon Photo',
bullet_line_description = 'Bullet casign details are here',
bullet_line_match = 'Serial No Match',
bullet_line_stuff = 'Lab Technician',
bullet_line_job = 'Technician Job',
bullet_line_grade = 'Technician Grade',
bullet_line_date = 'Review Date',
notes_label = 'Report Notes (You can add and edit new notes)',
notes_not_found_any_note = 'No previously saved note was found',
create_new_note = 'Create New Note (Report)',
create_subject_label = 'Subject',
create_subject_description = 'Specify a subject heading that indicates what the note or report you want to create is about',
create_subject_placeholder = 'etc. bank robbery',
create_text_label = 'Content',
create_text_description = 'You can write your note or report here in detail',
create_text_placeholder = 'Note or Report here ...',
create_confirm = 'CREATE',
note_edit_header = '%s , Editing in Progress',
note_edit_confirm = 'FINISH',
ui_doc_first = 'Collect and package the blood and bullet evidence found at the crime scene. You are ready to head to the laboratory...',
ui_doc_second = 'Put on your medical gloves in the laboratory and examine the collected evidence under the microscope ...',
ui_doc_thirst = 'The evidence examined under the microscope will be automatically uploaded to the database. After the examination, you can access the database from the laptop to obtain information about the evidence.',
ui_last_evidence = '%s have passed since the last examination',
ui_last_evidence_not_found = 'Last evidence not found!',
ui_time_min = 'Minute',
ui_time_hour = 'Hour',
ui_time_day = 'Day',
ui_blood_count = 'There are %s blood samples in the system',
ui_bullet_count = 'There are %s bullet casing samples in the system',
ui_labtech_count = 'There are %s active lab technicians!',
ui_last_evidence = 'The last piece of evidence was uploaded %s ago!',
ui_database_button_info = 'You can continue to the database using the button below, and you can also refresh the database using the quick button located at the top right',
ui_continue_database = 'Database',
no_target_system_interaction_label = '[E] Evidence System',
no_target_microscope_interaction_label = '[E] Wear Gloves',
no_target_microscope_interaction_label_two = '[E] Remove Gloves \n [G] Change Gloves',
ui_refresh_note_error_header = 'Notes Not Found!',
ui_refresh_note_error_description = 'Notes for this report could not be uploaded.',
ui_load_dna_error_header = 'Dna Not Loaded!',
ui_load_dna_error_description = 'The dna data could not be uploaded. It must have been deleted or expired!',
ui_load_bullet_error_header = 'Bullet Not Loaded',
ui_load_bullet_error_description = 'The bullet data could not be uploaded. It must have been deleted or expired!',
ui_edit_error_header = 'Edit Failed!',
ui_edit_error_description = 'The note requested to be edited could not be found! It must have been deleted or lost!',
ui_create_not_failed_header = 'Create Action Failed!',
ui_create_not_failed_description = 'The note could not be created please try again later!',
ui_delete_failed_header = 'Delete Action Failed!',
ui_delete_failed_description = 'The note you want to delete has not been deleted, it may already have been deleted!',
ui_edit_button_error_header = 'Cannot Be Edited',
ui_edit_button_error_description = 'The note you wanted to edit was not found!',
ui_main_dna_button = 'BLOOD EVIDENCE',
ui_main_bullet_button = 'BULLET EVIDENCE',
main_category_select = 'SELECT A CATEGORY',
main_not_found_any_data = 'NOT FOUND ANY DATA!',
ui_load_data_error_ammo_header = 'Data Not Found!',
ui_load_data_error_ammo_description = 'No bullet casing evidence report has been uploaded, or the data may have expired!',
ui_load_data_error_dna_header = 'Data Not Found!',
ui_load_data_error_dna_description = 'No blood evidence report has been uploaded, or the data may have expired!',
ui_create_not_success_header = 'Note Created!',
ui_create_not_success_description = "Note successfully created. You can follow the menu for editing and deleting options.",
ui_delete_note_succes_header = 'Note Deleted!',
ui_delete_note_succes_description = "Note successfully deleted.",
ui_edit_note_success_header = 'Note Edited!',
ui_edit_note_success_description = "Note successfully edited.",
ui_blood_evidence = 'BLOOD EVIDENCE',
ui_bullet_evidence = 'BULLET EVIDENCE',
ui_welcome_fullname = '%s , Welcome',
ui_welcome_evidence_title = 'LSPD Evidence Systems',
}