ZeyadGTX Posted October 5, 2014 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 ) My nick in MTA is Spider
lcd1232 Posted October 5, 2014 Posted October 5, 2014 https://forum.multitheftauto.com/viewtopic.php?f ... ge#p737319
King12 Posted October 5, 2014 Posted October 5, 2014 Oh yeah you made it... viewtopic.php?f=91&t=80980
ZeyadGTX Posted October 6, 2014 Author Posted October 6, 2014 Any help with code pls i need the scoreboard column.name code with index !! My nick in MTA is Spider
Anubhav Posted October 6, 2014 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 ) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
ZeyadGTX Posted October 6, 2014 Author 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 My nick in MTA is Spider
John Smith Posted October 6, 2014 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 If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
ZeyadGTX Posted October 6, 2014 Author Posted October 6, 2014 it say index is nil and some errors at end help ! My nick in MTA is Spider
xeon17 Posted October 6, 2014 Posted October 6, 2014 it say index is nil and some errors at end help ! https://wiki.multitheftauto.com/wiki/Debugging A unique GangWar gamemode waiting for you!Click here for more information.
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