Jump to content

Rank


boro

Recommended Posts

Posted

Hi all i make rank score but it doesn't work, check it , and please help me. TY

rank server

function scoreLevel () 
    local account = getPlayerAccount(source) 
    local level = getAccountData(account, "rank") 
    local nameimage = "level" 
    if rank== false then 
        setElementData(source, "Rank", "level0.png")  
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) 

scoreboard client

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

I'll help When I Can.

Posted

Perhaps...

Server-side (rank)

addEventHandler("onPlayerSpawn", root, 
    function() 
        local account = getPlayerAccount(source) 
        if not isGuestAccount(account) then 
            if not getAccountData(account, "Rank") or tonumber(getAccountData(account, "Rank")) == 0 then 
                setElementData(source, "Rank", "level0.png") 
            else 
                setElementData(source, "Rank", "level" .. tonumber(getAccountData(account, "Rank")) .. ".png") 
            end 
        else 
            setElementData(source, "Rank", "level0.png") 
        end 
    end 
) 

Client-side (scoreboard)

elseif column.name == "Rank" then 
    if getElementData(localPlayer, "Rank") then 
        dxDrawImage(topX+theX, y+s(1), 16, 11, getElementData(localPlayer, "Rank"), 0, 0, 0, cWhite, drawOverGUI) 
    end 
end 

If I helped you, please click the like button on the right ;) Thanks!

Posted

myonlake, scoreboard now not open when i press tab

                                    local partOfName = string.sub( playerName, firstCodePos, secondCodePos ) 
                                    local textLength = dxGetTextWidth( partOfName, fontscale(contentFont, s(1)), contentFont ) 
                                    dxDrawText( partOfName, xPos+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( partOfName, xPos,       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 ) 
                                    xPos = xPos + textLength 
                                end 
elseif column.name == "Rank" then 
    if getElementData(localPlayer, "Rank") then 
        dxDrawImage(topX+theX, y+s(1), 16, 11, getElementData(localPlayer, "Rank"), 0, 0, 0, cWhite, drawOverGUI) 
    end 
end 
                            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 
                        end 
                        x = x + s(column.width + 10) 
                    end 
                end 
                local font = iif( element and isElement( element ) and getElementType( element ) == "team", teamHeaderFont, contentFont ) 
                y = y + dxGetFontHeight( fontscale(font, scoreboardScale), font ) 
                index = index + 1 
            end 
            index = 1 
        end 
    end 
end 
 

I'll help When I Can.

Posted

i no need download :|

Anyway :

Server Side

  
exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'Rank') 
function scoreLevel () 
    local account = getPlayerAccount(source) 
    local level = getAccountData(account, "rank") 
    local nameimage = "level" 
    if isGuestAccount ( account ) then 
        setElementData(source, "Rank",":ProRank\\Ranks\\level0.png") 
    else 
        setElementData(source, "Rank", tostring(":ProRank\\Ranks\\"..nameimage..level..".png" ))                                       
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) 
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() 
        call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) 
    end 
) 
  

my rank resource name is "ProRank" and folder with images "Ranks"

=

(":ProRank\\Ranks\\"..nameimage..level..".png" ))

if u want use other name of folder dont forget edit the patch

----------------------------------------------------------------------

dxscoreboard_client.lua

after : xPos = xPos + textLength (string 692)

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

  • 6 months later...
Posted

I tried that too and it keep showing :experience\\ranks\\"..nameimage..Level.." etc help please

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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