Advertisement
Kucin666

Terrorist Job v2 Pastebin

Aug 10th, 2015
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd> // ZeeX
  3. #include <streamer> // Incognito
  4. #include <OPSP> // wups
  5.  
  6. new TerroristBomb[MAX_PLAYERS];
  7. new pickupterrorist;
  8. new LimitTimer;
  9.  
  10. forward TimeLimit(playerid);
  11. public TimeLimit(playerid)
  12. {
  13. RemovePlayerAttachedObject(playerid, 5);
  14. TerroristBomb[playerid] = 0;
  15. DisablePlayerCheckpoint(playerid);
  16. SendClientMessage(playerid,0xFF0000AA,"Working time you're done , and you do not finish it.");
  17. }
  18.  
  19. public OnFilterScriptInit()
  20. {
  21. print("\n--------------------------------------");
  22. print(" Job Terrorist By Kucin666 Loaded");
  23. print("--------------------------------------\n");
  24. return 1;
  25. }
  26.  
  27. public OnFilterScriptExit()
  28. {
  29. print("\n--------------------------------------");
  30. print(" Job Terrorist By Kucin666 Unloaded");
  31. print("--------------------------------------\n");
  32. return 1;
  33. }
  34.  
  35. public OnPlayerConnect(playerid)
  36. {
  37. TerroristBomb[playerid] = 0;
  38. pickupterrorist = CreatePickup(1252 , 1, 2657.9956,-1589.4816,13.9864);
  39. CreateDynamicMapIcon(2657.9956,-1589.4816,13.9864, 43, 0);
  40. return 1;
  41. }
  42.  
  43. public OnPlayerDeath(playerid, killerid, reason)
  44. {
  45. RemovePlayerAttachedObject(playerid, 5);
  46. TerroristBomb[playerid] = 0;
  47. DisablePlayerCheckpoint(playerid);
  48. KillTimer(LimitTimer);
  49. return 1;
  50. }
  51.  
  52. public OnPlayerPickUpPickup(playerid, pickupid)
  53. {
  54. if(pickupid == pickupterrorist)
  55. {
  56. GameTextForPlayer(playerid,"Please type /terrorist to work as a terrorist.",3000,1);
  57. }
  58. return 1;
  59. }
  60.  
  61. public OnPlayerEnterCheckpoint(playerid)
  62. {
  63. if(IsPlayerInAnyVehicle(playerid)) {
  64. SendClientMessage(playerid,0xFF0000AA,"You must be on foot to put a bomb.");
  65. return 1;
  66. }
  67. else
  68. if(TerroristBomb[playerid] == 1){
  69. TerroristBomb[playerid] = 2;
  70. SetPlayerCheckpoint(playerid,2692.1714,-1708.7668,11.8478,3);
  71. ClearAnimations(playerid);
  72. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  73. return 1;
  74. }
  75. if(TerroristBomb[playerid] == 2){
  76. TerroristBomb[playerid] = 3;
  77. SetPlayerCheckpoint(playerid,2817.4719,-1622.7756,11.0918,3);
  78. ClearAnimations(playerid);
  79. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  80. return 1;
  81. }
  82. if(TerroristBomb[playerid] == 3){
  83. TerroristBomb[playerid] = 4;
  84. SetPlayerCheckpoint(playerid,2852.9338,-1532.5073,11.0938,3);
  85. ClearAnimations(playerid);
  86. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  87. return 1;
  88. }
  89. if(TerroristBomb[playerid] == 4){
  90. TerroristBomb[playerid] = 5;
  91. SetPlayerCheckpoint(playerid,2750.3342,-1468.0583,30.4531,3);
  92. ClearAnimations(playerid);
  93. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  94. return 1;
  95. }
  96. if(TerroristBomb[playerid] == 5){
  97. TerroristBomb[playerid] = 6;
  98. SetPlayerCheckpoint(playerid,2635.1741,-1394.8597,30.4168,3);
  99. ClearAnimations(playerid);
  100. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  101. return 1;
  102. }
  103. if(TerroristBomb[playerid] == 6){
  104. TerroristBomb[playerid] = 7;
  105. SetPlayerCheckpoint(playerid,2658.0977,-1591.6510,13.7122,3);
  106. ClearAnimations(playerid);
  107. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
  108. RemovePlayerAttachedObject(playerid, 5);
  109. return 1;
  110. }
  111. if(TerroristBomb[playerid] == 7){
  112. TerroristBomb[playerid] = 0;
  113. DisablePlayerCheckpoint(playerid);
  114. SendClientMessage(playerid,0xFFFF00AA,"You have completed the job and get 15000$");
  115. GivePlayerMoney(playerid,15000);
  116. KillTimer(LimitTimer);
  117. return 1;
  118. }
  119. return 1;
  120. }
  121.  
  122. public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
  123. {
  124. if ( Shooter != INVALID_PLAYER_ID && TerroristBomb[Shooter] == 1 || TerroristBomb[Shooter] == 2 || TerroristBomb[Shooter] == 3 || TerroristBomb[Shooter] == 4 || TerroristBomb[Shooter] == 5 || TerroristBomb[Shooter] == 6 || TerroristBomb[Shooter] == 7 )
  125. {
  126. new Float:hp, Float:armour;
  127. GetPlayerHealth(Target, hp);
  128. GetPlayerArmour(Target, armour);
  129. SetPlayerArmour(Target, armour + ArmourLost);
  130. SetPlayerHealth(Target, hp + HealthLost);
  131. GameTextForPlayer(Shooter,"you are at work and unable to attack other players!",3000,5);
  132. return 1;
  133. }
  134. if ( Shooter != INVALID_PLAYER_ID && TerroristBomb[Shooter] == 0)
  135. {
  136. if(TerroristBomb[Target] == 1 || TerroristBomb[Target] == 2 || TerroristBomb[Target] == 3 || TerroristBomb[Target] == 4 || TerroristBomb[Target] == 5 || TerroristBomb[Target] == 6 || TerroristBomb[Target] == 7)
  137. {
  138. new Float:hp, Float:armour;
  139. GetPlayerHealth(Target, hp);
  140. GetPlayerArmour(Target, armour);
  141. SetPlayerArmour(Target, armour + ArmourLost);
  142. SetPlayerHealth(Target, hp + HealthLost);
  143. GameTextForPlayer(Shooter,"players are working and can not be attacked.",3000,5);
  144. return 1;
  145. }
  146. }
  147. return 1;
  148. }
  149.  
  150. CMD:terrorist(playerid, params[])
  151. {
  152. if(IsPlayerInRangeOfPoint(playerid, 2, 2657.9956,-1589.4816,13.9864))
  153. {
  154. if(TerroristBomb[playerid] == 1 || TerroristBomb[playerid] == 2 || TerroristBomb[playerid] == 3 || TerroristBomb[playerid] == 4 || TerroristBomb[playerid] == 5 || TerroristBomb[playerid] == 6 || TerroristBomb[playerid] == 7)
  155. {
  156. SendClientMessage(playerid,0xFF0000AA,"You have started a terrorist work and can't use this command again.");
  157. return 1;
  158. }
  159. else
  160. TerroristBomb[playerid] = 1;
  161. new name[MAX_PLAYER_NAME], string[128];
  162. GetPlayerName(playerid, name, sizeof(name));
  163. format(string, sizeof(string), "%s was working as a Terrorist. Type /jobterrorist for go to work terrorist.", name );
  164. SendClientMessageToAll(0xFFFF00AA, string);
  165. SendClientMessage(playerid,0xFFFF00AA,"Please follow the red checkpoint to start working as a terrorist and put a bomb.");
  166. SetPlayerCheckpoint(playerid, 2692.1714,-1708.7668,11.8478,3);
  167. SetPlayerAttachedObject(playerid,5,1252,8, -0.079999, -0.039999, 0.109999, -90.100006, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  168. LimitTimer = SetTimerEx("TimeLimit", 300000, 0, "d", playerid);
  169. return 1;
  170. }
  171. else
  172. {
  173. SendClientMessage(playerid, 0xFF0000AA, "You must be at work terrorist to use this command.");
  174. }
  175. return 1;
  176. }
  177.  
  178. CMD:jobterrorist(playerid, params[])
  179. {
  180. if(TerroristBomb[playerid] == 1 || TerroristBomb[playerid] == 2 || TerroristBomb[playerid] == 3 || TerroristBomb[playerid] == 4 || TerroristBomb[playerid] == 5 || TerroristBomb[playerid] == 6 || TerroristBomb[playerid] == 7)
  181. {
  182. SendClientMessage(playerid, 0xFF0000AA, "You're not allowed to use this command while working.");
  183. return 1;
  184. }
  185. else
  186. SetPlayerInterior(playerid, 0);
  187. SetPlayerPos(playerid, 2657.2930,-1596.1967,12.9181);
  188. return 1;
  189. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement