I'm trying to make a simple text to show the required level for the job. But I am a pure noob at coding and have no idea how to do so. I figure one of the values is job.level but I have no idea how to en corporate it.
Help?
} )
local label = Label( table.name, labelPanel );
label:SetFont( 'PF4_IconTitleFont' );
label:SetColor( color_white );
label:SizeToContents();
label:SetPos( (labelPanel:GetWide() - label:GetWide() ) / 2, ( labelPanel:GetTall() - label:GetTall() ) / 2 );
labelPanel:Dock( BOTTOM );
-- HOVER PANEL OVERLAY
self.hoverOverlay = vgui.Create( 'DPanel', self );
self.hoverOverlay:Dock( FILL );
self.hoverOverlay:SetAlpha( 0 );
self.hoverOverlay:MoveToBack( );
local max_players = table.max;
local col_SemiTrans = Color( 255, 255, 255, 200 );
function self.hoverOverlay:Paint( w, h )
if( self:GetAlpha() == 0 )then return end
surface.SetDrawColor( hovercolor )
surface.DrawRect( 0, 0, w, h );
local player_count = #team.GetPlayers( table.teamid )
draw.SimpleText( player_count..'/'..( max_players <= 0 and '∞' or ( max_players < 1 and math.floor( #player.GetAll()*player_count ) or max_players ) ), 'PF4_PlayerCount', w - 5, 5, col_SemiTrans, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM )
draw.SimpleText( "L", 'PF4_Level', w - 150, 3, col_SemiTrans, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
draw.SimpleText( "V", 'PF4_Level', w - 150, 17, col_SemiTrans, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
draw.SimpleText( "L", 'PF4_Level', w - 150, 30, col_SemiTrans, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
draw.SimpleText( ( #DarkRP.GetAll()*job.level ), 'PF4_PlayerCount', w - 140, 5, col_SemiTrans, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
end
self.hoverOverlay:SetMouseInputEnabled( false );
end
Sorry, you need to Log In to post a reply to this thread.