Jump to content

set AccountData For All Accounts Register


HoLsTeN

Recommended Posts

Posted

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)

I Am HoLsTeN !

Posted

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.

"The total IQ of the world is a constant.

The more people, the more idiots."

- Anonymous.

Posted

That's not what he's talking about, what Puma posted is what he's looking for.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 :)

Destruction Derby

Posted

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.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

He's wants to get all registered accounts in the server.

for i, account in ipairs(getAccounts()) do 
    setAccountData(account , "ADmoney", 0) 
end 

CiTLh.png
Posted
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.

"The total IQ of the world is a constant.

The more people, the more idiots."

- Anonymous.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...