Jump to content

SetRankDisplay


Sex*

Recommended Posts

I get this error: [2013-02-09 17:54:24]

ERROR: race\race_client.lua:626: attempt to call global 'setRankDisplay' (a nil value) 

The 626 Event:

addEventHandler('onClientElementDataChange', g_Me, 
    function(dataName) 
        if dataName == 'race rank' and not Spectate.active then 
            setRankDisplay( getElementData(g_Me, 'race rank') ) 
        end 
    end, 
    false 
) 

Link to comment

So, I guess you removed the Function !

Add this Function at the Same file

function setRankDisplay( rank ) 
    if not tonumber(rank) then 
        g_dxGUI.ranknum:text('') 
        g_dxGUI.ranksuffix:text('') 
        return 
    end 
    g_dxGUI.ranknum:text(tostring(rank)) 
    g_dxGUI.ranksuffix:text( (rank < 10 or rank > 20) and ({ [1] = 'st', [2] = 'nd', [3] = 'rd' })[rank % 10] or 'th' ) 
end 

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