Jump to content

Scoreboard Problem


Karuzo

Recommended Posts

Posted

Hey Guys,

So i have a problem with my dxDrawn Scoreboard.

I want to make +2 on the Y-Axis for every player.

here's my code:

     
local playerheight = 10 
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 = 255,0,0 
            elseif (ping >= 120) then 
            r,g,b = 255,69,0 
            else         
            r,g,b = 0,255,0      
            end      
        dxDrawText(getPlayerName ( player ), X+60,Y+10*playerheight, Width,Height, tocolor(255,255,255), 1 , "default","center", "center",false, false,true,true) 

Posted

Sorry ,

i mean :

I want to show all player names on the scoreboard.

So i can't really show all players on one position.

So i want to make a gap between the 1st player and the 2nd player and so on.

Posted

Why you u multiply 10*playerHeight, which is also 10?

Just do y+(playerHeight*index). (amt in your code)

Then firstplayer gets 1*10, second 2*10, which puts them into an order.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...