-.Paradox.- Posted August 5, 2013 Posted August 5, 2013 Hello, its me again, i have this script exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,' ') function scoreLevel () local account = getPlayerAccount(source) local Level = getAccountData(account, "LV") if isGuestAccount ( account ) then setElementData(source, "Rank",":experience\\ranks\\lvl_0.png") else setElementData(source, "Rank", tostring(":experience\\ranks\\lvl_"..Level..".png" )) end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) end ) & im trying to add a dxImage to the screen but wont work if Level and fileExists ( ":experience\\ranks\\lvl_"..Level..".png" ) then size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") dxDrawImage((557/1024)*sWidth, (666/768)*sHeight, size, size, ":experience\\ranks\\lvl_"..Level..".png") end When i do /debugscript 3 it show this error ERROR: newhud/hud.lua:59: attempt to concatenate local 'Level' (a boolean value) Can somebody tell me what i have to do?
Vector Posted August 5, 2013 Posted August 5, 2013 check Level variable!. You set that variable as local in the function scoreLevel. remove local keyword and it will work. i guess.
-.Paradox.- Posted August 6, 2013 Author Posted August 6, 2013 Thanks for you're help...but still same error, help please.
WASSIm. Posted August 6, 2013 Posted August 6, 2013 remove ( call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) ) and change all ":experience\\ranks\\lvl_"..Level..".png" to ":experience/ranks/lvl_"..Level..".png"
xXMADEXx Posted August 6, 2013 Posted August 6, 2013 ((not tested)) Server: exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,' ') function scoreLevel () local account = getPlayerAccount(source) Level = getAccountData(account, "LV") if isGuestAccount ( account ) then setElementData(source, "Rank", 0) else setElementData(source, "Rank", tonumber( Level )) end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) Client: local Level = tonumber ( getElementData ( localPlayer, "Rank" ) ) if Level and fileExists ( ":experience/ranks/lvl_"..tostring ( Level )..".png" ) then size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") dxDrawImage((557/1024)*sWidth, (666/768)*sHeight, size, size, ":experience/ranks/lvl_"..tostring ( Level )..".png") end
-.Paradox.- Posted August 7, 2013 Author Posted August 7, 2013 Crashed my scoreboard Error dxDrawImage [Can't load file]
xXMADEXx Posted August 7, 2013 Posted August 7, 2013 There might be something wrong with the .png file... Try converting the .png file to .jpg
-.Paradox.- Posted August 7, 2013 Author Posted August 7, 2013 No it was working, it show ranks in scoreboard, but when i add yours my scoreboard crash
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