BorderLine Posted May 3, 2012 Posted May 3, 2012 Hi everyone. I have a little problem. I want show the rank on scoreboard. but dont show. Idk what happen . Debugscript dont show errors.! thanks dor your time.. here its my code addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports.Scoreboard:addScoreboardColumn("Rank",getRootElement(),4,0.04) end) addEventHandler ("onPlayerSpawn",getRootElement(), function() local serial = getPlayerSerial(source) local DDAttempts = executeSQLSelect ( "DDDM", "DDAttempts","serial = '" .. serial .. "'") local DDWins = executeSQLSelect ( "DDDM", "DDWins","serial = '" .. serial .. "'") rank = (tonumber(DDWins)/tonumber(DDAttempts))*100 setElementData( source, "Rank", tonumber(rank[1]["rank"]))end)
Jaysds1 Posted May 3, 2012 Posted May 3, 2012 try this: addEventHandler("onResourceStart",resourceRoot,function() call(getResourceFromame("Scoreboard"),"addScoreboardColumn","Rank",root,4,0,04) end)
BorderLine Posted May 3, 2012 Author Posted May 3, 2012 try this:addEventHandler("onResourceStart",resourceRoot,function() call(getResourceFromame("Scoreboard"),"addScoreboardColumn","Rank",root,4,0,04) end) the colum is created all right.. but dont show the rank @solid another end?
Jaysds1 Posted May 3, 2012 Posted May 3, 2012 (edited) You forgot to end the second function Yakuza. he added the end at the end of the function @Yukazi What's this tonumber(rank[1]["rank"]) ??? you didn't made a table... try this: addEventHandler("onResourceStart",resourceRoot,function() exports.Scoreboard:addScoreboardColumn("Rank",root,4,0,04) end) addEventHandler ("onPlayerSpawn",root,function() local serial = getPlayerSerial(source) local DDAttempts = executeSQLSelect ( "DDDM", "DDAttempts","serial = '"..serial.."'") local DDWins = executeSQLSelect ( "DDDM", "DDWins","serial = '"..serial.."'") rank = (tonumber(DDWins)/tonumber(DDAttempts))*100 setElementData( source, "Rank",rank) end) Edited May 3, 2012 by Guest
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