Bank Help
#2

pawn Код:
//Shown here with ZCMD and sscanf:
CMD:deposit(playerid, params[])
{
     new cash, amt, bank;
     cash = GetPlayerMoney(playerid); //Get the amount of cash the player has
     if(sscanf(params, "i", amt)) return SendClientMessage(COLOR_RED, "Usage: /deposit [amount]");
     else if(amt > cash) return SendClientMessage(COLOR_RED, "You do not have this much cash to deposit!");//Check to see if it is more than what you have
     else
     {
          GivePlayerMoney(playerid, -amt);
          bank = PlayerInfo[playerid][pBank];// Substitute how you are storing the bank info
          PlayerInfo[playerid][pBank] = bank+amt; //Update Bank amount in pInfo enum or whatever you have
     }
     return 1;
}
Reply


Messages In This Thread
Bank Help - by Steven82 - 23.11.2010, 02:38
Re: Bank Help - by randomkid88 - 23.11.2010, 03:03
Re: Bank Help - by [DM]Kane - 23.11.2010, 03:25
Re: Bank Help - by BMUK - 23.11.2010, 04:27

Forum Jump:


Users browsing this thread: 1 Guest(s)