Quote:
Originally Posted by reinert
Ok thanks, I will try it, And I'm almost sure that this line:
client_print(id, print_chat, "[ BANK ] You have withdrawn $%d.")
should be
client_print(id, print_chat, "[ BANK ] You have withdrawn $%d.", iAmount)
|
Probably. You can print what ever you want there.
Quote:
Originally Posted by reinert
other value still doesn't work, and menu closes sometimes itself I don't want it :S,
|
Maybe I will have to test that part. It should reopen the menu after you submit your value. If you want it to stay open you should show the menu again in that option in the switch() statement and not in the Withdraw_Other_Value() function.
Quote:
Originally Posted by reinert
And is it possible to make that if user has less than 16000 in bank, the 16000 option will be shown in grey. And I like my menu style more, because I think it's easier :S
|
Yes, you can redo the menu part and to do that. However, at the very least, I would suggest that you do something like:
PHP Code:
formatex(szString, charsmax(szString), "%s$1000", iMoney[id] >= 1000 ? "" : "\d")
menu_additem(menu, szString, "1000")
// etc.
Or, you need to use a callback (which would actually disable the button).
Quote:
Originally Posted by reinert
I just want some logical help here:
If user has more than 15000 (15001, 15002 etc..), and he choose to withdraw 1000 money, the maximum amount of money is 16000, so how could I make, that he gets maximum, but the rest money goes back to his bank balance.
something like that, yeah ?
iMoney[id]-= 1000 - (16000 - cs_get_user_money(id))
I've got 15500 on me, 1000 - (16000 - 15500)) = 500. I think I'm right xD
|
That is why I put the comment:
PHP Code:
// Optionally you could process a partial withdrawal to be at $16000 in-game (must return true instead of false).
Also, I would seriously suggest not trying to do the whole process in one line. It can be confusing (obviously since you don't know if that works). Also, use the cached value iUserMoney instead of cs_get_user_money(id), using iUserMoney is an optimization that you really need to learn when using a value several times.
I helped you on the overall layout of the withdrawal system, it should be much easier to deal with like this. You can modify it from here since you are wanting to do this yourself.
__________________