tanguyortegat / esx_jb_radars Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
[ERROR] [MySQL] An error happens on MySQL for query "INSERT INTO billing (identifier, sender, target_type, target, label, amount) VALUES (@Identifier, @sender, @target_type, @target, @Label, @amount) {@target_type=society;@amount=1500;@sender=Radar fixe;@target=society_police;@Label=📸:plaque XKY 125 , 120 km/h a la place de 80.0;@Identifier=steam:110000135c08c7e}": Incorrect string value: '\xF0\x9F\x93\xB8:p...' for column zap423737-5
.billing
.label
at row 1
Merci de vos réponse.
Bonsoir
Est-ce normal que après configuration je n'ai plus aucune notifs de radar ni de paiement
(aucune erreur dans les consoles)
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
local jobplates = {}
AddEventHandler('onMySQLReady', function ()
MySQL.Async.fetchAll(
"SELECT name FROM jobs", {}, function(result)
for k,v in pairs(result) do
local job = string.upper(string.sub(v.name, 0, 4))
jobplates[job] = true
end
end
)
end)
RegisterServerEvent('esx_jb_radars:PayFine')
AddEventHandler('esx_jb_radars:PayFine', function(source, plate, kmhSpeed, maxSpeed, amount, vehicleModel, radarStreet)
local platePrefix = string.upper(string.sub(plate, 0, 4))
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local color = Config.orange
local title = "Radars"
local speed = kmhSpeed - maxSpeed
local firstjob = string.upper(string.sub(xPlayer.job.name, 0, 4))
MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE @plate = plate', {
['@plate'] = plate
}, function (result)
if result[1] ~= nil then
title = 'Vehicule inconnu'
local identifier = result[1].owner
MySQL.Async.execute('INSERT INTO billing (identifier, sender, target_type, target, label, amount) VALUES (@identifier, @sender, @target_type, @target, @label, @amount)',
{
['@identifier'] = identifier,
['@sender'] = "Radar fixe",
['@target_type'] = 'society',
['@target'] = 'society_police',
['@label'] = ("plaque %s,flashé à %skm/h~n~au lieu de %skm/h"):format(plate, kmhSpeed, maxSpeed),
['@amount'] = amount
}, function(rowsChanged)
TriggerClientEvent('esx:showNotification', _source, "Votre véhicule "..plate.." a été flashé à ~r~"..kmhSpeed.."km/h~s~ au lieu de ~g~"..maxSpeed.."km/h~s~")
end)
elseif jobplates[platePrefix] then
title = 'Vehicule société'
if firstjob == platePrefix then
MySQL.Async.execute('INSERT INTO billing (identifier, sender, target_type, target, label, amount) VALUES (@identifier, @sender, @target_type, @target, @label, @amount)',
{
['@identifier'] = xPlayer.identifier,
['@sender'] = "Radar fixe",
['@target_type'] = 'society',
['@target'] = 'society_police',
['@label'] = "plaque société "..plate..", "..kmhSpeed.."km/h ~n~ au lieu de "..maxSpeed,
['@amount'] = amount
}, function(rowsChanged)
TriggerClientEvent('esx:showNotification', _source, "Votre véhiculede société "..plate.." a été flashé à "..kmhSpeed.."km/h au lieu de "..maxSpeed.."km/h~s~" )
end)
end
else
title = 'Vehicule inconnu'
end
if speed <= 50 then
color = Config.green
elseif speed <= 100 then
color = Config.orange
elseif speed > 100 then
color = Config.red
end
sendToDiscord('Central:Excès de vitesse',title,'Modele : '..vehicleModel..'\nPlaque : '..plate..'\nVitesse : '..kmhSpeed.. '\nVitesse max : '..maxSpeed..'\nRadar : '..radarStreet ,color)
end)
end)
local IsEnabled = false
ESX.RegisterUsableItem('coyotte', function(source)
local _source = source
if not IsEnabled then
IsEnabled = true
TriggerClientEvent('esx_jb_radars:ShowRadarBlip', _source)
TriggerClientEvent('esx:showNotification',_source, "Ton coyotte est activé.")
else
TriggerClientEvent('esx_jb_radars:RemoveRadarBlip', _source)
TriggerClientEvent('esx:showNotification', _source, "Ton coyotte est désactivé.")
IsEnabled = false
end
end)
RegisterServerEvent('esx:onRemoveInventoryItem')
AddEventHandler('esx:onRemoveInventoryItem', function(source, item, count)
if item.name ~= nil and item.name == 'coyotte' and item.count == 0 then
IsEnabled = false
TriggerClientEvent('esx_jb_radars:RemoveRadarBlip', source)
TriggerClientEvent('esx:showNotification', source, "Ton coyotte est désactivé.")
end
end)
function sendToDiscord(name,message,text,color)
local DiscordWebHook = Config.webhook
-- Modify here your discordWebHook username = name, content = message,embeds = embeds
local embeds = {
{
["title"]=message,
["description"]=text,
["type"]="rich",
["color"] =color,
["footer"]= {
["text"]= os.date("%d/%m/%Y %H:%M:%S"),
},
}
}
if message == nil or message == '' then return FALSE end
PerformHttpRequest(DiscordWebHook, function(err, text, headers) end, 'POST', json.encode({ username = name,embeds = embeds}), { ['Content-Type'] = 'application/json' })
end
function dump(o, nb)
if nb == nil then
nb = 0
end
if type(o) == 'table' then
local s = ''
for i = 1, nb + 1, 1 do
s = s .. " "
end
s = '{\n'
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
for i = 1, nb, 1 do
s = s .. " "
end
s = s .. '['..k..'] = ' .. dump(v, nb + 1) .. ',\n'
end
for i = 1, nb, 1 do
s = s .. " "
end
return s .. '}'
else
return tostring(o)
end
end
@esx_jb_radars/esx_jb_radars_sv.lua:76: in main chunk)
``` j'ai cette erreur a chaque reboot ce qui m'oblige a restart le script pour le faire fonctionner
does not skip the warning by radar voice and I have everything properly installed
Bonjour,
Le soucis que j'ai, est que j'ai un serveur five M et quand je met le script esx_js_radars et que je le start dans le serveur.cfg, c'est que quand je démarre le serveur et que je vais dessus et bah il n'y a aucun radars. est ce qu'il faut un autre script avec ou pas comment bien le configure.
Moi je le place dans serveur-data, ressources, et dans [esx].
Svp besoin d'aide
Merci
salut , tu pourrais m'expliquer comment changer le montant des amendes car elles sont trop eleve :')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.