S3M Posted May 3, 2012 Share Posted May 3, 2012 Hi there, I using bank system made by 50p on server. Now i want that is shows al player bankmoney in chat wen player typ /money Someone can make this code for me? THX Link to comment
Castillo Posted May 3, 2012 Share Posted May 3, 2012 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
S3M Posted May 3, 2012 Author Share Posted May 3, 2012 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 Link to comment
Kenix Posted May 3, 2012 Share Posted May 3, 2012 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
S3M Posted May 3, 2012 Author Share Posted May 3, 2012 You want this:All players must see your bank balance? yes! like if player typ /money then al players see "playername $money" Thx Link to comment
Kenix Posted May 3, 2012 Share Posted May 3, 2012 Also read more about root https://wiki.multitheftauto.com/wiki/Element_tree Link to comment
Wei Posted May 3, 2012 Share Posted May 3, 2012 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
S3M Posted May 3, 2012 Author Share Posted May 3, 2012 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 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