24.04.2015, 13:29
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:
{
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;
}
If you need more code from this comment bellow