Turbe$Z Posted February 4 Share Posted February 4 I want to get a data from all accounts on the server, but i get this warning: 'getAccount' [Expected string at argument 1, got account] 'getAccountData' [Expected account at argument 1, got boolean] this is my code: for i, v in pairs(getAccounts()) do names = getAccountData(getAccount(v), "acc:nickname") end outputChatBox(names) What wrong? 1 Link to comment
FlorinSzasz Posted February 4 Share Posted February 4 Well you have to do it like this addCommandHandler('getdata',function(player,commandName) local playersData = {} local accounts = getAccounts() if player then for k,account in ipairs(accounts) do playersData[k] = getAccountData(account,"acc:nickname") end outputChatBox(tostring(inspect(playersData)),player) end end,false,false) 1 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