Jump to content

Rank Image


BorderLine

Recommended Posts

Hi everyone. well im trying to draw a rank img in scoreboard

but i have problems

this are my codes

scoreboard edit.. clientside

elseif column.name == "Pais" then 
dxDrawImage( topX+theX, y+s(1), 17, 12, content, 0, 0, 0, cWhite, drawOverGUI ) 
elseif column.name == "Medalla" then 
dxDrawImage( topX+theX, y+s(1), 40, 40, content, 0, 0, 0, cWhite, drawOverGUI ) 
else 
dxDrawText( content, topX+theX+s(1),    y+s(1), topX+x+s(1+column.width),   y+s(11)+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),    tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 
dxDrawText( content, topX+theX,         y,      topX+x+s(column.width),     y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),          tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI )end 

Rank ClientSide

function loadmedalla() 
dios = "Rangos/Dios.png" 
setElementData(getLocalPlayer(),"Medalla",dios) 
end 
addEventHandler("onClientResourceStart",getRootElement(),loadmedalla) 
addEventHandler("onClientPlayerSpawn",getRootElement(),loadmedalla) 

this was another way.

Serverside

addEventHandler("onPlayerSpawn",root, 
function () 
    local cuenta = getPlayerAccount(source) 
    if isGuestAccount(cuenta) then return end 
    local rango = getAccountData(cuenta,"Rango") 
    if rango then 
        setElementData(source,"Rango", rango) 
        setElementData(source,"Medalla","Rangos/"..rango..".png) 
end 
end 
) 
 

and debugscript say

dxDrawImagen cant load file.

I added to meta and the path is allright. im try setElementData in serverside and clientside.

What is wrong? or what is the best way to make this?

Thanks for your time :)

Link to comment

First u not need the client script.

Script server side (in my post)

Edit the dxscoreboard (in my post)

Value ranks numbers (if u have the name, u can convert the name to number with table)

And ranks .png (example 0.png = guest 1.png = rank 1)

Anyway if u have the problem I can give u the script in pm,but later now I job.

Link to comment

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