#1

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);
Reply
#2

anyone?
Reply
#3

Try this http://pawn.pastebin.com/icdXxZYb
Reply
#4

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?
Reply
#5

************anyone?*****************8
Reply
#6

up up up
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)