GTX Posted February 13, 2012 Share Posted February 13, 2012 addEventHandler("onResourceStart", resourceRoot, function() exports.scoreboard:scoreboardAddColumn("Rank") end) function tables( ) outputChatBox( "Top 3 points:", root, 255,255,255 ) for index, data in ipairs( sortAccounts( ) ) do outputChatBox("#"..tostring( index )..": ".. tostring( data.account ) .." - ".. tostring( data.points ), root, 255, 255, 255 ) setElementData(tostring(data.account), "Rank", index) if index == 3 then break end end triggerClientEvent( 'onAccountsSend',root,sortAccounts( ) ) end addCommandHandler( "top", tables ) Errors: [16:31:30] WARNING: [gtx]\upanel\stats_s.lua:182: Bad argument @ 'setElementData' [Expected element at argument 1, got string '-DTR-GTX#ff0000#'] [16:31:30] WARNING: [gtx]\upanel\stats_s.lua:182: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] Link to comment
-ffs-Sniper Posted February 13, 2012 Share Posted February 13, 2012 https://wiki.multitheftauto.com/wiki/SetElementData Please take a closer look at the arguments. (1st one = element, 2nd = key, 3rd value) You need to pass a valid player or account element. Link to comment
GTX Posted February 13, 2012 Author Share Posted February 13, 2012 Thanks! I solved that problem. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now