• Nickname TAG
    3 replies, posted
I want to make a player write his privilege over his head Example: ("superadmin") = ("Owner of this server") ("user") = ("Zombie")
What did you try
So that instead of the player something else was written, that is, if it's a 'user' I want to write what I want, let's say 'user'- Normal player, 'superadmin' - 'Server's Owner'[IMG]http://prntscr.com/fqscnw[/IMG] [editline]2nd July 2017[/editline] [URL="http://prntscr.com/fqscnw"]http://prntscr.com/fqscnw[/URL] [editline]2nd July 2017[/editline] DrawText(ply:GetUserGroup(),job_color,0,200) [editline]2nd July 2017[/editline] [CODE]local camS=cam.Start3D2D local camE=cam.End3D2D local playerGA=player.GetAll local drawST=draw.SimpleText local teamGC=team.GetColor local abs,sin,floor,Round = math.abs,math.sin,math.floor,math.Round local curtime = CurTime local Color=Color local Vector=Vector local Angle=Angle local surface=surface local eyepos local Page = Material("icon64/tool.png") local afk_phrases = { "&#1055;&#1100;&#1077;&#1090; &#1095;&#1072;&#1081; &#1089; &#1073;&#1072;&#1088;&#1099;&#1096;&#1085;&#1077;&#1081;", "&#1042;&#1077;&#1088;&#1086;&#1103;&#1090;&#1085;&#1086;, &#1089;&#1087;&#1080;&#1090;", "&#1054;&#1090;&#1086;&#1096;&#1077;&#1083;", "&#1047;&#1077;&#1074;&#1072;-&#1072;-&#1072;-&#1072;&#1077;&#1090;", "Zzz", "&#1050;&#1091;&#1076;&#1072;-&#1090;&#1086; &#1076;&#1077;&#1083;&#1089;&#1103;", "&#1057;&#1074;&#1077;&#1088;&#1085;&#1091;&#1083; &#1080;&#1075;&#1088;&#1091;" } surface.CreateFont("Rank", { font = "Tahoma", size = 200, weight = 800, antialias = true, additive = true, }) surface.CreateFont("3D2DNicksNickFont", { font = "Tahoma", size = 500, weight = 800, antialias = true, additive = true, }) surface.CreateFont("3D2DNicksNickFont_Blur", { font = "Tahoma", size = 500, weight = 800, antialias = true, additive = false, blursize = 8, }) surface.CreateFont("3D2DNicksNickFont2", { font = "Tahoma", size = 120, weight = 800, antialias = true, additive = true, }) surface.CreateFont("3D2DNicksNickFont_Blur2", { font = "Tahoma", size = 120, weight = 800, antialias = true, additive = false, blursize = 8, }) local drawables = {} hook.Add("PostPlayerDraw", "NameTags", function(pl) drawables[pl] = true end) hook.Add("RenderScene", "3D2DNicksPosAng",function(pos) eyepos = pos end) local function DrawText(txt,color,x,y) for i=1,2 do drawST(txt, "3D2DNicksNickFont_Blur", x, y, Color(0,0,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) end drawST(txt, "3D2DNicksNickFont", x, y, color,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end hook.Add("PostDrawTranslucentRenderables", "NameTags", function() for v,ply in pairs(playerGA()) do if drawables[ply] then drawables[ply] = false local dist = ply:GetPos():Distance(eyepos) if dist < 350 and ply:Alive() then local bone = ply:LookupAttachment("eyes") if bone != 0 then local attach = ply:GetAttachment(bone) local job_color = teamGC(ply:Team()) local color = teamGC(ply:Team()) local psn = ply:GetNWVector("PS_NickColor") if ply:GetNWVector("PS_NickColor") then local r,g,b = psn[1],psn[2],psn[3] if r~=0 or g~=0 or b~=0 then color = Color(r,g,b) end end camS(attach.Pos+Vector(0,0,16), Angle(0, (attach.Pos - eyepos):Angle().y - 90,90), 0.035) DrawText('&#1059;&#1088;&#1086;&#1074;&#1077;&#1085;&#1100;: '..(ply:getDarkRPVar('level') or 0), Color(255,255,255), 0, -100) DrawText(ply:GetName(),color,0,0) DrawText(ply:getDarkRPVar("job"),job_color,0,100) DrawText(ply:GetUserGroup(),job_color,0,200) if ply.IsAFK and ply:IsAFK() then DrawText(afk_phrases[floor((curtime()/4 + ply:EntIndex())%#afk_phrases) + 1]..("."):rep(Round(abs(sin(curtime()*1.2)*3))), Color(102, 102, 204), 0, -140) end camE() end end end end end) [/CODE] [editline]2nd July 2017[/editline] Everything, I did, thanks
[lua] local groups = {user = "zombies", admin = "super zombeh"} MsgN(groups[LocalPlayer():GetUserGroup()] or "zombie") [/lua]
Sorry, you need to Log In to post a reply to this thread.