Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. #include <a_samp>
  2. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  3.  
  4. new robcasino,casino[MAX_PLAYERS];
  5.  
  6. forward RobAgain2();
  7. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  8.  
  9. #define COLOR_DODGERBLUE 0x1E90FFAA
  10. #define COLOR_ERROR 0xD2691EAA
  11. #define COLOR_SYSTEM 0x9ACD32AA
  12.  
  13. main()
  14. {
  15. print("\n----------------------------------");
  16. print(" Blank Gamemode by your name here");
  17. print("----------------------------------\n");
  18. }
  19.  
  20.  
  21.  
  22. public OnGameModeInit()
  23. {
  24. SetTimer("casinorob",1000,true);
  25. SetTimer("RobAgain2",1800000,1);
  26. return 1;
  27. }
  28.  
  29. public OnPlayerCommandText(playerid, cmdtext[])
  30. {
  31. dcmd(robcasino,9,cmdtext);
  32. return 0;
  33. }
  34.  
  35. dcmd_robcasino(playerid, params[])
  36. {
  37. if(PlayerToPoint(3, playerid, 1141.822509,9.046521,1000.671875))
  38. {
  39. SetTimer("robtimer",40000,false);
  40. new id = strval(params);
  41. new name[24],pname[24],string[256],reason[24];
  42. GetPlayerName( playerid, name, 24 );
  43. GetPlayerName( id, pname, 24 );
  44. format(string,sizeof(string),"%s Has begin to rob the casino",name,pname,reason);
  45. SendClientMessageToAll(COLOR_SYSTEM,string);
  46. casino[playerid] = 30;
  47. SetTimer("finishrob",1000,true);
  48. }
  49.  
  50. return 1;
  51. }
  52.  
  53. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  54. {
  55. if(IsPlayerConnected(playerid))
  56. {
  57. new Float:oldposx, Float:oldposy, Float:oldposz;
  58. new Float:tempposx, Float:tempposy, Float:tempposz;
  59. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  60. tempposx = (oldposx -x);
  61. tempposy = (oldposy -y);
  62. tempposz = (oldposz -z);
  63. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  64. {
  65. return 1;
  66. }
  67. }
  68. return 0;
  69. }
  70.  
  71.  
  72. public OnPlayerPickUpPickup(playerid, pickupid)
  73. {
  74. if(pickupid == robcasino)
  75. {
  76. GameTextForPlayer(playerid,"~w~Type /robcasino.",5000,5);
  77. }
  78. return 1;
  79. }
  80. forward casinorob();
  81. public casinorob()
  82. {
  83. for(new i = 0; i <= MAX_PLAYERS; i++)
  84. {
  85. if(casino[i] >= 1)
  86. {
  87. new RobText[115];
  88. if(casino[i] >= 2) {
  89. format(RobText, sizeof(RobText), "Robbery Complete in %d",casino[i]);
  90. GameTextForPlayer(i, RobText, 2000,3);
  91. casino[i] --;
  92. }
  93. }
  94. }
  95. }
  96. forward finishrob();
  97. public finishrob()
  98. {
  99. for(new i = 0; i <= MAX_PLAYERS; i++)
  100. {
  101. if(casino[i] == 1)
  102. {
  103. new string[256],string1[256],name[16];
  104. GetPlayerName(i, name, 24 );
  105. new money = random(500000);
  106. GivePlayerMoney(i,money);
  107. casino[i] = 0;
  108. format(string,256,"You robbed a total of $%i from the Casino!",money);
  109. format(string1,256," %s(%d) robbed a total of $%i from the Casino!",name,i,money);
  110. SendClientMessage(i,COLOR_SYSTEM,string);
  111. SendClientMessageToAll(COLOR_SYSTEM,string1);
  112. return true;
  113. }
  114. }
  115. return 1;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement