Jump to content

Question


WASSIm.

Recommended Posts

Posted
Same way that country column is made, study the script and do the same.

il get it and i replace this

elseif column.name == "Home" then 
dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) 

to this

elseif column.name == "Ranks" then 
dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) 

but is dont show everythink

Posted
exports["scoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "R", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData( player, "Ranks", r ) 
        else 
            setElementData( player,"Ranks",":ranks/lvl_"..r..".png") 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 

Posted
exports["scoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "R", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData( player, "Ranks", r ) 
        else 
            setElementData( player,"Ranks",":ranks/lvl_"..r..".png") 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 

images is in same resource

Posted

Then is not on the same resource.

Also, if "ranks" isn't the resource name but the folder where ranks are located, then you must include resource name.

Posted
Then is not on the same resource.

its same resource look

>    ="ranks.lua" type="server"/>     src="ranks/lvl_0.png" />    src="ranks/lvl_1.png" />    src="ranks/lvl_2.png" />    src="ranks/lvl_3.png" />    src="ranks/lvl_4.png" />    src="ranks/lvl_5.png" />    src="ranks/lvl_6.png" />    src="ranks/lvl_7.png" />    src="ranks/lvl_8.png" />    src="ranks/lvl_9.png" />    src="ranks/lvl_10.png" />>

Posted
Show me new code.

idk why image is same resource and put name resource !

exports["dxscoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "R", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData( player, "Ranks", r ) 
        else 
        setElementData( player, "Ranks","(IV)ranks:ranks/lvl_"..r..".png") 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 

Posted

You obviously didn't read my last post.

exports["dxscoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "R", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData( player, "Ranks", r ) 
        else 
        setElementData( player, "Ranks",":(IV)ranks/ranks/lvl_"..r..".png") 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 

Posted
Post rank.lua maybe there is a bug in.
exports["dxscoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "R", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData( player, "Ranks", r ) 
        else 
        setElementData( player, "Ranks",":(IV)ranks/ranks/lvl_"..r..".png") 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 

Posted
elseif column.name == "Ranks" then 
outputChatBox ( tostring ( content ) ) 
dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) 

Try that and see what it outputs to chatbox when you open the scoreboard.

Posted

dxscoreboard_client.lua

after : xPos = xPos + textLength (string 692)

elseif column.name == "Ranks" then 
dxDrawImage( topX+theX, y-s(0.5), 30, 30, content, 0, 0, 0, cWhite, drawOverGUI ) 

Posted
dxscoreboard_client.lua

after : xPos = xPos + textLength (string 692)

nothing

ERROR: ranks.lua:7: attempt to concatenate local 'r' (a boolean value)

Posted

That exactly what happened to me, try this if dont work try reconnect.

exports["dxscoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "Ranks", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData( player, "Ranks", r ) 
        else 
        setElementData(source, "Ranks", tostring(":(IV)ranks/ranks/lvl_"..r..".png" )) 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 
  

Posted

EDIT :

srry i saw another mistake

exports["dxscoreboard"]:scoreboardAddColumn ( "Ranks", root, 20, "Ranks", 1) 
  
function showranks( ) 
    for index, player in ipairs ( getElementsByType "player" ) do 
        local r = getElementData(player,"level") 
        if not r then 
            setElementData(source, "Ranks",":(IV)ranks/ranks/lvl_0.png") 
        else 
            setElementData(source, "Ranks", tostring(":(IV)ranks/ranks/lvl_"..r..".png" )) 
        end 
    end 
end 
setTimer ( showranks, 500, 0 ) 

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...