Advertisement
Guest User

Untitled

a guest
Dec 24th, 2011
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. if(strcmp(cmd, "/deposit", true) == 0)
  2. {
  3. if (IsPlayerConnected(playerid))
  4. {
  5. tmp = strtok(cmdtext, idx);
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposit [amount]");
  9. format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
  10. SendClientMessage(playerid, COLOR_GRAD3, string);
  11. return 1;
  12. }
  13. new cashdeposit = strval(tmp);
  14. if(!strlen(tmp))
  15. {
  16. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposit [amount]");
  17. format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
  18. SendClientMessage(playerid, COLOR_GRAD3, string);
  19. return 1;
  20. }
  21. if (cashdeposit > GetPlayerPCash(playerid) || cashdeposit < 1)
  22. {
  23. SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
  24. return 1;
  25. }
  26. if (PlayerToPoint(25.0, playerid, 2308.5071,-14.6699,26.7422))
  27. {
  28. GivePlayerPCash(playerid,-cashdeposit);
  29. new curfunds = PlayerInfo[playerid][pAccount];
  30. PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
  31. SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
  32. SendClientMessage(playerid,COLOR_LIGHTYELLOW5," Bank Statement: ");
  33. format(string, sizeof(string), "[INFO]: Old Balance: $%d | New Balance: $%d",curfunds, PlayerInfo[playerid][pAccount]);
  34. SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
  35. format(string, sizeof(string), "[INFO]: Deposit: $%d",cashdeposit);
  36. SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
  37. SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
  38. OnPlayerDataSave(playerid);
  39. return 1;
  40. }
  41. else
  42. {
  43. SendClientMessage(playerid, COLOR_GRAD2, " You are to far from a Bank");
  44. return 1;
  45. }
  46. }
  47. }
  48. if(strcmp(cmd, "/withdraw", true) == 0)
  49. {
  50. tmp = strtok(cmdtext, idx);
  51. if(!strlen(tmp))
  52. {
  53. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
  54. format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
  55. SendClientMessage(playerid, COLOR_GRAD3, string);
  56. return 1;
  57. }
  58. new cashdeposit = strval(tmp);
  59. if(!strlen(tmp))
  60. {
  61. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
  62. format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
  63. SendClientMessage(playerid, COLOR_GRAD3, string);
  64. return 1;
  65. }
  66. if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
  67. {
  68. SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
  69. return 1;
  70. }
  71. if (PlayerToPoint(25.0, playerid, 2308.5071,-14.6699,26.7422) || IsAtATM(playerid))
  72. {
  73. GivePlayerPCash(playerid,cashdeposit);
  74. PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
  75. format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
  76. SendClientMessage(playerid, COLOR_YELLOW, string);
  77. OnPlayerDataSave(playerid);
  78. return 1;
  79. }
  80. else
  81. {
  82. SendClientMessage(playerid, COLOR_GRAD2, " You are to far from a Bank");
  83. return 1;
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement