[Release] [ESX] [Police Job]

Would you mind giving me a hand? I’ve been doing code for a long time and I do not have the key, it’s what it takes to be a novice XD

Thanks :stuck_out_tongue:

lol, Sure let me get it.

function OpenBuyWeaponsMenu()
	local playerPed = PlayerPedId()
	PlayerData = ESX.GetPlayerData()

	for k,v in ipairs(Config.AuthorizedWeapons[PlayerData.job.grade_name]) do
		GiveWeaponToPed(playerPed, GetHashKey(v.weapon), 999999, false, false)
		ESX.ShowNotification(_U('weapon_equipped'))
	end
end

I think I need some new eyes or rest and keep learning, but I think I’m missing something essential for the code to work, since I did copy and paste in a policejob that I have tests and remains the same. Here the error and the code that gives error

Code

for k,v in ipairs(Config.AuthorizedWeapons[PlayerData.job.grade_name]) do

The error you have is caused by a new version of es_extended, simply revert to another/older version of es_extended to open the armory again.

Hello, I created a server Fivem for my children.
Everything works, except that I would like to have notifications of NPCs as a policeman when there are shots etc…

Could you help me please?

That’s not really something that I have seen in fivem as the majority of people want to interact with other players on the server and roleplay now with that being said I would recommend [Release] Police Interaction Script
Or LSPDFR

Thank you.
I’ll see about that.

How would I set the ammo to unlimited in the armory?

It’s been a long time since I’ve been involved with FiveM, when I was here previously we didn’t use the police job cloakroom. We used another separate menu like lambda or something to change PEDs.

How can i turn off EnableSocietyOwnedVehicles? This function is removed but i dont want that my citizen owns police vehicles

Which esx vehiclelock scriot do you have ?

Hello guys i get this error… can you help me?

iknow that this is the problem amersfoortrp.owned_vehicles but how can i solve that?

[ERROR] [MySQL] [esx_policejob] An error happens on MySQL for query "[object Object]": ER_NO_SUCH_TABLE: Table 'amersfoortrp.owned_vehicles' doesn't exist
Error: (node:5464) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
    at process.<anonymous> (internal/process/promises.js:27:25)
    at <anonymous>
    at Query.db.query [as _callback] (mysql-async.js:4973:13)
    at Query.Sequence.end (mysql-async.js:280:24)
    at Query.ErrorPacket (mysql-async.js:2122:8)
    at Protocol._parsePacket (mysql-async.js:5941:23)
    at Parser.write (mysql-async.js:6198:12)
    at Protocol.write (mysql-async.js:5701:16)
    at Socket.<anonymous> (mysql-async.js:693:28)
    at emitOne (events.js:116:13)
Error: (node:5464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Error: (node:5464) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error: (node:5464) UnhandledPromiseRejectionWarning: Error: ER_NO_SUCH_TABLE: Table 'amersfoortrp.owned_vehicles' doesn't exist
    at Query.Sequence._packetToError (mysql-async.js:244:14)
    at Query.ErrorPacket (mysql-async.js:2109:18)
    at Protocol._parsePacket (mysql-async.js:5941:23)
    at Parser.write (mysql-async.js:6198:12)
    at Protocol.write (mysql-async.js:5701:16)
    at Socket.<anonymous> (mysql-async.js:693:28)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    --------------------
    at Pool.query (mysql-async.js:4728:23)
    at Promise (mysql-async.js:4970:12)
    at new Promise (<anonymous>)
    at execute (mysql-async.js:4967:26)
    at Object.global.exports [as callback] (mysql-async.js:4993:5)
    at citizen:/scripting/v8/main.js:96:41
Error: (node:5464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

It means this table doesnt exist. The table owned_vehicles in the database amersfoortrp didnt exist

yeah iknow but i dont have any sql file that adds the table? so do you have that one for me?

You need the esx_vehicleshop

1 Like

thanks :slight_smile:

You dont have to disable this option.
This option is for buying cars and put them into a society (as an Boss of a gang you can buy cars for your gang and every car is shared in the gang)

You have to go to your database and delete the policecar from the “vehicles” table

There is no policecar in my vehicles table

Hello guys,

Sorry for my many questions but i have a problem. i stay on the parking from police and i try to spawn my police car but he says this: You cannot afford that vehicle

any one a solution of this problem?

if you can buy the policecar at the vehicleshop then you must have a policecar in vehicles table.

@Amersfoortrp you have not enough money at the account of your society