Advertisement
Guest User

Untitled

a guest
Apr 4th, 2010
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. if(strcmp(cmd, "/atm", true) == 0)
  2. {
  3. if(IsAtGasStation(playerid))
  4. {
  5. if(IsPlayerConnected(playerid))
  6. {
  7. new x_info[128];
  8. x_info = strtok(cmdtext, idx);
  9. new wstring[128];
  10.  
  11. if(!strlen(x_info)) {
  12. format(wstring, sizeof(wstring), " %s ", GetPlayerNameEx(playerid));
  13. SendClientMessage(playerid, COLOR_WHITE, wstring);
  14. SendClientMessage(playerid, COLOR_LSPD, "[OPTIONS]");
  15. SendClientMessage(playerid, COLOR_WHITE, "- WITHDRAW");
  16. SendClientMessage(playerid, COLOR_WHITE, "- BALANCE");
  17. SendClientMessage(playerid, COLOR_WHITE, "- ACCOUNT");
  18. SendClientMessage(playerid, COLOR_LSPD, "ATM MACHINE");
  19. return 1;
  20. }
  21. if(strcmp(x_info, "withdraw", true) == 0)
  22. {
  23. if(PlayerInfo[playerid][pSilverBankCard] = 1)
  24. {
  25. tmp = strtok(cmdtext, idx);
  26. if(!strlen(tmp))
  27. {
  28. SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /atm withdraw [amount]");
  29. return 1;
  30. }
  31. new cashdeposit = strval(tmp);
  32. if(!strlen(tmp))
  33. {
  34. SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /atm withdraw [amount]");
  35. return 1;
  36. }
  37. if(PlayerInfo[playerid][pBank] >= cashdeposit)
  38. {
  39. GivePlayerCash(playerid,cashdeposit);
  40. PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;
  41. format(string, sizeof(string), "(INFO) You have withdrawn $%d, new balance: $%d", cashdeposit,PlayerInfo[playerid][pBank]);
  42. SendClientMessage(playerid, COLOR_WHITE, string);
  43. PlayerActionMessage(playerid,15.0,"takes the money from the dispenser in the ATM machine");
  44. OnPlayerDataSave(playerid);
  45. return 1;
  46. }
  47. else
  48. {
  49. SendClientMessage(playerid, COLOR_GREY, "(ERROR) You do not have that much in your bank");
  50. }
  51. }
  52. else if(strcmp(x_info, "balance", true) == 0)
  53. {
  54. if(PlayerInfo[playerid][pBronzeBankCard] = 1 || PlayerInfo[playerid][pSilverBankCard] = 1 || PlayerInfo[playerid][pGoldBankCard] = 1)
  55. {
  56. format(string, sizeof(string), "BALANCE: $%d", PlayerInfo[playerid][pBank]);
  57. SendClientMessage(playerid, COLOR_WHITE, string);
  58. PlayerActionMessage(playerid,15.0,"receives a mini-bank statement from the machine");
  59. return 1;
  60. }
  61. else
  62. {
  63. SendClientMessage(playerid, COLOR_GREY, "(ERROR) You do not have a bank card");
  64. }
  65. }
  66. else if(strcmp(x_info, "account", true) == 0)
  67. {
  68. if(PlayerInfo[playerid][pBronzeBankCard] = 1)
  69. {
  70. SendClientMessage(playerid, COLOR_WHITE, "You have a bronze account");
  71. }
  72. if(PlayerInfo[playerid][pSilverBankCard] = 1)
  73. {
  74. SendClientMessage(playerid, COLOR_WHITE, "You have a silver account");
  75. }
  76. if(PlayerInfo[playerid][pGoldBankCard] = 1)
  77. {
  78. SendClientMessage(playerid, COLOR_WHITE, "You have a gold account");
  79. }
  80. }
  81. }
  82. return 1;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement