[Release-Archived] Cops FiveM

It automatically sets up a db when you start your server… if you keep having the problem, reset your database and restart your server

Make sure that you have ghmattimysql installed and configured with the correct information as your database

Ghmattimysql is installed correctly for all I know and I also installed mysql with the database working for all I know. Not quite sure what im doing wrong and were. If there is a video or something out there I could follow as it can assist me were I might be doing wrong. Thanks

Hey dose anyone know were i can find this clock in script at

A new update has been pushed to Github

Anyone gotten this to work poperly for ESX?

I am getting this error after setting up my database

AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
Error: (node:128) 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(). (rej
ection id: 1)

Error: (node:128) [DEP0018] DeprecationWarning: Unhandled promise rejections are
 deprecated. In the future, promise rejections that are not handled will termina
te the Node.js process with a non-zero exit code.

This script is a standalone script, it doesn’t interact with other frameworks.
Besides of that ESX has their own police script.

nice:))

It looks like your setup from ghmattimysql isn’t correct.

Download the latest release from ghmattimysql
https://github.com/GHMatti/ghmattimysql/releases/download/1.2.1/ghmattimysql.zip

change your credentials in config.json

once that is done open server.cfg and add start ghmattimysql above start police

start ghmattimysql
start police

Thats what I have, am I possibly setting up the user and database wrong?

mysql.exe -u root -p
(password)

CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'fivem'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES;

quit
mysql -u fivem -p
password

CREATE DATABASE 'fivem';
quit

then my config.json looks like:

{
    "user": "fivem",
    "password": "password",
    "host": "localhost",
    "port": 3306,
    "database": "fivem",
    "connectionLimit": 10,
    "dateStrings": true
}

i just verified it with a fresh fivem-server setup and these resources:

# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure ghmattimysql
ensure police

but i couldn’t replicate your issue :frowning:

Oh wait do I have to ensure the resources instead of starting them?

nevermind that didn’t work

It’s saying that it can’t create tables, is there anything else I need to do besides grant all privileges?

AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
e[31m[ERROR] [MySQL] [police] An error happens on MySQL for query "CREATE TABLE
IF NOT EXISTS `police` (`identifier` varchar(255) COLLATE utf8_unicode_ci NOT NU
LL,`dept` int(11) NOT NULL DEFAULT '0',`rank` int(11) NOT NULL DEFAULT '0') : []
": ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol r
equested by server; consider upgrading MySQL cliente[0m


So I a getting this error, does anyone know what to do

Is there anyway to make the uniforms EUP?

I had this message but got it fixed. After I had my database and everything, I had opened HeidiSQL and litterly went the accounts and changed my password for the database. Apparently there was no password set meaning every time it gave me this message. You will have to go to the file for the police script, think its called config… But go back into there after and make sure you put the password, database, and all the rest of the information in there! Seems to work!

I verified that the password for the database is correct, yet I’m still recieving that exact same error

I keep getting an error when I launch the server that there is no police export execute in ghmattimysql That is literally the only error I am getting and the rest of the install went fine.

“Error loading script server/server.lua in resource police: citizen:/scripting/lua/scheduler.lua:712: No such export execute in resource ghmattimysq”

Update I fixed the last error because my __resource file was not right. I am now however having this error: “Error: (node:65476) UnhandledPromiseRejectionWarning: Error: Handshake inactivity timeout
at Handshake. (ghmattimysql.js:308:3165”

EVERYTHING looks awesome I’ve adjusted Clock-In locations including markers!

STILL one current bug: FORCE player into vehicle does not work (they hop right back out) - One must use PUT player into vehicle for them to stay

ALSO (cuffed prisoners can BAIL out of a moving police car haha)