Author Topic:  Help with atm script  (Read 216 times)

0 Members and 1 Guest are viewing this topic.

oAizen

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
    • Awards
Help with atm script
« on: February 20, 2017, 06:35:49 PM »
Hey miners! i found a script on here not that long ago for atms that was posted by craig, the script used the input [Amount] option. I did the script as posted and was wondering if there was a way to show the total balance that each player has in their atms. Right now it allows you to deposit/withdrawal money, what im wondering is can you make it so it shows the amount of gold pieces deposited into the atm? heres what i got so far

Script name:Deposit

Input [Amount]
If
HasInventory [player] [gold pieces] [>=] [Amount]
then
History [Bank Balance] [player] [+Amount]
Inventory [Player] [take] [gold pieces] [Amount]
Notify [ [Amount] gold pieces deposited] [Local]
Else
Notify [You dont have enough gold pieces to make this deposit] [local]
Endif

--------
Script:Withdraw

Input [Amount]
If
HasHistory [Bank Balance] [player] [>=] [Amount]
Then
History [Bank Balance] [player] [-Amount]
Inventory [player] [add] [gold pieces] [Amount]
Notify [ [Amount] Gold pieces withrawn] [local]
else
notify [You dont have enough gold pieces in your account to make this withdrawal] [local]
Endif
---------------------------

So im using a menu script that opens a window that has the following options for player to use

-Withdraw Money
-Deposit money

What i wanna squeez in the menu is like a option that allows you to see the total amount of gold pieces you've deposited into the atm. Something like

-Withdraw Money
-Deposit Money
-Balance       < Activating this option would show you the amount of gp in your atm.

Any help would be greatly appreciated! been trying to figure it out for a lil while now and cant figure out how to display it in a menu script X.X Thanks in advance!. Also thank you craig for posting this awesome atm script!

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6499
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Help with atm script
« Reply #1 on: February 20, 2017, 07:50:47 PM »
You could put the balance amount directly in the menu item text.

Menu [[ATM]] [[Withdraw][Bank\Withdraw]] [[Deposit][Bank\Deposit]] [[Balance: [history:bank balance]][]]