23.11.2010, 03:03
(
Последний раз редактировалось randomkid88; 23.11.2010 в 13:58.
Причина: Errors: Sorry, I was tired :-)
)
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;
}