Karuzo Posted January 31, 2014 Share Posted January 31, 2014 Good Evening, so me and my colleague are makin a scoreboard but we have a big problem with drawing the names. So i want it that every new name it counts +1 just 5 units under the first name. Here's my code : local players = getElementsByType ( "player" ) local playas = 0 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) if (ping >= 250) then r,g,b = 200,20,25 elseif (ping >= 120) then r,g,b = 255,149,4 else r,g,b = 50,200,50 end dxDrawText(getPlayerName ( player ), screenW/2.3,screenH/4*amt/5, screenW/1.9,screenH/4, tocolor(255,255,255), 1.2 , "sans","center", "center",false, false,true,true) end end Hope you could help us. Link to comment
Castillo Posted January 31, 2014 Share Posted January 31, 2014 Define a variable with the height, then increase it by 5 for each player. Link to comment
Karuzo Posted January 31, 2014 Author Share Posted January 31, 2014 Hmm , didn't worked. Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 Sorry for the late reply. Here's my code : local playheight = 2 local players = getElementsByType ( "player" ) local playas = 0 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) if (ping >= 250) then r,g,b = 200,20,25 elseif (ping >= 120) then r,g,b = 255,149,4 else r,g,b = 50,200,50 end dxDrawText(getPlayerName ( player ), (screenW- 2)/3.15,(screenH + 12)+ playheight, screenW/2,screenH/4, tocolor(255,255,255), 1 , "default","center", "center",false, false,true,true) Link to comment
Castillo Posted February 1, 2014 Share Posted February 1, 2014 local playheight = 2 local players = getElementsByType ( "player" ) local playas = 0 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) if (ping >= 250) then r,g,b = 200,20,25 elseif (ping >= 120) then r,g,b = 255,149,4 else r,g,b = 50,200,50 end dxDrawText(getPlayerName ( player ), (screenW- 2)/3.15,(screenH + 12)+ playheight, screenW/2,screenH/4, tocolor(255,255,255), 1 , "default","center", "center",false, false,true,true) playheight = ( playheight + 5 ) end end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now