#Paper Posted August 2, 2011 Share Posted August 2, 2011 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
JR10 Posted August 2, 2011 Share Posted August 2, 2011 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
#Paper Posted August 2, 2011 Author Share Posted August 2, 2011 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
Jaysds1 Posted August 2, 2011 Share Posted August 2, 2011 (edited) 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 August 2, 2011 by Guest Link to comment
JR10 Posted August 2, 2011 Share Posted August 2, 2011 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
AGENT_STEELMEAT Posted August 3, 2011 Share Posted August 3, 2011 is onPlayerToptimeImprovment being triggered? Make the first thing in that function outputDebugString and see what happens. Link to comment
#Paper Posted August 3, 2011 Author Share Posted August 3, 2011 i tryed too whit debugstrings beetween "if account then" and "if not isGuestAccount(account) then" but doesn't appear Btw it's triggered from "race_toptimes/toptimes_server.lua" Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now