Karuzo Posted January 31, 2014 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.
Castillo Posted January 31, 2014 Posted January 31, 2014 Define a variable with the height, then increase it by 5 for each player. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted January 31, 2014 Posted January 31, 2014 Post your code. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Karuzo Posted February 1, 2014 Author 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)
Castillo Posted February 1, 2014 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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