Jump to content

¿Im good? III


CheiN

Recommended Posts

Posted
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)

Posted
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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Where is the 2cond rank 3 rank and 1rst rank?

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted

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)

Posted
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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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)

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...