Raised This Month: $ Target: $400
 0% 

need some logical help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-03-2011 , 11:57   need some logical help
Reply With Quote #1

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(idcs_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(id16000)
                }
                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(1szArgcharsmax(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(id16000)
        }
        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(idcs_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

Last edited by reinert; 01-03-2011 at 12:07.
reinert is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode