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) Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
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) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Castillo Posted May 3, 2012 Posted May 3, 2012 You forgot to end the second function Yakuza. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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? Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
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 My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Castillo Posted May 3, 2012 Posted May 3, 2012 Sorry, my bad, I didn't see the end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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