CheiN Posted August 16, 2012 Posted August 16, 2012 function Ranks() local Rank = exports.race:getPlayerRank(source) exports.scoreboard:scoreboardAddColumn( "score" ) if Rank == 1 then zcore = getElementData(source,"score") or 0 setElementData(source,"score",zcore+5) elseif Rank == 2 then zcore = getElementData(source,"score") or 0 setElementData(source,"score",zcore+3) elseif Rank == 3 then zcore = getElementData(source,"score") or 0 setElementData(source,"score",zcore+2) else return end end addEventHandler("onPlayerWasted", getRootElement(), Ranks) im good??? My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Castillo Posted August 16, 2012 Posted August 16, 2012 exports.scoreboard:scoreboardAddColumn ( "score" ) local scores = { 5, 3, 2 } function Ranks ( ) local rank = exports.race:getPlayerRank ( source ) local score = scores [ rank ] if ( score ) then local zcore = tonumber ( getElementData ( source, "score" ) ) or 0 setElementData ( source, "score", ( zcore + score ) ) end end addEventHandler ( "onPlayerWasted", getRootElement(), Ranks ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
CheiN Posted August 16, 2012 Author Posted August 16, 2012 Where is the 2cond rank 3 rank and 1rst rank? My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Jaysds1 Posted August 16, 2012 Posted August 16, 2012 well, since it returns those numbers, the numbers go towards the table, so the ranks get the number from the table(scores) then gives the player the score 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/
CheiN Posted August 16, 2012 Author Posted August 16, 2012 Wait wait wait then the ranks will be 2 3 and 5??? I dont understood My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Castillo Posted August 16, 2012 Posted August 16, 2012 local scores = { 5, 3, 2 } It's like this: 1 = 5 2 = 3 3 = 2 You understand what I mean? the script will get the score from the 'rank' index from that table. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
CheiN Posted August 16, 2012 Author Posted August 16, 2012 Ahhhhhhh thx for explain it ^^ i didnt knew it THX solidSnake My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Castillo Posted August 16, 2012 Posted August 16, 2012 You're welcome. 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