Memory Posted September 18, 2012 Share Posted September 18, 2012 Hi, Doesn't work this code (points don't reset). addCommandHandler ( "resetpoints", function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do setElementData ( player, "Points", 0 ) local account = getPlayerAccount ( player ) if isGuestAccount ( account ) then setAccountData ( account, "Points", 0 ) end end end ) Please, can you are fix? Link to comment
TAPL Posted September 18, 2012 Share Posted September 18, 2012 if isGuestAccount ( account ) then to if not isGuestAccount ( account ) then Link to comment
Memory Posted September 18, 2012 Author Share Posted September 18, 2012 Work, thank you Link to comment
Memory Posted September 19, 2012 Author Share Posted September 19, 2012 Again problem with it. Points is reseted for only a players, who is online. Link to comment
Guest Guest4401 Posted September 19, 2012 Share Posted September 19, 2012 Again problem with it.Points is reseted for only a players, who is online. It should reset points for all accounts? addCommandHandler("resetpoints", function() for _,player in ipairs(getElementsByType'player') do setElementData(player,"Points",0) end for _,account in ipairs(getAccounts()) do setAccountData(account,"Points",0) end end ) Link to comment
TwiX! Posted September 19, 2012 Share Posted September 19, 2012 addCommandHandler ( "resetpoints", function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do setElementData ( player, "Points", 0 ) end for i,v in ipairs(getAccounts()) do setAccountData ( v, "Points", 0 ) end end ) Edit: Again problem with it.Points is reseted for only a players, who is online. It should reset points for all accounts? addCommandHandler("resetpoints", function() for _,player in ipairs(getElementsByType'player') do setElementData(player,"Points",0) end for _,account in ipairs(getAccounts()) do setAccountData(account,"Points",0) end end ) you were faster btw will error in your code line 3 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