Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.43 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3. #include <foreach>
  4. CMD:bounty(playerid, params[])
  5. {
  6. new msg[136], bountyid, bountycashh;
  7. if(sscanf(params, "ii", bountyid, bountycashh)) return SendClientMessage(playerid, ERRORCOLOR, "Usage:/bounty [id] [amount]");
  8. if(!IsPlayerConnected(bountyid)) return SendClientMessage(playerid, ERRORCOLOR, "Invalid playerid");
  9. if(GetPlayerMoney(playerid) < bountycashh || GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, ERRORCOLOR, "invaild amount");
  10. SetPlayerMoney(playerid, GetPlayerMoney(playerid) - bountycashh);
  11. bountiable[bountyid] = 1;
  12. bountycash[bountyid] = bountycashh;
  13. format(msg, sizeof(msg), "%s has set a bounty $%d on %s's head", Name[playerid] ,bountycashh, Name[bountyid]);
  14. SendClientMessageToAll(ERRORCOLOR, msg);
  15. return 1;
  16. }
  17. CMD:pubg(playerid, params[])
  18. {
  19. new pubgid, msg[123];
  20. if (CommandCheck(playerid, "pubg")) return 0;
  21. if (sscanf(params, "i", pubgid)) return SendClientMessage(playerid, ERRORCOLOR, "Usage: /pubg [1-4]");
  22. if (pubgid < 1 || pubgid > 4) return SendClientMessage(playerid, ERRORCOLOR, "invaild pubg name");
  23. if (inpubg[playerid] == 1) return SendClientMessage(playerid, ERRORCOLOR, "You are already in pubg");
  24. if (pubgsignedup[playerid] == 1) return SendClientMessage(playerid, ERRORCOLOR, "You have already signed up");
  25. if (pubg1running == 1) return SendClientMessage(playerid, ERRORCOLOR, "pubg 1 is already running , please wait a little.");
  26. if (pubgid == 1 && timerrunning == 0)
  27. {
  28. SetTimer("pubgpreperation", 12000, false);
  29. printf("pass 1");
  30. pubgsignedup[playerid] = 1;
  31. pubgplayers += 1;
  32. SendClientMessageToAll(0x91FF00FF, "Pubg 1 starts in 20 seconds , use {FF0000}(/pubg 1){91FF00} to join");
  33. format(msg, sizeof(msg), "{D4B790}%s has signed up for pubg 1. {FF0000}(/pubg 1)", Name[playerid]);
  34. SendClientMessageToAll(-1, msg);
  35. timerrunning = 1;
  36. }
  37. else if (pubgid == 1 && timerrunning == 1)
  38. {
  39. pubgsignedup[playerid] = 1;
  40. pubgplayers += 1;
  41. format(msg, sizeof(msg), "{D4B790}%s has signed up for pubg 1. {FF0000}(/pubg 1)", Name[playerid]);
  42. SendClientMessageToAll(-1, msg);
  43. }
  44. else if (pubgid == 2 || pubgid == 3 || pubgid == 4) return SendClientMessage(playerid, ERRORCOLOR, "The pubg id you had chosen is currently under maintance , please try again later");
  45. return 1;
  46. }
  47. CMD:pickup(playerid, params[])
  48. {
  49. if (inpubg[playerid] != 1) return SendClientMessage(playerid, ERRORCOLOR, "You may only use this command while in a game");
  50. if (abiltopick[playerid] == 0) return SendClientMessage(playerid, ERRORCOLOR, "Please wait 20 seconds before picking up the next weapon");
  51. if (IsPlayerInRangeOfPoint(playerid, 3,-992.2407,-1062.1375,129.2188))
  52. {
  53. GivePlayerWeapon(playerid, 23, 120);
  54. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  55. abiltopick[playerid] = 0;
  56. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  57. }
  58. else if (IsPlayerInRangeOfPoint(playerid, 3,-1049.3972,-1244.6392,128.4763))
  59. {
  60. GivePlayerWeapon(playerid, 9, 1);
  61. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  62. abiltopick[playerid] = 0;
  63. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  64. }
  65. else if (IsPlayerInRangeOfPoint(playerid, 3,-1161.2699,-1278.1047,154.5398))
  66. {
  67. GivePlayerWeapon(playerid, 34, 20);
  68. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  69. abiltopick[playerid] = 0;
  70. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  71. }
  72. else if (IsPlayerInRangeOfPoint(playerid, 3,-964.2363,-970.6340,131.9541))
  73. {
  74. GivePlayerWeapon(playerid, 27, 450);
  75. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  76. abiltopick[playerid] = 0;
  77. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  78. }
  79. else if (IsPlayerInRangeOfPoint(playerid, 3,-1172.9540,-985.1346,131.5091))
  80. {
  81. GivePlayerWeapon(playerid, 33, 35);
  82. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  83. abiltopick[playerid] = 0;
  84. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  85. }
  86. else if (IsPlayerInRangeOfPoint(playerid, 3,-1131.6649,-1084.4207,129.2188))
  87. {
  88. GivePlayerWeapon(playerid, 25, 100);
  89. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  90. abiltopick[playerid] = 0;
  91. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  92. }
  93. else if (IsPlayerInRangeOfPoint(playerid, 3,-994.1649,-1112.0087,132.2200))
  94. {
  95. GivePlayerWeapon(playerid, 31, 200);
  96. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  97. abiltopick[playerid] = 0;
  98. SetTimerEx("pickupcooldown", 20000, false , "i", playerid);
  99. }
  100. else return SendClientMessage(playerid, ERRORCOLOR, "You are not in range of any pickable item");
  101. return 1;
  102. }
  103. forward pickupcooldown(playerid);
  104. public pickupcooldown(playerid)
  105. {
  106. abiltopick[playerid] = 1;
  107. }
  108. CMD:pubgcancel(playerid, params[])
  109. {
  110. new msg[121];
  111. if (pubgsignedup[playerid] != 1) return SendClientMessage(playerid, ERRORCOLOR, "You didn't signedup to any pubg game yet");
  112. else
  113. {
  114. pubgplayers -= 1;
  115. pubgsignedup[playerid] = 0;
  116. format(msg, sizeof(msg), "{D4B790}%s has canceled sign'ion for pubg 1.{D4B790}", Name[playerid]);
  117. SendClientMessageToAll(-1, msg);
  118. }
  119. return 1;
  120. }
  121. forward pubgpreperation();
  122. public pubgpreperation()
  123. {
  124. new ppubg1start;
  125. ppubg1start = SetTimer("pubgstartup", 18000, false);
  126. if(pubgplayers < 2)
  127. {
  128. SendClientMessageToAll(ERRORCOLOR, "Pubg 1 had been canceled due to less players , 3 players required");
  129. KillTimer(ppubg1start);
  130. timerrunning = 0;
  131. pubgplayers = 0;
  132. foreach (new i : Character)
  133. {
  134. if(pubgsignedup[i] == 1)
  135. {
  136. pubgsignedup[i] = 0;
  137. }
  138. else if(inpubg[i] == 1)
  139. {
  140. inpubg[i] = 0;
  141. }
  142. }
  143. }
  144. printf("pass 2");
  145. return 1;
  146. }
  147. forward pubgstartup();
  148. public pubgstartup()
  149. {
  150. new Random;
  151. foreach(new i : Character)
  152. {
  153. if(pubgsignedup[i] == 1 && !IsPlayerNPC(i))
  154. {
  155. posstate_{i} = 12;
  156. Random = random(sizeof(pubg));
  157. SetPlayerPos(i, pubg[Random][0], pubg[Random][1], pubg[Random][2]);
  158. SetPlayerFacingAngle(i, pubg[Random][3]);
  159. SetPlayerVirtualWorld(i, 12);
  160. pubg1running = 1;
  161. pubgsignedup[i] = 0;
  162. ResetPlayerWeapons(i);
  163. SetPlayerArmour(i, 0);
  164. SetPlayerHealth(i, 70);
  165. GivePlayerWeapon(i, 25, 7);
  166. GivePlayerWeapon(i, 6, 1);
  167. SendClientMessage(i, 0xFF2121FF, "Note: c-bug is disabled while in a game!.");
  168. inpubg[i] = 1;
  169. abiltopick[i] = 1;
  170. SendClientMessage(i, 0x00B0EBFF, "{FF0000}Pubg 1: {00B0EB} You are now in a forest !, you have to survive to be the winner!");
  171. SendClientMessage(i, 0x00B0EBFF, "{FF0000}Pubg 1: {00B0EB} There is some pickups around the map , pickup them to help you !");
  172. SendClientMessage(i, 0x00B0EBFF, "{FF0000}Pubg 1: {00B0EB} Good luck hunter !");
  173. TogglePlayerControllable(i, 0);
  174. timerrunning = 0;
  175. counter = 6;
  176. printf("pubg startup : %d" , i);
  177. }
  178. }
  179. return 1;
  180. }
  181. public OnPlayerDeath(playerid, killerid, reason)
  182. {
  183. if(reason != 49 || reason != 50 || reason != 51 || reason != 0)
  184. {
  185. if(bountiable[playerid] == 1 && posstate_{playerid} == 0 && bountycash[playerid] != 0)
  186. {
  187. bountiable[playerid] = 0;
  188. GivePlayerMoney(killerid, bountycash[playerid]);
  189. format(msg, sizeof(msg), "%s has killed %s and taken %d", Name[killerid], Name[playerid], bountycash[playerid]);
  190. SendClientMessageToAll(ERRORCOLOR, msg);
  191. bountycash[playerid] = 0;
  192. }
  193. }
  194. return 1;
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement