SA-MP Forums Archive
bank - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: bank (/showthread.php?tid=225896)



bank - omer5198 - 14.02.2011

i dont know why but i have a problem with how to see how much i deposited and withdraw... (and see my balance)i try to do it with format and with %s or %d but none of it works!!! .another thing is that when i go to my file to see my amount of money it doesn't show me the right number... i mean sometimes it show me 2506 even that i deposited only 100... plz help!!!
deposit+withdraw+balance commands:
pawn Код:
if(dialogid == 5)
        {
        if(!response){
            SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
        }
  if(strlen(inputtext) > 0)
                 {
                     new string[128];
                     new playermoney = GetPlayerMoney(playerid);
                     new money = strval(inputtext);
                     new cash = PlayerInfo[playerid][BankMoney] += money;
                     if(playermoney >= money)
                     {
                     GivePlayerMoney(playerid, -money);
                     format(string, sizeof(string), "You deposited %s cash in your bank account. now you have %s in you bank account", money);
                     SendClientMessage(playerid, COLOUR_YELLOW, string);
                     dini_Create(file);
                     dini_IntSet(file, "Bank Money",cash);
                     }
                     else{
                     SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money!!!");
                     }
                 }
                 else
                 {
                     SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money!!!");
                 }
            }
   if(dialogid == 6){
   if(!response){
            SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
        }
   if(strlen(inputtext) > 0)
        {
        new string[128];
        new playermoney = GetPlayerMoney(playerid);
        new money = strval(inputtext);
        new cash = PlayerInfo[playerid][BankMoney] -= money;
        if(PlayerInfo[playerid][BankMoney] >= money)
        {
        dini_IntSet(file, "BankMoney",cash);
        GivePlayerMoney(playerid, money);
        format(string, sizeof(string), "You withdraw %s from your bank account. now you have %s in you bank account", money, cash);
        SendClientMessage(playerid, COLOUR_GREEN, string);
        }
        else{
        SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money on your bank account!!!");
        }
    }
    else{
          SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money!!!");
        }
 }
this is on another place...:
pawn Код:
new cash = PlayerInfo[playerid][BankMoney];
                    SendClientMessage(playerid, COLOUR_YELLOW, "You have on you bank account %s money", cash);



Re: bank - omer5198 - 14.02.2011

anyone?


Re: bank - HyperZ - 14.02.2011

Try this http://pawn.pastebin.com/icdXxZYb


Re: bank - omer5198 - 15.02.2011

Quote:
Originally Posted by Clive
Посмотреть сообщение
thx it works but i got to things to tell you:
1)what did you do?
2)when i dont have the amount of money in deposit/withdraw it says "you dont have this amount of money" but it still deposit/withdraw money from my bank account it only doesn't give the player the money...
another thing that if you type in deposit a huge number/numbet with -$$$$ it take put your money into -61717177246 or another huge number and put a huge number in bank... then you can just /kill and you have alot of money... how can i fix both of my problems?


Re: bank - omer5198 - 15.02.2011

************anyone?*****************8


Re: bank - omer5198 - 15.02.2011

up up up