[Release-Archived] Cops FiveM

I have the same problem

can you make a command when we can drag players and put them in the police car when cuffed that would be nice for this

Hi, ty for your cop system.

I have this error:

And this is my server.lua (vdk_recolt)

https://pastebin.com/D5HMcYRe

I have try a manual installation, same problem…

Any idea?

Thanks.

So, the link to es_freeroam is no longer working and is now “fs_freeroam” which uses the new (and broken) Essential-Mode. Any fix for this?

IRemake : check your client logs (F8)

roboticgame : I’ll think about drag player, and atm, you can use /forceEnter to put a player in a police car

crenforce : check you have no NULL value in your database

Skordy : I’ll upload my es freeroam version, thanks for notice that

ok i check it and screen it

Anyone know how I can edit the script so that anybody can add themselves as a cop and not just admins?
(EDITED See below code)
I’ve tried things along the lines of…


TriggerEvent('es:addCommand', 'addcop', function(source, args, user) 
				TriggerEvent("es:getPlayerFromId", source, function(player)
					addCop(player.identifier)
					TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Roger that !")
					TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Congrats, you're now a cop !")
					TriggerClientEvent('police:nowCop', player)
				end)
end)

I think it gets stuck at this part:
(EDITED. See below code)

TriggerEvent("es:getPlayerFromId", source, function(player)
					addCop(player.identifier)

Here’s what I used to make it work
If anyone sees any errors or improvements, please let me know as I don’t know how good this method really is.

TriggerEvent('es:addCommand', 'addcop', function(source, args, user) 
				addCop(source)
				TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Roger that!")
				TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Congrats, you are now a cop!")
				TriggerClientEvent('police:nowCop', source)
end)

It can’t work with addCop(source) because source is just a number (net id if I remember) and it change each time you disconnect.
You have to get the identifier (ip:x.x.x.x or steam:xxxxxxxxxxxxxxx) to add cop in database

Maybe I’m wrong, please correct me if it is.

That’s what I was thinking, it’s a step closer at least but now I need to make it work with the actual identifier like you say.
Currently trying out something along the lines of:

TriggerEvent('es:addCommand', 'addcop', function(source, args, user) 
TriggerEvent("es:getPlayerFromId", source, function(user)
				local player = user.identifier
				addCop(player)

You should just modify this : addAdminCommand to this : addCommand
It should work

I did but it still requires the user to know their ID as it takes it as an argument:

/addcop [id]

I’m doing it so that the ID is included in the request and the user just needs to type /addcop to become a cop themselves. (Although I’m also changing it to /becop but that’s not really relevant)

This works fine now, thanks for pointing me away from the source error! :slight_smile:

I might post this as a little how to also after some more testing in case others want it but here’s the final code:

TriggerEvent('es:addCommand', 'becop', function(source, args, user) 
				TriggerEvent("es:getPlayerFromId", source, function(user)
				local player = user.identifier
				addCop(player)
				TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Roger that!")
				TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Congrats, you are now a cop!")
				TriggerClientEvent('police:nowCop', source)
				end)
end)

TriggerEvent('es:addCommand', 'nocop', function(source, args, user) 
				TriggerEvent("es:getPlayerFromId", source, function(user)
				local player = user.identifier
				remCop(player)
				TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "Roger that!")
				TriggerClientEvent('chatMessage', source, 'SYSTEM', {255, 0, 0}, "You have been relieved of your duties!")
				TriggerClientEvent('police:noLongerCop', source)
				end)
end)
1 Like

Kyominii : Here is my error

Do you have the package ? If not, have you retry to follow all instructions ?

I don’t think that error is related to this release. I keep seeing those generally with and without the Cops script.

Hi Kyo, nothing appears NULL in my DB.

Trying with your .sql and same error.

You have added the limit column ? and not null

Really good scipt but how to get out a player has been forceenter and cuffed?

1 Like

Yes I would like to know too. Does your excavation system work? For me he does not show me the inventory of the player, just a simple message.

Hello, I am using a translator and I am using the full package on my server, I have to modify the mysql coordinates of my server jai import the font.sql And when I connect to my server no more point of recollection processing and resale is visible how to make it please? Thanks in advance: p

I have a same problem

look my f8 on a crop field

I use Complete Package

I try with a last release VK Recolt and VK inventory for test (Nope i doesn’t work for me ) ):

Can you upload your files pls Kyominii or you can pass on a ts or discord if ever ? or me