[Outdated] [Release] Simple Police System [SQL] (Menu, Jail & Much more!)

How do I fix this ive tried about everything i know to do

AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
[ERROR] [MySQL] [police-system-1.2] An error happens on MySQL for query "[object
 Object]": ER_BAD_DB_ERROR: Unknown database 'fxserver'
Error: (node:3892) UnhandledPromiseRejectionWarning: Error: ER_BAD_DB_ERROR: Unk
nown database 'fxserver'
    at Handshake.Sequence._packetToError (mysql-async.js:244:14)
    at Handshake.ErrorPacket (mysql-async.js:12834: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 Protocol._enqueue (mysql-async.js:5807:48)
    at Protocol.handshake (mysql-async.js:5714:23)
    at PoolConnection.connect (mysql-async.js:720:18)
    at Pool.getConnection (mysql-async.js:4577:16)
    at Pool.query (mysql-async.js:4731:8)
    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:87:41
Error: (node:3892) 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(). (re
jection id: 75)
Uncaught AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
internal/errors.js(102,11): AssertionError
assert.js(42,9): innerFail
assert.js(56,3): fail
internal/process/promises.js(27,25):
mysql-async.js(4973,13): db.query
mysql-async.js(280,24): Sequence.end
mysql-async.js(4734,13):
mysql-async.js(4587,9): onConnect
mysql-async.js(280,24): Sequence.end
mysql-async.js(12836,8): Handshake.ErrorPacket

Try mysql-async c# version.
https://github.com/brouznouf/fivem-mysql-async/tree/2.0

is this for ESX or FX or both?

does anyone know how this works in phpMyAdmin i have set up the database but i am unable to edit the ranks.

So i did what you said and now i get this…

[ERROR] [MySQL] An error happens on MySQL for query “SELECT * FROM police WHER
E identifier = @identifier {@identifier=steam:1100001071593f2}”: Unknown datab
ase ‘fxserver’

Hello, where can I find the database so I can give myself a higher rank? Such as an Admin.

Thank you.

Make sure you have named the database fxserver, because it is not detecting your’s

I have it named the exact same im not sure why it cannot find it

well i fixed that but now i have another error check my latest post please.

well its me again I have this issue

dont think your code is wrong, i have verified it a few time on different mysql verified. any help would be nice

does this with the c# script too

Well in the error it states ‘mysql-async.js’ so you are still using the JS version.

I cant edit my rank in the database and wont give me confirmation to try to add me as admin

Hey how do i run the SQL file?

You import it in to the database.

I have tried everything with this script and i still cant get it to work with zap, i get no errors, i can make the data base work, i join the game it makes the table and adds all the identifiers and ranks i change them to 2 and still nothing happens in-game. any suggestions ?

screen shot is the js version, i then tried c# and got nothing

Did you figure it out? it took me a while also. i can help if so

1 Like

No worries, I am going to make a video on YouTube in a few days, explaining how to install this resource. :slight_smile:

Thank you, it would help

try out the scrip and loving it, one thing that i suggest is that the spikes disappear once there a run over to avoid other car AKA police who are chase said subject from run over the spikes

1 Like

hmm, I added this to my server and SQL, didnt get any errors, changed my rank to “2,” and F5 doesn’t do anything. I know I am putting the rank on my steam HEX. I even tried changing the keybind in the client.lua, and changing my database, with no avail. Weird thing is that I’m not getting any errors. Anyone else having this issue?
Thanks