Advertisement
Naokimaza

Bug deposit

Apr 25th, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. CMD:deposit(playerid, params[])
  2. {
  3. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1223.14917, -1425.56458, 13.67706))
  4. {
  5. SendClientMessageEx(playerid, COLOR_GREY, "You are not at the bank!");
  6. return 1;
  7. }
  8. 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");
  9. new string[128], amount[32], dollars, cents, duit[32], dollars2;
  10. if(sscanf(params, "s[32]", amount))
  11. {
  12. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /deposit [Amount]");
  13. format(string, sizeof(string), " You have %s in your account.", FormatMoney(PlayerInfo[playerid][pAccount]));
  14. SendClientMessageEx(playerid, COLOR_GRAD3, string);
  15. return 1;
  16. }
  17. if(strfind(amount, ".", true) != -1 && strfind(amount, ",", true) != -1 || strfind(amount, ",", true) != -1)
  18. {
  19. sscanf(amount, "p<,>dp<.>dd", dollars2, dollars, cents);
  20. format(duit, sizeof(duit), "%d%02d%03d", dollars2, dollars, cents);
  21. if (strval(duit) > GetPlayerCash(playerid))
  22. {
  23. SendClientMessageEx(playerid, COLOR_GREY, " You don't have that much money.");
  24. return 1;
  25. }
  26. GivePlayerCash(playerid,-strval(duit));
  27. new curfunds = PlayerInfo[playerid][pAccount];
  28. PlayerInfo[playerid][pAccount]=strval(duit)+PlayerInfo[playerid][pAccount];
  29. SendClientMessageEx(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
  30. format(string, sizeof(string), " Old Balance: %s", FormatMoney(curfunds));
  31. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  32. format(string, sizeof(string), " Deposit: %s", FormatMoney(strval(money)));
  33. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  34. SendClientMessageEx(playerid, COLOR_GRAD6, "|-----------------------------------------|");
  35. format(string, sizeof(string), " New Balance: %s", FormatMoney(PlayerInfo[playerid][pAccount]));
  36. SendClientMessageEx(playerid, COLOR_WHITE, string);
  37. return 1;
  38. }
  39. return 1;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement