[HELP] Police permissons

Hi,

This is my Cuff Police script ( this script is not mine is from a server dump )
This is a exemple:


TriggerEvent('es:addCommand', 'cuff', function(source, args, user)
	if(player_jobs[user.identifier] or (tonumber(user.permission_level) > 2))then
		local job = player_jobs[user.identifier]
		if(job)then
			job = player_jobs[user.identifier].job
		end

		if(groups.police[job] or tonumber(user.permission_level) > 2)then
			if(#args < 2)then
				TriggerClientEvent('chatMessage', source, "JOB", {255, 0, 0}, "Usage: ^2/cuff (ID)")
			else
				if(GetPlayerName(tonumber(args[2])))then
					TriggerEvent('es:getPlayerFromId', tonumber(args[2]), function(target)
						if(get3DDistance(target.coords.x, target.coords.y, target.coords.z, user.coords.x, user.coords.y, user.coords.z) > 10.0)then
							TriggerClientEvent('chatMessage', source, "JOB", {255, 0, 0}, "Please get closer to suspect.")
							return
						end

						if(cuffed[target.identifier])then
							cuffed[target.identifier] = not cuffed[target.identifier]
						else
							cuffed[target.identifier] = true
						end

						local state = ""
						if(cuffed[target.identifier])then
							state = "cuffed"
						else
							state = "uncuffed"
						end

						TriggerClientEvent('es_roleplay:cuff', -1, cuffed[target.identifier], tonumber(args[2]))
						TriggerClientEvent('chatMessage', source, "JOB", {255, 0, 0}, "Player ^2" .. GetPlayerName(tonumber(args[2])) .. "^0 has been " .. state .. ".")
						TriggerClientEvent('chatMessage', tonumber(args[2]), "JOB", {255, 0, 0}, "You have been " .. state .. " by ^2" .. GetPlayerName(source) .. "^0.")
					
						TriggerEvent("es_roleplay:playerCuffed", tonumber(args[2]), cuffed[target.identifier])
					end)
				else
					TriggerClientEvent('chatMessage', source, "JOB", {255, 0, 0}, "Incorrect player ID")
				end
			end
		else
			TriggerClientEvent('chatMessage', source, "JOB", {255, 0, 0}, "You need to be police.")
		end
	else
		TriggerClientEvent('chatMessage', source, "JOB", {255, 0, 0}, "You need to be police.")
	end
end)

That script is working fine. but i am to add the “Police Garage made by TrinnityRE” https://github.com/TrinnityRE/PoliceGarage

I want to my cop script have permissions on Police Garage made by TrinnityRE

RegisterServerEvent('cp:spawncheck')
AddEventHandler('cp:spawncheck', function()

  TriggerEvent('es:getPlayerFromId', source, function(user)

  local player = user.identifier
  
  if user.permission_level == (2) then
  
  TriggerClientEvent('policespawn', source)
  
  TriggerClientEvent('worked', source)
  
  else
  
  TriggerClientEvent('notworked', source)


  end
 end)
end)



1 Like

local player = user.identifier

if user.permission_level == (2) then

He have ? permission_level = 2 if you player don’t have permission 2 in your database he can’t spawn vehicle ? I think … ?

Exactly what @xLomble77 said… I believe you need to change the following if you would like to allow everyone to use it.

to

Hy i want to create a permission for spawn the car where i need to put these Pls
there is my script: https://pastebin.com/PBmpq1Bu

I think is not your script ^^
But if you need permission level, just ask to the creator, if he can help you ^^, or maybe anyone help you here. But create your post :slight_smile:

Yeah its not my “script” but i need a permission pls say if you know and i say my because i have modify for cops

Are you french ?
And if you are, have you discord or teamspeak ?

Yeah https://discord.gg/HHCkpUh

Wondering if you had success adding permissions to cuff script and garage…?

how would you add 2 permission levels?

example…i want admins and everyone to use a spawner. if i set permission to 0 then i cant use it cause im set to 3