22.12.2014, 21:04
try:
pawn Код:
CMD:sdeposit(playerid, params[])
{
new amount, string[256];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerNearBankBooth(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not near a bank booth.");
if(sscanf(params, "i", amount)) return SendClientMessage(playerid, USAGE, "[Usage]: /sdeposit [amount]");
if(amount > PlayerInfo[playerid][pMoney]) return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money on you.");
if(amount <= 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid money amount.");
if(PlayerInfo[playerid][pSavings]+amount > 50000 || PlayerInfo[playerid][pSavings] >= 50000) return SendClientMessage(playerid, COLOR_GREY, "You cannot deposit any more into your savings account.");
PlayerInfo[playerid][pSavings] += amount;
GiveDodMoney(playerid, -amount);
format(string, sizeof(string), " You have deposited $%d into your savings account, your savings balance is now: $%d.", amount, PlayerInfo[playerid][pSavings]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
pawn Код:
if(PlayerInfo[playerid][pSavings]+amount > 50000 || PlayerInfo[playerid][pSavings] >= 50000) return ................

