Home   Help Search Login Register  

Author Topic: Money System With dialogs  (Read 1793 times)

0 Members and 1 Guest are viewing this topic.

Offline ModestNovice

  • Members
  • *
Money System With dialogs
« on: 18 May 2008, 06:15:33 »
Hello  :)

I am working on a RPG mission. I recently have been making dialogs with a tool made for ofp, if you change some lil bits, they work in ArmA  :good:

But my big question:

How can I make a money system with two variables: bank and cash

I know, or perhaps understand how to do a basic system, I have heard, for instance with SPON Money you can do so by attaching the variable to a vehicle???  ???

Thats where I am lost.

I am probably going to start off with the basic cash. dcv_cash = 10000;     just like startmoney = ...
then, for paychecks. DCV_cash = DCV_cash + money;  This is where it gets hard for me, trying to bring in two variables and have it separate for each player, and remember their balances.

Also: I want to use _amount = parseNumber, but I know there is more to the code, how do I properly use parseNumber to find the value entered?

Any help is appreciated  :)

"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Money System With dialogs
« Reply #1 on: 18 May 2008, 08:29:36 »
You might want to check Spoon Money before starting anything from scratch.

Offline ModestNovice

  • Members
  • *
Re: Money System With dialogs
« Reply #2 on: 18 May 2008, 19:07:41 »
yeah thats what I started with  :D

but was getting a weird bug to where my shop would have all guns, but if I withdrew money, everything would be gone... :dunno: and it would start lagging to hell... :blink:

but it would only do this for weapon shops, vehicle shops would work perfectly.  ???
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Rommel92

  • Members
  • *
Re: Money System With dialogs
« Reply #3 on: 18 May 2008, 22:27:10 »
Code: [Select]
/* Declarations of variables and values */
Bank_Cash = 500;
Pocket_Cash = 100;

_Amount = Bank_Cash; /* _Amount now == 500 */
sleep 240.0
_paycheck = 200;
Pocket_cash = Pocket_cash + _paycheck; /* Paycheck idea */
hint format ["You just got %1 cash in your pocket from your paycheck, you now have $%2 in your pocket.",_paycheck,pocket_cash]; /* Hint to show new values */

These are very crude ideas, and very poorly laid out, but hopefully it was just to give you an idea on basic commands for you to use if you do decide to make one from scratch.

Rommz,

Offline ModestNovice

  • Members
  • *
Re: Money System With dialogs
« Reply #4 on: 18 May 2008, 23:14:26 »
Yep that should help. I know the basic money system things, but that will help with using two variables: bank and cash. Thanks Rommel.   :good:

If anyone understands how to use input boxes with numbers and words, I need to have values subtracted, but the value you withdrew...can u please help?
« Last Edit: 18 May 2008, 23:17:33 by DaChevs »
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Money System With dialogs
« Reply #5 on: 19 May 2008, 00:41:53 »
If you have a text control (editable or not) with its corresponding idc, then all you need to use is ctrlText command and then parseNumber command to get the number from the text string.

Code: [Select]
// 1112 is the icd of the text control.
_quantity = parseNumber (ctrlText 1112);

Offline ModestNovice

  • Members
  • *
Re: Money System With dialogs
« Reply #6 on: 19 May 2008, 02:55:36 »
thanks. Just one question, I have only just started with dialogs, what do you mean icd? is it the class or name or position of the input box? sry I am a n00b at dialogs thats why I use this tool, cuz I don't know much bout dialogs.  :D

maybe I will just try and get SPON Money workin again, I don't know why I am getting that bug, because many missions have used SPON Money and not have problems.
« Last Edit: 19 May 2008, 02:58:30 by DaChevs »
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Rommel92

  • Members
  • *
Re: Money System With dialogs
« Reply #7 on: 19 May 2008, 08:22:14 »
He means IDC, which is the ID of the control (I believe), its default is -1.

Offline ModestNovice

  • Members
  • *
Re: Money System With dialogs
« Reply #8 on: 20 May 2008, 00:27:05 »
removed
« Last Edit: 25 May 2008, 00:48:43 by DaChevs »
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley