Legacy GM Need help with get_integer_async [SOLVED]

J

Julian244

Guest
Hey, i never did something like working with strings and numbers together and i'm from germany so please dont talk about my english^^

I already posted this and i still need help but no one answered at the old post so some one already tried to help me with this code:

Create:
Code:
ih_amount = -1;
When the message should pop up:
Code:
ih_amount = get_integer_async("Wie viel willst du aufladen?", 0);
Asynchronous Dialog event:
Code:
if (async_load[? 'id'] == ih_amount) {
  if (async_load[? 'status']) {
    global.money += async_load[? 'value'];
    global.worth -= async_load[? 'value'];
  }
}
but it wont do the 'global.worth -= async_load[? 'value'];' and i dont understand the code..... Oh and sometime i get asked twice (ih_amount = get_integer_async("Wie viel willst du aufladen?", 0); )
If you have any questions or i forgot something then ask it please!
 
J

Julian244

Guest
the global.worth -= async_load[? 'value']; part should work now it was my mistake.... and it looks like i wont get asked twice again.....
 

TheouAegis

Member
Just a hunch, try this:
Code:
if (async_load[? 'id'] == ih_amount) {
  if (async_load[? 'status']) {
    var val = async_load[? 'value'];
    global.money += val;
    global.worth -= val;
  }
}
edit: slow ninja'd :D
 
Top