Jump to content

Problems with setElementData and getElementData...


GTX

Recommended Posts

Hello, I was about to make the stats system (based on race) and I had some problems...

addEvent("onPlayerDDDMWin",true) 
function DDDMWin(winner) 
    if getPlayerCount() < count then 
--nothing 
    else 
        if not isGuestAccount( getPlayerAccount ( winner ) ) then 
            local PlayerName = getPlayerName( winner ) 
            local getPlayerAcc = getPlayerAccount ( winner ) 
            outputChatBox("#FFFFFF>> " .. PlayerName .. " #ff9000won as last player alive!", getRootElement(), 255, 255, 255, true) 
            givePlayerMoney( winner , 500) 
            setElementData(winner, "wins", getElementData(winner,"wins") + 1) 
            outputChatBox("#FFFFFF>> #ff9000Earned #FFFFFF200 #ff9000points (Total: #FFFFFF" .. getElementData(winner,"Points") .. "#ff9000) and #FFFFFF1000 #ff9000cash (Total: #FFFFFF" .. getPlayerMoney(winner) .. "$#ff9000)", getRootElement(), 255, 255, 255, true) 
        else 
            outputChatBox("#FFFFFF>> " .. getPlayerName( winner ) .. " #ff9000won as last player alive! (Guest)", getRootElement(), 255, 255, 255, true) 
  
end 
end 
end 
addEventHandler("onPlayerDDDMWin",getRootElement(),DDDMWin) 

Don't worry about the rest of code.

Thanks in advance

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