Why the hell when I choose to withdraw 2000 money, and I've already got 15000 on me, the bank balance increases...
iMoney[] is money in bank
PHP Code:
if(iMoney[id] >= 2000)
{
if(cs_get_user_money(id) <= 14000)
{
cs_set_user_money(id, cs_get_user_money(id) + 2000)
iMoney[id]-=2000;
client_printc(id, "\g[ BANK ]\n You've just withdrawn 2000$ money from your bank account")
}
else if(cs_get_user_money(id) > 14000)
{
iMoney[id]-= 16000 - cs_get_user_money(id);
client_printc(id, "\g[ BANK ]\n You've just withdrawn %d$ money from your bank account", 16000 - cs_get_user_money(id))
cs_set_user_money(id, 16000)
}
else if(cs_get_user_money(id) == 16000)
{
client_printc(id, "\g[ BANK ]\n You already have maximum amount of money")
}
Save_MySql(id);
}
else
{
client_printc(id, "\g[ BANK ]\n You can't withdraw that much, you have only %d$", iMoney[id])
}
WithdrawMenu(id);
Screenies -
Before withdraw:
After:
Also need help with this, because it is not working, like there is menu option other value, when u choose it you get messagemode ...
here is the code:
PHP Code:
new szArg[4]
read_argv(1, szArg, charsmax(szArg))
new iArg = str_to_num(szArg)
if(iMoney[id] >= iArg)
{
if(cs_get_user_money(id) + iArg >= 16000)
{
iMoney[id]-= 16000 - cs_get_user_money(id);
client_printc(id, "\g[ BANK ]\n You've just withdrawn %d$ money from your bank account", 16000 - cs_get_user_money(id))
cs_set_user_money(id, 16000)
}
else
{
iMoney[id]-= iArg;
client_printc(id, "\g[ BANK ]\n You've just withdrawn %d$ money from your bank account", iArg)
cs_set_user_money(id, cs_get_user_money(id) + iArg )
}
}
else
{
client_printc(id, "\g[ BANK ]\n You can't withdraw that much, you have only %d$", iMoney[id])
}
Save_MySql(id);
}
When I click on Other value, messagemode comes up but when I enter some numbers and press Enter - nothing happens