[Help] vehicle mysql

Hello I would like to have the positions of the vehicle on the database.
I have added the variables but nothing to do can you help me thanks in advance.

Bonjour j’aimerais avoir les positions des véhicule sur la base de données
J’ai rajouté les variable mais rien a faire pouvez vous m’aider merci d’avance

local identifier = identifier
local x, y, z = GetVehicleNodePosition(p0)
local rx, ry, rz = GetEntityRotation(playerPed)
if identifier == nil then
local executed_query = MySQL:executeQuery(“INSERT INTO user_vehicle (identifier, vehicle_model, vehicle_plate, vehicle_state, veh_x, veh_y, veh_z, veh_rx, veh_ry, veh_rz) VALUES (’@username’, ‘@vehicle’, ‘@plate’, ‘@state’, ‘@veh_x’, ‘@veh_y’, ‘@veh_z’, ‘@veh_rz’, ‘@veh_ry’, ‘@veh_rz’)”,
{[’@username’] = player, [’@vehicle’] = vehicle, [’@plate’] = plate, [’@state’] = state, [’@veh_x’] = x, [’@veh_y’] = y, [’@veh_z’] = z, [’@veh_rx’] = rx, [’@veh_ry’] = ry, [’@veh_rz’] = rz})
else
local executed_query = MySQL:executeQuery(“UPDATE user_vehicle SET vehicle_model=’@vehicle’, vehicle_plate= ‘@plate’, vehicle_state=’@state’ WHERE identifier = ‘@username’”,
{[’@username’] = player, [’@vehicle’] = vehicle, [’@plate’] = plate, [’@state’] = state})
end

No one to answer?

Personne à la réponse?

AddEventHandler(‘saveposveh’, function(x, y, z)
–local veh_x = tofloat(x)
–local veh_y = tofloat(y)
–local veh_z = tofloat(z)
–local veh_r = tofloat®
x, y, z = tonumber(x), tonumber(y), tonumber(z)

-- Fucking floats.
x = 0.0 + x
y = 0.0 + y
z = 0.0 + z

local executed_query = MySQL:executeQuery("UPDATE user_vehicle SET `veh_x`='@veh_x', `veh_y`= '@veh_y', `veh_z`='@veh_z'",
{['@veh_x'] = x, ['@veh_y'] = y, ['@veh_z'] = z})

end)

Code client

Citizen.CreateThread(function (x, y, z)
while true do
Citizen.Wait(60000) – Modifier cette valeur pour la fréquence des salaires (600000 = 10 minutes)

	TriggerServerEvent('saveposveh', x, y, z)
end

end)

Code server

RegisterServerEvent(‘saveposveh’)
AddEventHandler(‘saveposveh’, function(x, y, z)
–local veh_x = tofloat(x)
–local veh_y = tofloat(y)
–local veh_z = tofloat(z)
–local veh_r = tofloat(r)
x = x
y = y
z = z

local executed_query = MySQL:executeQuery("UPDATE user_vehicle SET `veh_x`='@veh_x', `veh_y`= '@veh_y', `veh_z`='@veh_z'",
{['@veh_x'] = x, ['@veh_y'] = y, ['@veh_z'] = z})

end)