Doesn't work Y_Ini atm withdraw
#5

Quote:
Originally Posted by Sasino97
Посмотреть сообщение
Hello, by doing this:

PHP код:
inputtext[256
You are getting the 257th character in the input string, not the numerical value of the string.
Please see Strval.

In your case:

PHP код:
case atm_withdraw:
{
    if (!
response)
        return 
1;
    
// no need to check also if(response) because if(!response) already stopped the code returning 1.
    
    
new inputvalue// we create an integer variable
    
inputvalue strval(inputtext); // we set its value to the integer value of the string "inputtext"
    
    // inputtext[256] is wrong, we will now use inputvalue
    
    
if (inputvalue <= 0// <= means less than or equal to (similarly you can use >=)
        
return 1;
        
    
// again, no need for an else {} block here, because if inputvalue <= 0 then the code stops there
    
    
if (PlayerInfo[playerid][pBankMoney] >= inputvalue)
    {
        
GivePlayerMoney(playeridinputvalue);
        
PlayerInfo[playerid][pBankMoney] -= inputvalue;
    }

Appreciate Your help.
Reply


Messages In This Thread
Doesn't work Y_Ini atm withdraw - by bujase1337 - 25.06.2018, 22:57
Re: Doesn't work Y_Ini atm withdraw - by bujase1337 - 26.06.2018, 10:38
Re: Doesn't work Y_Ini atm withdraw - by Sasino97 - 26.06.2018, 11:07
Re: Doesn't work Y_Ini atm withdraw - by GTLS - 26.06.2018, 15:00
Re: Doesn't work Y_Ini atm withdraw - by bujase1337 - 26.06.2018, 16:35

Forum Jump:


Users browsing this thread: 1 Guest(s)