Newbie Posted March 17, 2014 Share Posted March 17, 2014 [2014-03-16 11:52:10] WARNING: oshEE\panel_server.lua:86: Bad argument @ 'setAccountData' [Expected account at argument 1, got nil] function UpdateMinuteS ( ) for index, player in ipairs ( getElementsByType "account" ) do setAccountData( account,"Time",tostring( getAccountData( account,"Time" ) or 0 )+1 ) end end setTimer ( UpdateMinuteS, 60000, 0 ) From top: local rWins = getAccountData( account,"Wins" ) or 0 local rDeaths = getAccountData( account,"Deaths" ) or 0 local rTime = getAccountData( account,"Time" ) or 0 setElementData( source,"Wins",tostring( rWins ) ) setElementData( source,"Deaths",tostring( rDeaths ) ) setElementData( source,"Time",tostring( rTime ) ) Link to comment
iPrestege Posted March 17, 2014 Share Posted March 17, 2014 getElementsByType 'account' Huh? getAccounts Link to comment
cheez3d Posted March 17, 2014 Share Posted March 17, 2014 There is no "account" type. Use getAccounts() Link to comment
Newbie Posted March 17, 2014 Author Share Posted March 17, 2014 "Account" exists look: addEventHandler( "onPlayerLogin",root, function ( ) local account = getPlayerAccount( source ) if account then if isGuestAccount( account ) then return end local rWins = getAccountData( account,"Wins" ) or 0 local rDeaths = getAccountData( account,"Deaths" ) or 0 local rTime = getAccountData( account,"Time" ) or 0 setElementData( source,"Wins",tostring( rWins ) ) setElementData( source,"Deaths",tostring( rDeaths ) ) setElementData( source,"Time",tostring( rTime ) ) end end I think i failed here: function UpdateMinuteS ( ) for index, player in ipairs ( getElementsByType "account" ) do setAccountData( account,"Time",tostring( getAccountData( account,"Time" ) or 0 )+1 ) end end setTimer ( UpdateMinuteS, 60000, 0 ) Link to comment
iPrestege Posted March 17, 2014 Share Posted March 17, 2014 function UpdateMinuteS ( ) for index, account in ipairs ( getAccounts ( ) ) do if getAccountPlayer ( account ) then setAccountData( account,"Time",tostring( getAccountData( account,"Time" ) or 0 )+1 ) end end end setTimer ( UpdateMinuteS, 60000, 0 ) And you forgot '(' To close the event. 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