Bank problem
#1

PHP код:
        case DIALOG_BANK:
        {
            if(!
response) return SendClientMessage(playerid,-1,""COLOR_WG"wg:{FFFFFF} Zatvarate bank menu");
            {
                if(
response)
                {
                    switch(
listitem)
                    {
                        case 
0:
                        {
                            new 
banka PlayerInfo[playerid][pBankNovac];
                            new 
poruka[128],statut[128];
                            {
                                
format(poruka,sizeof(poruka),"{FFFFFF}Bank racun od"COLOR_WG" %s.{FFFFFF}\n\nVase stanje na racunu je: $%d\n\nHint:\nImate nedostatak novca? - Podignite kredit!",GetName(playerid),banka);
                                
strcat(statut,poruka);
                                
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_MSGBOX,""COLOR_ZUTA"Stanje u banci",statut,"Uredu","");
                            }
                        }
                        case 
1:
                        {
                            
ShowPlayerDialogplayeridDIALOG_BANK_OSTAVIDIALOG_STYLE_INPUT""COLOR_ZUTA"Ostavite novac""{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite ostaviti\nna vas racun u banci. ""Unesi""Izlaz" );
                        }
                        case 
2:
                        {
                            
ShowPlayerDialogplayeridDIALOG_BANK_PODIGNIDIALOG_STYLE_INPUT""COLOR_ZUTA"Podignite novac""{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite podignuti\nsa vaseg racuna u banci.""Unesi""Izlaz" );
                        }
                    }
                }
                return 
1;
            }
        }
        case 
DIALOG_BANK_OSTAVI:
        {
            if(
response)
            {
                if(!
isnumeric(inputtext)) return SendClientMessage(playerid,-1""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
                
if(strval(inputtext) > GetPlayerMoney(playerid) ) return SendClientMessageplayerid,-1""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu " );
                
PlayerInfo[playerid][pBankNovac] = (PlayerInfo[playerid][pBankNovac] - strval(inputtext));
                
GivePlayerMoney(playeridstrval(inputtext));
                new 
String[256];
                
format(Stringsizeof String""COLOR_WG"WG:{FFFFFF} Ostavili ste $%i na racun u banci.Preostalo novca u banci: $%i"strvalinputtext ), PlayerInfo[playerid][pBankNovac] );
                
SendClientMessage(playerid, -1String);
            }
            else if( !
response )
            {
                
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
            }
            return 
1;
        }
        case 
DIALOG_BANK_PODIGNI:
        {
            if( 
response )
            {
                if( !
isnumericinputtext ) ) return SendClientMessage(playerid, -1""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
                
if( strvalinputtext ) > PlayerInfo[playerid][pBankNovac] ) return SendClientMessageplayerid, -1""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu u banci");
                
PlayerInfo[playerid][pBankNovac] = ( PlayerInfo[playerid][pBankNovac] - strvalinputtext ) );
                
GivePlayerMoneyplayeridstrvalinputtext ) );
                new 
String[256];
                
formatStringsizeof String""COLOR_WG"WG:{FFFFFF} Podigli ste $%d sa vaseg racuna u banci. Sada imate $%d na bankovnom racunu."strvalinputtext ), PlayerInfo[playerid][pBankNovac] ); // formatting amessage which shows the amount you withdrew, and the money you have left
                
SendClientMessageplayerid, -1String );
            }
            else if( !
response )
            {
                
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
            }
            return 
1;
        } 
I really don't know whats wrong here? I mean when i deposit (e.g. 1000$) it saves just $1.
If you need more code from this comment bellow
Reply
#2

what is the meaning of Ostavi and Podigni?
Reply
#3

Can you translate these codes to English please?
Reply
#4

if Ostavi means deposit then try this:
Quote:

case DIALOG_BANK:
{
if(!response) return SendClientMessage(playerid,-1,""COLOR_WG"wg:{FFFFFF} Zatvarate bank menu");
{
if(response)
{
switch(listitem)
{
case 0:
{
new banka = PlayerInfo[playerid][pBankNovac];
new poruka[128],statut[128];
{
format(poruka,sizeof(poruka),"{FFFFFF}Bank racun od"COLOR_WG" %s.{FFFFFF}\n\nVase stanje na racunu je: $%d\n\nHint:\nImate nedostatak novca? - Podignite kredit!",GetName(playerid),banka);
strcat(statut,poruka);
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE _MSGBOX,""COLOR_ZUTA"Stanje u banci",statut,"Uredu","");
}
}
case 1:
{
ShowPlayerDialog( playerid, DIALOG_BANK_OSTAVI, DIALOG_STYLE_INPUT, ""COLOR_ZUTA"Ostavite novac", "{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite ostaviti\nna vas racun u banci. ", "Unesi", "Izlaz" );
}
case 2:
{
ShowPlayerDialog( playerid, DIALOG_BANK_PODIGNI, DIALOG_STYLE_INPUT, ""COLOR_ZUTA"Podignite novac", "{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite podignuti\nsa vaseg racuna u banci.", "Unesi", "Izlaz" );
}
}
}
return 1;
}
}
case DIALOG_BANK_OSTAVI:
{
if(response)
{
if(!isnumeric(inputtext)) return SendClientMessage(playerid,-1, ""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
if(strval(inputtext) > GetPlayerMoney(playerid) ) return SendClientMessage( playerid,-1, ""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu " );
PlayerInfo[playerid][pBankNovac] = (PlayerInfo[playerid][pBankNovac] + strval(inputtext));
GivePlayerMoney(playerid, -strval(inputtext));
new String[256];
format(String, sizeof String, ""COLOR_WG"WG:{FFFFFF} Ostavili ste $%i na racun u banci.Preostalo novca u banci: $%i", strval( inputtext ), PlayerInfo[playerid][pBankNovac] );
SendClientMessage(playerid, -1, String);
}
else if( !response )
{
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE _LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
}
return 1;
}
case DIALOG_BANK_PODIGNI:
{
if( response )
{
if( !isnumeric( inputtext ) ) return SendClientMessage(playerid, -1, ""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
if( strval( inputtext ) > PlayerInfo[playerid][pBankNovac] ) return SendClientMessage( playerid, -1, ""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu u banci");
PlayerInfo[playerid][pBankNovac] = ( PlayerInfo[playerid][pBankNovac] - strval( inputtext ) );
GivePlayerMoney( playerid, strval( inputtext ) );
new String[256];
format( String, sizeof String, ""COLOR_WG"WG:{FFFFFF} Podigli ste $%d sa vaseg racuna u banci. Sada imate $%d na bankovnom racunu.", strval( inputtext ), PlayerInfo[playerid][pBankNovac] ); // formatting amessage which shows the amount you withdrew, and the money you have left
SendClientMessage( playerid, -1, String );
}
else if( !response )
{
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE _LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
}
return 1;
} [/pawn]
if PODIGNI means deposit then try this:
[pawn]
case DIALOG_BANK:
{
if(!response) return SendClientMessage(playerid,-1,""COLOR_WG"wg:{FFFFFF} Zatvarate bank menu");
{
if(response)
{
switch(listitem)
{
case 0:
{
new banka = PlayerInfo[playerid][pBankNovac];
new poruka[128],statut[128];
{
format(poruka,sizeof(poruka),"{FFFFFF}Bank racun od"COLOR_WG" %s.{FFFFFF}\n\nVase stanje na racunu je: $%d\n\nHint:\nImate nedostatak novca? - Podignite kredit!",GetName(playerid),banka);
strcat(statut,poruka);
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE _MSGBOX,""COLOR_ZUTA"Stanje u banci",statut,"Uredu","");
}
}
case 1:
{
ShowPlayerDialog( playerid, DIALOG_BANK_OSTAVI, DIALOG_STYLE_INPUT, ""COLOR_ZUTA"Ostavite novac", "{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite ostaviti\nna vas racun u banci. ", "Unesi", "Izlaz" );
}
case 2:
{
ShowPlayerDialog( playerid, DIALOG_BANK_PODIGNI, DIALOG_STYLE_INPUT, ""COLOR_ZUTA"Podignite novac", "{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite podignuti\nsa vaseg racuna u banci.", "Unesi", "Izlaz" );
}
}
}
return 1;
}
}
case DIALOG_BANK_OSTAVI:
{
if(response)
{
if(!isnumeric(inputtext)) return SendClientMessage(playerid,-1, ""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
if(strval(inputtext) > GetPlayerMoney(playerid) ) return SendClientMessage( playerid,-1, ""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu " );
PlayerInfo[playerid][pBankNovac] = (PlayerInfo[playerid][pBankNovac] - strval(inputtext));
GivePlayerMoney(playerid, strval(inputtext));
new String[256];
format(String, sizeof String, ""COLOR_WG"WG:{FFFFFF} Ostavili ste $%i na racun u banci.Preostalo novca u banci: $%i", strval( inputtext ), PlayerInfo[playerid][pBankNovac] );
SendClientMessage(playerid, -1, String);
}
else if( !response )
{
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE _LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
}
return 1;
}
case DIALOG_BANK_PODIGNI:
{
if( response )
{
if( !isnumeric( inputtext ) ) return SendClientMessage(playerid, -1, ""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
if( strval( inputtext ) > PlayerInfo[playerid][pBankNovac] ) return SendClientMessage( playerid, -1, ""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu u banci");
PlayerInfo[playerid][pBankNovac] = ( PlayerInfo[playerid][pBankNovac] + strval( inputtext ) );
GivePlayerMoney( playerid, - strval( inputtext ) );
new String[256];
format( String, sizeof String, ""COLOR_WG"WG:{FFFFFF} Podigli ste $%d sa vaseg racuna u banci. Sada imate $%d na bankovnom racunu.", strval( inputtext ), PlayerInfo[playerid][pBankNovac] ); // formatting amessage which shows the amount you withdrew, and the money you have left
SendClientMessage( playerid, -1, String );
}
else if( !response )
{
ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE _LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
}
return 1;
}

Reply
#5

"Ostavi" means deposit. "Podigni" means withdraw.
Reply
#6

Then try the this one it will 100% work
pawn Код:
case DIALOG_BANK:
        {
            if(!response) return SendClientMessage(playerid,-1,""COLOR_WG"wg:{FFFFFF} Zatvarate bank menu");
            {
                if(response)
                {
                    switch(listitem)
                    {
                        case 0:
                        {
                            new banka = PlayerInfo[playerid][pBankNovac];
                            new poruka[128],statut[128];
                            {
                                format(poruka,sizeof(poruka),"{FFFFFF}Bank racun od"COLOR_WG" %s.{FFFFFF}\n\nVase stanje na racunu je: $%d\n\nHint:\nImate nedostatak novca? - Podignite kredit!",GetName(playerid),banka);
                                strcat(statut,poruka);
                                ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_MSGBOX,""COLOR_ZUTA"Stanje u banci",statut,"Uredu","");
                            }
                        }
                        case 1:
                        {
                            ShowPlayerDialog( playerid, DIALOG_BANK_OSTAVI, DIALOG_STYLE_INPUT, ""COLOR_ZUTA"Ostavite novac", "{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite ostaviti\nna vas racun u banci. ", "Unesi", "Izlaz" );
                        }
                        case 2:
                        {
                            ShowPlayerDialog( playerid, DIALOG_BANK_PODIGNI, DIALOG_STYLE_INPUT, ""COLOR_ZUTA"Podignite novac", "{FFFFFF}Postovani. Molimo unesite odredenu kolicinu novca koju zelite podignuti\nsa vaseg racuna u banci.", "Unesi", "Izlaz" );
                        }
                    }
                }
                return 1;
            }
        }
        case DIALOG_BANK_OSTAVI:
        {
            if(response)
            {
                if(!isnumeric(inputtext)) return SendClientMessage(playerid,-1, ""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
                if(strval(inputtext) > GetPlayerMoney(playerid) ) return SendClientMessage( playerid,-1, ""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu " );
                PlayerInfo[playerid][pBankNovac] = (PlayerInfo[playerid][pBankNovac] + strval(inputtext));
                GivePlayerMoney(playerid, -strval(inputtext));
                new String[256];
                format(String, sizeof String, ""COLOR_WG"WG:{FFFFFF} Ostavili ste $%i na racun u banci.Preostalo novca u banci: $%i", strval( inputtext ), PlayerInfo[playerid][pBankNovac] );
                SendClientMessage(playerid, -1, String);
            }
            else if( !response )
            {
                ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
            }
            return 1;
        }
        case DIALOG_BANK_PODIGNI:
        {
            if( response )
            {
                if( !isnumeric( inputtext ) ) return SendClientMessage(playerid, -1, ""COLOR_CRVENA"Greska:{FFFFFF} Molimo upisite kolicinu [u brojevima]."); // this will check if the inputtext contains numbers
                if( strval( inputtext ) > PlayerInfo[playerid][pBankNovac] ) return SendClientMessage( playerid, -1, ""COLOR_CRVENA"Greska:{FFFFFF} Nemate toliko novca na vasem racunu u banci");
                PlayerInfo[playerid][pBankNovac] = ( PlayerInfo[playerid][pBankNovac] - strval( inputtext ) );
                GivePlayerMoney( playerid, strval( inputtext ) );
                new String[256];
                format( String, sizeof String, ""COLOR_WG"WG:{FFFFFF} Podigli ste $%d sa vaseg racuna u banci. Sada imate $%d na bankovnom racunu.", strval( inputtext ), PlayerInfo[playerid][pBankNovac] ); // formatting amessage which shows the amount you withdrew, and the money you have left
                SendClientMessage( playerid, -1, String );
            }
            else if( !response )
            {
                ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,""COLOR_ZUTA"Odaberite opciju","{FFFFFF}Ostavi novac\nPodigni novac\nStanje na racunu","Odaberi","Izlaz");
            }
            return 1;
        }
Reply
#7

Thanks!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)