no, it used to be only mysql-async untill i made it work for es_garages and it only works for es_garages currently thats why i included it in the pack, this is meant to be a standalone car system complete with buying storing and saving vehicles
oh and btw guys if you whant the police script to work with the license plates replace
AddEventHandler(āpolice:checkingPlateā, function(plate)
blah
blah
blah
end)
with
AddEventHandler('police:checkingPlate', function(plate)
if(db.driver == "mysql") then
local executed_query = MySQL:executeQuery("SELECT Nom FROM user_vehicle JOIN users ON user_vehicle.identifier = users.identifier WHERE vehicle_plate = '@plate'", { ['@plate'] = plate })
local result = MySQL:getResults(executed_query, { 'Nom' }, "identifier")
if (result[1]) then
for _, v in ipairs(result) do
TriggerClientEvent("police:notify", source, "CHAR_ANDREAS", 1, txt[config.lang]["title_notification"], false, txt[config.lang]["vehicle_checking_plate_part_1"]..plate..txt[config.lang]["vehicle_checking_plate_part_2"] .. v.Nom..txt[config.lang]["vehicle_checking_plate_part_3"])
end
else
TriggerClientEvent("police:notify", source, "CHAR_ANDREAS", 1, txt[config.lang]["title_notification"], false, txt[config.lang]["vehicle_checking_plate_part_1"]..plate..txt[config.lang]["vehicle_checking_plate_not_registered"])
end
elseif(db.driver == "mysql-async") then
MySQL.Async.fetchAll("SELECT * FROM user_vehicle WHERE vehicle_plate = @plate", { ['@plate'] = plate }, function (result)
local isworking = false
local name = " "
--TriggerClientEvent("chatMessage", source, "test ", {255, 0, 0}, " " .. tostring(result) .. " " .. tostring(plate))
for _, v in ipairs(result) do
--TriggerClientEvent("chatMessage", source, "test ", {255, 0, 0}, " " .. tostring(v.id))
for i = 0, 31 do
--if NetworkIsPlayerActive( i ) then
--TriggerClientEvent("chatMessage", source, "test ", {255, 0, 0}, " " .. tostring(v.id))
--local ids = GetPlayerFromServerId(1)
--TriggerClientEvent("chatMessage", source, "test ", {255, 0, 0}, " " .. tostring(v.id))
TriggerEvent('es:getPlayerFromId', i, function(user)
--TriggerClientEvent("chatMessage", source, "test ", {255, 0, 0}, " " .. tostring(v.id))
if user.identifier == v.identifier then
name = GetPlayerName(tonumber(i))
if name ~= " " then
TriggerClientEvent("police:notify", source, "CHAR_ANDREAS", 1, txt[config.lang]["title_notification"], false, txt[config.lang]["vehicle_checking_plate_part_1"]..plate..txt[config.lang]["vehicle_checking_plate_part_2"] .. name..txt[config.lang]["vehicle_checking_plate_part_3"])
else
TriggerClientEvent("police:notify", source, "CHAR_ANDREAS", 1, txt[config.lang]["title_notification"], false, txt[config.lang]["vehicle_checking_plate_part_1"]..plate..txt[config.lang]["vehicle_checking_plate_not_registered"])
end
end
end)
--end
end
--end
end
end)
end
end)
then replace the function CheckPlate() in menupolice.lua with:
function CheckPlate()
local pos = GetEntityCoords(GetPlayerPed(-1))
local entityWorld = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), 0.0, 20.0, 0.0)
local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, GetPlayerPed(-1), 0)
local _, _, _, _, vehicleHandle = GetRaycastResult(rayHandle)
if(DoesEntityExist(vehicleHandle)) then
local plate = GetVehicleNumberPlateText(vehicleHandle)
TriggerServerEvent("police:checkingPlate", plate)
else
drawNotification(txt[config.lang]["no_veh_near_ped"])
end
end