Oh ok. Do you mean something like this:
PHP Code:
g_money[id] = str_to_num(data)
-->
g_money[id] = str_to_num(item)
Then check if item is MENU_EXIT, MENU_NEXT and MENU_BACK. I tried to find some plugins which use something like this, but I couldn't find something.