[Release] Tag for Admin V1.0 & V2.0| Over-The-Head

admins
tag

#42

could you add in permission level version of this for ESX instead of like group cause i have a admin and superadmin group. but i have 4 diffrent perm levels i give diff perm levels diff head labels


#43

I never used esx perm levels, but it should no be hard, add it on the getindentify function, and you should be able to do it, talk to me in discord if you need help.


#44

did you fix so now we can have different colors


#45

Edit the draw text in the .lua files.

I have changed it dramatically.


#46

If you want different colours for different tags, just create different draw text for that specific tag.


#47

dont understand im not a dev


#48

In the Lua files are the DrawText properties, there’s one called DrawTextColour it’s RGB so you can change the colour there.


#49

yea but i want 1 color for 1 tag and another color for another tag


#50

Make different drawtexts for each tag then.


#51

thank you for adding in a esx version with the different ranks it would be nice to change colors of diffrent tags like i dont want superadmins and admins tags same color


#52

i added this to my server and it’s not working at all i see nothing any ideas??


#53

More info?
Are you using esx or standalone versions?
Any error outputs in chat?
Have you tried a fresh copy?


#54

yea i have a vrp server dunkos pack modded i installed it starts up fine but nothing shows up over my head etc


#55

vRP, what version of this script are you using steam ID, Ace or esx


#56

steam id i tried all of them i figured it out thanks it was vrp playernames


#57

how do you change the size


#58

Please? be polite, and maybe someone would help you @OMEGA


#59

how do I change the superadmin tag to something else? cause I want to change it to owner


#60

how do you change the text size on top of the head


#61
local TagAdmin1 = 'nil' -- DONT TOUCH PLEASE

RegisterNetEvent('Cheleber:tag1')
AddEventHandler('Cheleber:tag1', function(id, tag) 
    if TagAdmin1 == 'nil' then
	    if tag == 'true' then
		    TagAdmin1 = id .. ''
	    end
	else
	    if tag == 'true' then
		    TagAdmin1 = TagAdmin1 ..'\n'.. id
	    end
    end
end) 

RegisterNetEvent('Cheleber:tagclean')
AddEventHandler('Cheleber:tagclean', function() 
    TagAdmin1 = 'nil'
	TriggerServerEvent('Cheleber:SVstarttag', GetPlayerServerId(PlayerId()))
end) 


Citizen.CreateThread(function()
	while true do
		-- Wait 5 seconds after player has loaded in and trigger the event.
		Citizen.Wait( 100 )

		if NetworkIsSessionStarted() then
			TriggerServerEvent('Cheleber:SVstarttagjoin', GetPlayerServerId(PlayerId()))
			break
		end
	end
end)

Citizen.CreateThread(function ()
    while true do
        for id = 0, 31 do
            if GetPlayerPed( id ) ~= GetPlayerPed( -1 ) and SeeSelfTag == false then
                ped = GetPlayerPed( id )
                blip = GetBlipFromEntity( ped ) 
 
                x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
                x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
                distance = math.floor(GetDistanceBetweenCoords(x1,  y1,  z1,  x2,  y2,  z2,  true))

                if(ignorePlayerNameDistance) then
					for i,l in ipairs(stringsplit(TagAdmin1, "\n")) do
			            for i = 1, #l do
						    if l == tostring(GetPlayerServerId(id)) then
		                        DrawText3DTag(x2, y2, z2 + displayTAGHeight, "Admin ~g~Patrol")
							end
						end
			        end
				end

                if ((distance < playerNamesDist)) then
                    if not (ignorePlayerNameDistance) then
					    for i,l in ipairs(stringsplit(TagAdmin, "\n")) do
			                for i = 1, #l do
						        if l == tostring(GetPlayerServerId(id)) then
		                            DrawText3DTag(x2, y2, z2 + displayTAGHeight, "Admin ~g~Patrol")
							    end
						    end
			            end
			        end
                end  
            end
			if SeeSelfTag == true then
                ped = GetPlayerPed( id )
                blip = GetBlipFromEntity( ped ) 
 
                x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
                x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
                distance = math.floor(GetDistanceBetweenCoords(x1,  y1,  z1,  x2,  y2,  z2,  true))

                if(ignorePlayerNameDistance) then
					for i,l in ipairs(stringsplit(TagAdmin1, "\n")) do
			            for i = 1, #l do
						    if l == tostring(GetPlayerServerId(id)) then
		                        DrawText3DTag(x2, y2, z2 + displayTAGHeight, "Admin ~g~Patrol")
							end
						end
			        end
				end

                if ((distance < playerNamesDist)) then
                    if not (ignorePlayerNameDistance) then
					    for i,l in ipairs(stringsplit(TagAdmin1, "\n")) do
			                for i = 1, #l do
						        if l == tostring(GetPlayerServerId(id)) then
		                            DrawText3DTag(x2, y2, z2 + displayTAGHeight, "Admin ~g~Patrol")
							    end
						    end
			            end
			        end
                end  
            end
        end
        Citizen.Wait(0)
    end
end)



function DrawText3DTag(x,y,z, text) 
    local onScreen,_x,_y=World3dToScreen2d(x,y,z)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)

    local scale = (1/dist)*2
    local fov = (1/GetGameplayCamFov())*100
    local scale = scale*fov
    
    if onScreen then
        SetTextScale(0.7*scale, 1.2*scale)
        SetTextFont(1)
        SetTextProportional(1)
        SetTextColour(255, 0, 0, 255)
        SetTextDropshadow(0, 0, 0, 0, 255)
        SetTextEdge(0, 0, 0, 0, 255)
        SetTextDropShadow()
        SetTextOutline()
        SetTextEntry("STRING")
        SetTextCentre(1)
        AddTextComponentString(text)
	    World3dToScreen2d(x,y,z, 0) --Added Here
        DrawText(_x,_y)
    end
end


function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

I HAVE CHANGED IT TO ADMIN PATROL JUST FIND ADMIN PATROL AND CHANGE IT TO WHAT YOU WANT