ZeyadGTX Posted October 5, 2014 Share Posted October 5, 2014 Hello , i would like to add my lvl images into scoreaboard i made that Code in my lvl system it always say that index value = nil or some problems to in ( end ) Server side : exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'Rank') function scoreLevel () local account = getPlayerAccount(source) local Rank = getAccountData(account, "experience.rank") if isGuestAccount ( account ) then setElementData(source, "Rank",":experience\\emblems\\newbie.png") else setElementData(source, "Rank", tostring(":experience\\emblems\\"..Rank..".png" )) end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) end ) And i added this into scoreaboard_Client elseif column.name == "Rank" then dxDrawImage( topX+theX, y-s(0.5), 15, 15, content, 0, 0, 0, cWhite, drawOverGUI ) Link to comment
lcd1232 Posted October 5, 2014 Share Posted October 5, 2014 https://forum.multitheftauto.com/viewtopic.php?f ... ge#p737319 Link to comment
King12 Posted October 5, 2014 Share Posted October 5, 2014 Oh yeah you made it... viewtopic.php?f=91&t=80980 Link to comment
ZeyadGTX Posted October 6, 2014 Author Share Posted October 6, 2014 Any help with code pls i need the scoreboard column.name code with index !! Link to comment
Anubhav Posted October 6, 2014 Share Posted October 6, 2014 exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'Rank') function scoreLevel () local account = getPlayerAccount(source) local Rank = getAccountData(account, "experience.rank") if isGuestAccount ( account ) then setElementData(source, "Rank",":experience/emblems/newbie.png") else setElementData(source, "Rank", tostring(":experience/emblems/"..Rank..".png" )) end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) end ) Link to comment
ZeyadGTX Posted October 6, 2014 Author Share Posted October 6, 2014 exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'Rank') function scoreLevel () local account = getPlayerAccount(source) local Rank = getAccountData(account, "experience.rank") if isGuestAccount ( account ) then setElementData(source, "Rank",":experience/emblems/newbie.png") else setElementData(source, "Rank", tostring(":experience/emblems/"..Rank..".png" )) end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) end ) There is no Problem in this script the problem is to adding column.name == "rank" in scoreboard_Client it said Index = nil value Link to comment
John Smith Posted October 6, 2014 Share Posted October 6, 2014 The place where u have set elseif column.name =="rank"then Is placed where column table isnt defined yet so it returns nil Link to comment
ZeyadGTX Posted October 6, 2014 Author Share Posted October 6, 2014 it say index is nil and some errors at end help ! Link to comment
xeon17 Posted October 6, 2014 Share Posted October 6, 2014 it say index is nil and some errors at end help ! https://wiki.multitheftauto.com/wiki/Debugging 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