[Release] [ESX] [Police Job]

You know what your right I don’t think I did that I did it in my test server not in my main, oof I was tired lastnight thanks for the reminder duh :roll_eyes: I’ll check in to it when I get home and report back

Yeah do so!

in what line can i copy the code in main.lua?

It was not that the sql files are in and resource is updated… same error

so if you go in to your mysql/owned_vehicles you have a column named “type”?

look at this i think this is the issue

CREATE TABLE `owned_vehicles` (
	`owner` varchar(22) NOT NULL,
	`plate` varchar(12) NOT NULL,
	`vehicle` longtext,
	`type` VARCHAR(20) NOT NULL DEFAULT 'car',
	`job` VARCHAR(20) NOT NULL,
	`stored` TINYINT(1) NOT NULL DEFAULT '0'

	PRIMARY KEY (`plate`)
);

‘car’, and ‘0’ ?!? should that be there? I don’t think so…

yes they need to be there,

have you tried removing your owned_vehicles table frrom you mysql database and adding a new one?

no I just updated the ones that were added but ill try it.

something is up with that part of the sql

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘(plate)
)’ at line 9

image

the only thing i can se is diffrent is the missing comma on the end of line 10

1 Like

That’s It odd i didn’t really mess around in there around that part just now to deal with this
image
And why its taking my liveries off

function OpenPoliceActionsMenu()
ESX.UI.Menu.CloseAll()

ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'police_actions',
{
    title    = 'Police',
    align    = 'top-left',
    elements = {
        {label = _U('citizen_interaction'),    value = 'citizen_interaction'},
        {label = _U('vehicle_interaction'),    value = 'vehicle_interaction'},
        {label = _U('object_spawner'),        value = 'object_spawner'},
        {label = _U('Vehicle_Extra'),        value = 'Vehicle_Extra'},
        {label = _U('eupmenu'),                value = 'eupmenu'},
        {label = _U('revive player'),       value = 'revive'},
        {label = _U('jail'),                value = 'jail'},
        {label = _U('Criminalrecord'),      value = 'criminalrecords'}
    
    if data2.current.value == 'identity_card' then
OpenIdentityCardMenu(player)

end

    elseif action == 'criminalrecords' then
    TriggerEvent('esx_criminalrecords:open')
    
    
    if data2.current.value == 'jail' then
        JailPlayer(GetPlayerServerId(closestPlayer))
    end

function JailPlayer(player)
ESX.UI.Menu.Open(‘dialog’, GetCurrentResourceName(), ‘jail_menu’, {
title = _U(‘jail_menu_info’),
}, function (data2, menu)
local jailTime = tonumber(data2.value)
if jailTime == nil then
ESX.ShowNotification(‘invalid number!’)
else
TriggerServerEvent(“esx_jail:sendToJail”, player, jailTime * 60)
menu.close()
end
end, function (data2, menu)
menu.close()
end)
end
anyone know what im doing wrong error is start at elements and linking to the if,and elesif

the liveries i think has to do with the new es_exstended update, The NULL name im trying to figure out too, havet found a fix yet

if data2.current.value == ‘jail’ then
JailPlayer(GetPlayerServerId(closestPlayer))
end

change to:

elseif action == ‘jail’ then
JailPlayer(GetPlayerServerId(closestPlayer))

1 Like

line 706 change

      -  modLivery         = GetVehicleMod(vehicle, 48)
     +  modLivery         = GetVehicleLivery(vehicle)

added line 950

SetVehicleLivery(vehicle, props.modLivery)

Have not tried it as of yet, the Null part I believe has to do with custom car names and the car names not being the game names like “police2” or “FBI” I have one named sheriff but others named BCSO1 to BCSO14 and they are all NULL.

the sheriff says sheriff in the garage

Now i remember! To fix the null names you have to add a file into the addon/replace folder you have your cars in which then has the names for the cars, gonna see If i can find it again. The liverypart has not affected me yet because my police cars has a fixed livery which you cant change in game. I do though have a problem which makes me not being able to spawn the cars, just the helicopters,

1 Like

I can spawn cars not heli’s lol the menu flickers when I press E then i get a resource warning

	elements = {
		{label = _U('citizen_interaction'),	value = 'citizen_interaction'},
		{label = _U('vehicle_interaction'),	value = 'vehicle_interaction'},
		{label = _U('object_spawner'),		value = 'object_spawner'},
		{label = _U('Vehicle_Extra'),		value = 'Vehicle_Extra'},
		{label = _U('eupmenu'),				value = 'eupmenu'},
		{label = _U('revive player'),       value = 'revive'},
		{label = _U('jail'),                value = 'jail'},
		{label = _U('Criminalrecord'),      value = 'criminalrecords'}
	
	if data2.current.value == 'identity_card' then
OpenIdentityCardMenu(player)
    end
	
	elseif action == 'criminalrecords' then
	TriggerEvent('esx_criminalrecords:open')
	
	
	elseif action == ‘jail’ then
    JailPlayer(GetPlayerServerId(closestPlayer))
	end

I dont see whats the error it was working finethen i added jail and criminal records and it dont wanna work