Jump to content

easy problem.


Recommended Posts

  
function resetPlayerScore (thePlayer) 
    local pname = getPlayerAccount( killer) 
    setElementData(thePlayer,"kills",0) 
    setElementData(thePlayer,"deaths",0) 
     
    setAccountData( account, "kills", 0) 
    setAccountData( account, "deaths", 0) 
     
    local playerAccount = getPlayerAccount ( source ) 
    outputChatBox(tostring(pname) .." YOU SCORE KILL/DEATHS IS 0", getRootElement(), 255, 0, 0, true ) 
end 
  
addCommandHandler("resetscore", resetPlayerScore) 
  

problem in setAccountData, not delete score of account

help.

Link to comment

Try this:

  
function resetPlayerScore (thePlayer) 
    local pname = getPlayerAccount( thePlayer ) 
    setElementData(thePlayer,"kills",0) 
    setElementData(thePlayer,"deaths",0) 
    setAccountData( pname, "kills", 0) 
    setAccountData( pname, "deaths", 0) 
    outputChatBox(pname.." YOU SCORE KILL/DEATHS IS 0", getRootElement(), 255, 0, 0, true ) 
end 
addCommandHandler("resetscore", resetPlayerScore) 
  

Link to comment
function resetPlayerScore (thePlayer) 
    local pname = getPlayerAccount( thePlayer ) 
    setElementData(thePlayer,"kills",0) 
    setElementData(thePlayer,"deaths",0) 
    setAccountData( pname, "kills", 0) 
    setAccountData( pname, "deaths", 0) 
    outputChatBox(" "..getPlayerName(thePlayer).."  : YOU SCORE KILL/DEATHS IS 0", getRootElement(), 255, 0, 0, true ) 
end 
addCommandHandler("resetscore", resetPlayerScore) 
  

Link to comment
  • 9 months later...

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