Jump to content

Show bank money


S3M

Recommended Posts

addCommandHandler ( "money", -- Attach the command handler to our function. 
    function ( thePlayer ) 
        local account = getPlayerAccount ( thePlayer ) -- Get the player account. 
        if ( not isGuestAccount ( account ) ) then -- If the account isn't guest. 
            local balance = tonumber ( getAccountData ( account, "bank.balance" ) ) or 0 -- Get the account bank balance. 
            outputChatBox ( "Your bank balance is $".. balance, thePlayer, 0, 255, 0 ) -- Output the balance to the player. 
        end -- End the guest account check. 
    end -- End the function. 
) 

Read the comments.

Link to comment
addCommandHandler ( "money", -- Attach the command handler to our function. 
    function ( thePlayer ) 
        local account = getPlayerAccount ( thePlayer ) -- Get the player account. 
        if ( not isGuestAccount ( account ) ) then -- If the account isn't guest. 
            local balance = tonumber ( getAccountData ( account, "bank.balance" ) ) or 0 -- Get the account bank balance. 
            outputChatBox ( "Your bank balance is $".. balance, thePlayer, 0, 255, 0 ) -- Output the balance to the player. 
        end -- End the guest account check. 
    end -- End the function. 
) 

Read the comments.

Whaaaa!!! ThX m8.... Now wen i typ /money then al players on server see this? then it is good :D

Link to comment

You want this:

All players must see your bank balance?

addCommandHandler ( "money", 
    function ( thePlayer ) 
        local account = getPlayerAccount ( thePlayer ) 
        if ( not isGuestAccount ( account ) ) then 
            local balance = tonumber ( getAccountData ( account, "bank.balance" ) ) or 0 
            outputChatBox ( "Your bank balance is $".. balance, root, 0, 255, 0 ) -- Use predefined variable root. 
        end 
    end 
) 

Link to comment
addCommandHandler ( "money", 
    function ( thePlayer ) 
        local account = getPlayerAccount ( thePlayer ) 
        if ( not isGuestAccount ( account ) ) then 
            local balance = tonumber ( getAccountData ( account, "bank.balance" ) ) or 0 
            outputChatBox (getPlayerName(thePlayer).." balance is $".. balance, root, 0, 255, 0 ) -- Use predefined variable root. 
        end 
    end 
) 

It will output chat like

Blazy balance is $1542222

Link to comment
addCommandHandler ( "money", 
    function ( thePlayer ) 
        local account = getPlayerAccount ( thePlayer ) 
        if ( not isGuestAccount ( account ) ) then 
            local balance = tonumber ( getAccountData ( account, "bank.balance" ) ) or 0 
            outputChatBox (getPlayerName(thePlayer).." balance is $".. balance, root, 0, 255, 0 ) -- Use predefined variable root. 
        end 
    end 
) 

It will output chat like

Blazy balance is $1542222

Ohw yeah!!!! ThX you very very much toooooooo :wink:

Link to comment

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...