Jump to content

onPlayerToptimeImprovement D:


#Paper

Recommended Posts

Does not show any error but doesn't set the data:

function onTopTime (player,newPos,newTime,oldPos,oldTime,random1,random2) 
    if isGuestAccount(getPlayerAccount(source)) == false then 
        if newPos <= 10 then 
            addStat(getPlayerAccount(source), "Top Times", 1) 
        end 
    end 
end 
addEvent("onPlayerToptimeImprovement",true) 
addEventHandler("onPlayerToptimeImprovement",getRootElement(), onTopTime) 

Link to comment
function onTopTime (player,newPos,newTime,oldPos,oldTime,random1,random2) 
    if isGuestAccount(getPlayerAccount(player)) == false then 
        if newPos <= 10 then 
            addStat(getPlayerAccount(player), "Top Times", 1) 
        end 
    end 
end 
addEvent("onPlayerToptimeImprovement",true) 
addEventHandler("onPlayerToptimeImprovement",getRootElement(), onTopTime) 

Link to comment
function onTopTime (player,newPos,newTime,oldPos,oldTime,random1,random2) 
    if isGuestAccount(getPlayerAccount(player)) == false then 
        if newPos <= 10 then 
            addStat(getPlayerAccount(player), "Top Times", 1) 
        end 
    end 
end 
addEvent("onPlayerToptimeImprovement",true) 
addEventHandler("onPlayerToptimeImprovement",getRootElement(), onTopTime) 

i tryed too, but it says bad argument @ line 2

Link to comment

i tryed too, but it says bad argument @ line 2

You forgot to add the 2 brackets(), try this:

function onTopTime (player,newPos,newTime,oldPos,oldTime,random1,random2) 
    if (isGuestAccount(getPlayerAccount(player)) == false) then 
        if newPos <= 10 then 
            addStat(getPlayerAccount(player), "Top Times", 1) 
        end 
    end 
end 
addEvent("onPlayerToptimeImprovement",true) 
addEventHandler("onPlayerToptimeImprovement",getRootElement(), onTopTime) 
-- OR 
function onTopTime (player,newPos,newTime,oldPos,oldTime,random1,random2) 
              local account = getPlayerAccount(player) 
    if isGuestAccount(account) then 
        if newPos <= 10 then 
            addStat(getPlayerAccount(player), "Top Times", 1) 
        end 
    end 
end 
addEvent("onPlayerToptimeImprovement",true) 
addEventHandler("onPlayerToptimeImprovement",getRootElement(), onTopTime) 

Edited by Guest
Link to comment

You forgot to add the 2 brackets(), try this:

That doesn't change anything.

Try:

function onTopTime (player,newPos,newTime,oldPos,oldTime,random1,random2) 
     local account = getPlayerAccount(player) 
    if account then 
    if not isGuestAccount(account) then 
        if newPos <= 10 then 
            addStat(account, "Top Times", 1) 
        end 
    end 
end 
addEvent("onPlayerToptimeImprovement",true) 
addEventHandler("onPlayerToptimeImprovement",getRootElement(), onTopTime) 

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