Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. //ATM STAFF
  2. if(strcmp(cmd, "/atmwithdraw", true) == 0)
  3. {
  4. if(IsPlayerConnected(playerid))
  5. {
  6. if(IsPlayerInRangeOfPoint(playerid, 3, -32.276363,-57.995586,1003.139953) || IsPlayerInRangeOfPoint(playerid, 3, 374.718902,167.128982,1007.987304) || IsPlayerInRangeOfPoint(playerid, 3, -1748.5145,15.4453,180.8316) || IsPlayerInRangeOfPoint(playerid, 3, -915.1777,43.0257,97.9856) || IsPlayerInRangeOfPoint(playerid, 3, -931.1852,42.1797,358.6672) || IsPlayerInRangeOfPoint(playerid, 3, -1248.6656,18.3522,203.4427)
  7. || IsPlayerInRangeOfPoint(playerid, 3, 374.6863,167.7920,1008.3828) || IsPlayerInRangeOfPoint(playerid, 3, 2116.0210,-1117.7926,25.2971))
  8. {
  9. SendClientMessage(playerid, COLOR_GREY, " You are not at an ATM!");
  10. return 1;
  11. }
  12. tmp = strtok(cmdtext, idx);
  13. if(!strlen(tmp))
  14. {
  15. SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /atmwithdraw [amount]");
  16. format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
  17. SendClientMessage(playerid, COLOR_GRAD3, string);
  18. return 1;
  19. }
  20. new cashdeposit = strval(tmp);
  21. if(!strlen(tmp))
  22. {
  23. SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /atmwithdraw [amount]");
  24. format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
  25. SendClientMessage(playerid, COLOR_GRAD3, string);
  26. return 1;
  27. }
  28. if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
  29. {
  30. SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !");
  31. return 1;
  32. }
  33.  
  34.  
  35. if (cashdeposit > 5000)
  36. {
  37. SendClientMessage(playerid, COLOR_GRAD2, " You can only withdraw up to $5000!");
  38. return 1;
  39. }
  40.  
  41. ConsumingMoney[playerid] = 1;
  42. SafeGivePlayerMoney(playerid,cashdeposit);
  43. PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
  44. format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
  45. SendClientMessage(playerid, COLOR_YELLOW, string);
  46. PlayerInfo[playerid][pJobTimer] = 12;
  47. GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
  48. format(string, sizeof(string), " ID(%d) -%s has withdrawn %d from their bank.", playerid,giveplayer,cashdeposit);
  49. ABroadCast(COLOR_YELLOW,string, 5);
  50.  
  51. new y, m, d;
  52. new h,mi,s;
  53. getdate(y,m,d);
  54. gettime(h,mi,s);
  55. format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /atmwithdraw ($%d)",d,m,y,h,mi,s,sendername, cashdeposit);
  56. PayLog(string);
  57. return 1;
  58. }
  59. return 1;
  60. }
  61.  
  62.  
  63. // END ATM STUFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement