Does anyone else have the issue of when you are creating a new report and have selected the suspect name, it then fails to load the charges to select? This issue happens 50% of the time for some people causing us to restart the script. We get no errors on F8 or CMD, its obviously pulling the correct stuff from the database as it works 50% of the time, what am i missing?
I don’t remember if I modified the server stuff, please note that this uses some of the stuff we added to ESX and you’ll have to change it to work on your server.
RegisterServerEvent("mdt:getOffensesAndOfficer")
AddEventHandler("mdt:getOffensesAndOfficer", function()
local ply = ESX.GetPlayerFromId(source)
if ply then
local charges = {}
MySQL.Async.fetchAll('SELECT * FROM fine_types', {
}, function(fines)
for j = 1, #fines do
if fines[j].category == 0 or fines[j].category == 1 or fines[j].category == 2 or fines[j].category == 3 then
table.insert(charges, fines[j])
end
end
TriggerClientEvent("mdt:returnOffensesAndOfficer", ply.source, charges, ply.getPlayerName())
end)
end
end)
Is it possible to add search phone number option? Cuz right now we can search someone to get their phone number but what if we can just search phone numbers to get the owner’s info? Or perhaps we can search numbers in “Search Persons” section.
In sv_mdt.lua, find RegisterServerEvent(“mdt:performOffenderSearch”). Change the MySQL query to
"SELECT * FROM `characters` WHERE LOWER(`firstname`) LIKE @query OR LOWER(`lastname`) LIKE @query OR CONCAT(LOWER(`firstname`), ' ', LOWER(`lastname`)) LIKE @query OR `phone_number` LIKE @query"
Ensure phone_number is stored in the characters table.
It solved! I just changed the characters table to users since there’s no phone_number in my character table. I’m just feel bad that I was going the wrong way since beginning. Thanks alot Linden!
Everything works perfectly fine, having issues with fetching the location when someone triggers the mdt call event. like previous comments, defaulting to 0 0 0