HoLsTeN Posted February 2, 2013 Share Posted February 2, 2013 hi .. did any one have idea how to set account data for all players online on server or not ? i dont't have idea ?? how to do it this is the data "ADmoney" xxx = getAllPlayersAccount _ i know there are no function for this but i want you to know what i mean for example : setAccountData(xxx , "ADmoney", 0) Link to comment
Puma Posted February 2, 2013 Share Posted February 2, 2013 This loops through all players and the money on their accounts to 0. for i, p in pairs ( getElementsByType("player") ) do local account = getPlayerAccount(p) if account and not isGuestAccount(account) then setAccountData(account, "ADmoney", 0) end end Put it in your script where you need it to be. Link to comment
Fury Posted February 2, 2013 Share Posted February 2, 2013 xxx = getAllPlayersAccount _ i know there are no function for this but i want you to know what i mean actually there is one; https://wiki.multitheftauto.com/wiki/GetAllAccountData Link to comment
Castillo Posted February 2, 2013 Share Posted February 2, 2013 That's not what he's talking about, what Puma posted is what he's looking for. Link to comment
Fury Posted February 2, 2013 Share Posted February 2, 2013 That's not what he's talking about, what Puma posted is what he's looking for. he was asking about function that gets all account. he says "i know there isnt any function like that" so i show him. i know he's looking for puma's code. im trying to help newbies Link to comment
Anderl Posted February 2, 2013 Share Posted February 2, 2013 Yes, he's asking for a function to get all accounts but the function you're talking about gets all data in a specific account, not a list of account elements. Link to comment
TAPL Posted February 2, 2013 Share Posted February 2, 2013 He's wants to get all registered accounts in the server. for i, account in ipairs(getAccounts()) do setAccountData(account , "ADmoney", 0) end Link to comment
Puma Posted February 2, 2013 Share Posted February 2, 2013 He's wants to get all registered accounts in the server. I quote: "for all players online on server". His English is quite butt though. 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