Jump to content

need a small help with restting score..


ViCe

Recommended Posts

Posted

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

Posted

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
Posted

Ok the meta.xml:

<meta> 
    <info author="ViCe" name="ResetScore" version="1.1" type="script" /> 
    <script src="resetscore.lua" /> 
</meta> 
  

Posted

Weird enough. Meta looks good too unless the script's name is not 'resetscore.lua'

Do you think you could be doing anything wrong? Sometimes you can even miss loading the resource. (i'm not saying you're a noob, i'm just trying to think what could possibly go wrong)

  • 9 years later...
Posted (edited)
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

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