Adding a second tag into Admin Script

I am currently using the Freemode 2 as a base, and i am trying to add another tag for the server to show up if the player goes on duty.

For example /duty 1 to be a cop, but at the same time being a admin should show up
“ADMIN | COP: Message”
or
“ADMIN | EMS: Message”

Below is what im working with and poking at i havent really attempted much else, anything i do breaks the chat but it currently loads up the way it is, i just dont know how to do the seperate tag into the triggerclientevent. i already have the SQL database setup with the new table but just trying to figure out how to combine 2 seperate tags into 1 system. Any help would be greatly appreciated just something simple to “identify” the player as a on duty or off duty persons.

AddEventHandler('chatMessage', function(source, color, message)
	command = stringsplit(message, " ")
	
	print(color .. ":" .. message)

	if(message:sub(1, 1) == "/")then
		CancelEvent()
	else
		CancelEvent()
		
		local tag = "USER"
		local color = {255, 255, 255}
		
		if(isLoggedIn(source))then
			local adminlevel = tonumber(Users[GetPlayerName(source)]['admin'])
			local dutylevel = tonumber(Users[GetPlayerName(source)]['duty'])
			
			if(adminlevel == 1)then
				tag = "MODERATOR"
				color = {255, 204, 0}
			elseif(adminlevel == 2)then
				tag = "ADMIN"
				color = {255, 153, 51}
			elseif(adminlevel == 3)then
				tag = "SUPERADMIN"
				color = {255, 102, 0}
			elseif(adminlevel > 3)then
				tag = "OWNER"
				color = {204, 102, 0}
			elseif(dutylevel == 1)then
				tag2 = "OFFICER"
				color = {0, 0, 255}
			elseif(dutylevel == 2)then
				tag2 = "FBI"
				color = {51, 51, 153}
			elseif(dutylevel == 3)then
				tag2 = "EMS"
				color = {0, 204, 0}
			elseif(dutylevel > 3)then
				tag2 = "FIRE DEPT"
				color = {255, 0, 0}
			end
			TriggerClientEvent('chatMessage', -1, tag tag2 .. " | " .. GetPlayerName(source), color, message)
		end	
		return
end

Do not use FreeRoam2

Ok I’ll prolly redo it all with your new game mode but is the new one still compatable with the old sql table?

No everything changed.

Since I’m not really a fan of “Why would you even want to do this?”-kind of posts and just answer the question: you need to move your admin logic below the duty logic in its own IF-statement and just concatenate the admin tag to it.

Such as:

			local tag = ""

			if(dutylevel == 2)then
				tag = "FBI"
				color = {51, 51, 153}
			elseif(dutylevel == 3)then
				tag = "EMS"
				color = {0, 204, 0}

			if(adminlevel == 1)then
				tag = "MOD | " .. tag
				color = {255, 204, 0}
			elseif(adminlevel == 2)then
				tag = "ADMIN" .. tag
				color = {255, 153, 51}
			
			TriggerClientEvent('chatMessage', -1, tag .. GetPlayerName(source), color, message)

Hello, can you help me with something?
I am trying to give permissions in game such as Moderator Or Admin with Freeroam v2, but I dont know how and I saw you had that setup

freeroam is dead move on.

Closed to stop other replying… This is an old thread that should have died months ago.