Jump to content

need a small help with restting score..


ViCe

Recommended Posts

Hi all

my friend made a script for resetting scores for the player , for ex: if a player killed 4 and deaths 10 , he should write /rest to reset all his scores in scoreboard to 0. such as "kills" and "deaths" and "dmg" , when I tried it , I wroted /rest and nothing happens :(..

can anyone check please if the script correct or there are an erros ..

function resetPlayerScore (thePlayer) 
    local pname = getPlayerName(thePlayer) 
        setElementData(thePlayer,"Score",0) 
        setElementData(thePlayer,"kills",0) 
        setElementData(thePlayer,"deaths",0) 
        setElementData(thePlayer,"dmg",0) 
        setElementData(thePlayer,"Damage",0) 
        setElementData(thePlayer,"level",0) 
        setElementData(thePlayer,"exp",0) 
outputChatBox(pname.." has resetted his score.", getRootElement(), 147, 112, 219, true ) 
end 
addCommandHandler("rest", resetPlayerScore) 

Thanks..

Link to comment

The script seems to be fine.

function resetPlayerScore (thePlayer) 
    local pname = getPlayerName(thePlayer) 
    setElementData(thePlayer,"Score",0) 
    setElementData(thePlayer,"kills",0) 
    setElementData(thePlayer,"deaths",0) 
    setElementData(thePlayer,"dmg",0) 
    setElementData(thePlayer,"Damage",0) 
    setElementData(thePlayer,"level",0) 
    setElementData(thePlayer,"exp",0) 
    outputChatBox(tostring(pname) .." has resetted his score.", getRootElement(), 147, 112, 219, true ) 
end 
addCommandHandler("rest", resetPlayerScore) 

  • Sad 1
Link to comment
  • 9 years later...
On 15/12/2011 at 07:05, Castillo said:

The script seems to be fine.

function resetPlayerScore (thePlayer) 
    local pname = getPlayerName(thePlayer) 
    setElementData(thePlayer,"Score",0) 
    setElementData(thePlayer,"kills",0) 
    setElementData(thePlayer,"deaths",0) 
    setElementData(thePlayer,"dmg",0) 
    setElementData(thePlayer,"Damage",0) 
    setElementData(thePlayer,"level",0) 
    setElementData(thePlayer,"exp",0) 
    outputChatBox(tostring(pname) .." has resetted his score.", getRootElement(), 147, 112, 219, true ) 
end 
addCommandHandler("rest", resetPlayerScore) 
 

Castillo tien un resource para eso, o ya vien en los serve? ayudame emo porfavor, yo juegaba tu serve con Clone y hidden a mucho tiempo.donde estas (thePlayer) es para poner el login del player o solo el nick?

 

 

 

Edited by PATRAOZINHO98
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...