Jump to content

¿Im good? III


CheiN

Recommended Posts

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???

Link to comment
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 ) 

Link to comment

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