Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if !CLIENT then return end -- This will set the file to client. Do not remove under any circumstance.
- ply = LocalPlayer()
- local AboveMaterial = Material("scarness/scartg.png") -- Set the image you want here.
- local Width = 135 -- Adjust to be the image size /2
- local Height = 49 -- Adjust to be the image size /2
- local TeamColor = team.GetColor(ply:Team())
- surface.CreateFont( "InfoText", { -- The font we're using. Adjust it if you want specifics (like outlines)
- font = "TargetID",
- size = 15,
- weight = 500,
- blursize = 0,
- scanlines = 0,y
- antialias = false,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = true,
- additive = false,
- outline = false
- } )
- local Resolutions = {} -- This is the Resolutions table, in which you can tweak the size as well as the character names.
- Resolutions[8] = 0.25 -- 8 Characters = Normal
- Resolutions[16] = 0.15
- Resolutions[24] = 0.15
- local function FindDesiredRes( Len ) -- This is the function for the resolutions, don't mess with it.
- local DesiredRes = 0.25
- for CharLen, Res in pairs( Resolutions ) do
- if Len >= CharLen then
- DesiredRes = Res
- else
- break
- end
- end
- return DesiredRes
- end
- local function DrawName( ply ) -- This is the function we use to draw everything.
- if !ply:Alive() then return end -- If they die, then it stops it until they're alive. Prevents being dead and it still being there.
- local offset = Vector( 0, 0, 90 ) -- Edit the final # to make it up higher.
- local ang = LocalPlayer():EyeAngles()
- local pos = ply:GetPos() + offset + ang:Up()
- local jobdrp = ply:getDarkRPVar("job") or "Unemployed" -- The job variables, this is what gets the DarkRP Jobs.
- local Res = FindDesiredRes( #ply:GetName() ) -- This is to get the strings characters, in order to allow the shrinking.
- local Alpha = ( math.min( 712, EyePos():Distance( pos ) )/712 )*255 -- This is the distance modifier. What this does is go based on eye distance from the target, then divide it by 512 then multiply by 255, putting it in alpha format. We cannot allow editing of this or it will cause issues.
- local GroupName = "Guest"
- if ply:IsUserGroup("owner") then -- This is where you setup the groups.
- GroupName = "Owner"
- elseif ply:IsUserGroup("moderator") then
- GroupName = "Moderator"
- end
- ang:RotateAroundAxis( ang:Forward(), 90 )
- ang:RotateAroundAxis( ang:Right(), 90 )
- if 700 > EyePos():Distance( pos ) then
- cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), 0.25 )
- surface.SetDrawColor(255,255,255,222)
- surface.SetMaterial( AboveMaterial ) -- This draws the table you made.
- surface.DrawTexturedRect(-67, 0, Width, Height ) -- Called at the top, sets up the positioning.
- draw.DrawText( jobdrp,"InfoText", 2, 13, Color( TeamColor.r, TeamColor.g, TeamcColor.b, 222), TEXT_ALIGN_CENTER )
- cam.End3D2D()
- cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), FindDesiredRes( #ply:Nick() ) ) -- This is for the name, so we can easily change the names size.
- surface.SetDrawColor(255,255,255,222)
- if Res == 0.15 then
- draw.DrawText( ply:Nick(), "InfoText", 2, 9, Color( TeamColor.r, TeamColor.g, TeamcColor.b, 222 ), TEXT_ALIGN_CENTER )
- else
- draw.DrawText( ply:Nick(), "InfoText", 2, -1, Color( TeamColor.r, TeamColor.g, TeamcColor.b, 222 ), TEXT_ALIGN_CENTER )
- end
- cam.End3D2D()
- elseif EyePos():Distance( pos ) >= 700 then
- cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), 0.25 )
- surface.SetDrawColor(255,255,255, 0)
- cam.End3D2D()
- end
- end
- hook.Add( "PostPlayerDraw", "DrawThisInfoHookThingy", DrawName )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement