Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:deposit(playerid, params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1223.14917, -1425.56458, 13.67706))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not at the bank!");
- return 1;
- }
- if(PlayerInfo[playerid][pFreezeBank] == 1) return SendClientMessageEx(playerid, COLOR_GREY, "Your bank is currently frozen"); if(PlayerInfo[playerid][pATM] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have Bank Account");
- new string[128], amount[32], dollars, cents, duit[32], dollars2;
- if(sscanf(params, "s[32]", amount))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /deposit [Amount]");
- format(string, sizeof(string), " You have %s in your account.", FormatMoney(PlayerInfo[playerid][pAccount]));
- SendClientMessageEx(playerid, COLOR_GRAD3, string);
- return 1;
- }
- if(strfind(amount, ".", true) != -1 && strfind(amount, ",", true) != -1 || strfind(amount, ",", true) != -1)
- {
- sscanf(amount, "p<,>dp<.>dd", dollars2, dollars, cents);
- format(duit, sizeof(duit), "%d%02d%03d", dollars2, dollars, cents);
- if (strval(duit) > GetPlayerCash(playerid))
- {
- SendClientMessageEx(playerid, COLOR_GREY, " You don't have that much money.");
- return 1;
- }
- GivePlayerCash(playerid,-strval(duit));
- new curfunds = PlayerInfo[playerid][pAccount];
- PlayerInfo[playerid][pAccount]=strval(duit)+PlayerInfo[playerid][pAccount];
- SendClientMessageEx(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
- format(string, sizeof(string), " Old Balance: %s", FormatMoney(curfunds));
- SendClientMessageEx(playerid, COLOR_GRAD2, string);
- format(string, sizeof(string), " Deposit: %s", FormatMoney(strval(money)));
- SendClientMessageEx(playerid, COLOR_GRAD4, string);
- SendClientMessageEx(playerid, COLOR_GRAD6, "|-----------------------------------------|");
- format(string, sizeof(string), " New Balance: %s", FormatMoney(PlayerInfo[playerid][pAccount]));
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement