[Release-Archived] Cops FiveM

wrong , commands are available in your server console or you could use icecon / FiveM-Rcon.

I think he is asking the command like /CopAddAdmin

yes and the answer is that they work on the server console or RCON

Commands

You can use these commands with RCON (CopAdd / CopAddAdmin / CopDept/ CopRem / CopRank).
To see how to use them, just type the command you want without any parameter.

rcon tools

@march_tala where is that at?

Access Denied for command CopAddAdmin. what’s wrong with this?

you need to write them in the server console or some rcon client , but not inside the client console or chat.

Commands

You can use these commands with RCON (CopAdd / CopAddAdmin / CopDept/ CopRem / CopRank).
To see how to use them, just type the command you want without any parameter.

rcon tools

should i uninstall esx_policejob when installing this?

I got a question, im using zap-hosting and i did what it told me. I got no confirmation msg when i joined and did this command, i have been at this for 2 hours but i cant find the problem. Any solutions? I have edited the ghmattimysql file but rcon also acts like there is no such command.

Access denied when trying to add myself as an admin?

you need to write the commands in the server console or some rcon client , but not inside the client console or chat.

Commands

You can use these commands with RCON (CopAdd / CopAddAdmin / CopDept/ CopRem / CopRank).
To see how to use them, just type the command you want without any parameter.

rcon clients

I cant actually edit the .json file? Not sure whats happening there.

I’m having to re-add myself to the database everytime I get on my server. Is there a way to save it so I won’t have to keep adding myself over and over again?

one of the authors already answered your question on discord and now you are asking it again here?

Is there any way to remove the garage and possibly armory i need help everytime i do the script breaks

Has anyone gotten this to work with zap? I keep getting this error and I dont know what i did wrong. (AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
e[91mError: (node:52962) 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: 5)e[0m)

How can I add cops to the database by there stream hex id? So they dont have to be in the server to be added. I can just add them and the next server restart they will beable to be a cop

Alright another issue, I went into the config and disabled the native garage trying to get them to go away. They don’t. What do I do? Whats the way to make it so they arint there

Same here, have you found a way to fix? I need the garage gone but it wont go away

ok i have a weird issue and i dont know how or were to start to fix it so here is my issue the f5 menu works just fine for me and everything had a player join the server did the copadd on him to put him in the same dpt as me and for some reason his f5 menu doesnt work when clocked in

Utilize this file to make this resource work 100% with Onesync, just drag and drop it into the client folder of the “police” resource.
client.lua (24.0 KB)

I achieved this by just updating the loops as stated in this post [How-to] Adapt your script to OneSync and fix your issues

First Loop Before

local localIdCops = {}
	for id = 0, 64 do
		if(NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId()) then
			for i,c in pairs(allServiceCops) do
				if(i == GetPlayerServerId(id)) then
					localIdCops[id] = c
					break
				end
			end
		end
	end

First Loop After

	local localIdCops = {}
	for id = 0, 256 do
		if(NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId()) then
			for i,c in pairs(allServiceCops) do
				if(i == GetPlayerServerId(id)) then
					localIdCops[id] = c
					break
				end
			end
		end
	end
	

2nd Loop Before

function GetPlayers()
    local players = {}

    for i = 0, 31 do
        if NetworkIsPlayerActive(i) then
            table.insert(players, i)
        end
    end

    return players
end

2nd Loop After

function GetPlayers()
    local players = {}

    for i = 0, 256 do
        if NetworkIsPlayerActive(i) then
            table.insert(players, i)
        end
    end

    return players
end