Jump to content

Wins problem..


GanJaRuleZ

Recommended Posts

Hai all , i have a problem with a script..

ERROR :

  
[2012-02-07 12:42:06] SCRIPT ERROR: userPanel\server.lua:10: 'then' expected near '=' 
[2012-02-07 12:42:06] WARNING: Loading script failed: userPanel\server.lua:10: 'then' expected near '=' 

The script :

  
addEvent("onPlayerFinish",true) 
addEventHandler("onPlayerFinish",getRootElement(), 
    function (rank,finishtime) 
      local account = getPlayerAccount(source) 
      if isGuestAccount(account) then 
       outputChatBox("You must be logged in to get the reward." , source, 255, 0, 0, true) 
     else 
        if rank == 1 then 
            setAccountData( account, "Race Wins", tonumber(getAccountData(account,"Race Wins"))+1)   
        elseif rank =< 2 then 
            setAccountData( account, "Race Loses", tonumber(getAccountData(account,"Race Loses"))+1 ) 
        end 
        end 
        end 
) 

Link to comment
addEvent( "onPlayerFinish",true ) 
addEventHandler( "onPlayerFinish",root, 
    function ( rank,finishtime ) 
        local account = getPlayerAccount( source ) 
        if isGuestAccount( account ) then 
            outputChatBox( "You must be logged in to get the reward." , source, 255, 0, 0, true ) 
        else 
            if rank == 1 then 
                setAccountData( account, "Race Wins", tonumber( getAccountData( account,"Race Wins" ) )+1 )   
            elseif rank >= 2 then 
                setAccountData( account, "Race Loses", tonumber( getAccountData( account,"Race Loses" ) )+1 ) 
            end 
        end 
    end 
) 

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