Advertisement
EnzoMetlc

[GameMode] OTOCAN Killer - [R.I.P adri1 - See You Again]

Jul 29th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. #include <a_samp>
  2. #define RNPC_NO_VERSION_CHECK
  3. #include <RNPC>
  4.  
  5.  
  6. #define MAX_OTOCAN 10
  7. #define GetRandomPos(%1,%2) %1 = (-744.0 - random(44)); %2 = (-1969.2 - random(35))
  8.  
  9.  
  10. enum OTOCAN_enum
  11. {
  12. Timer,
  13. Float:Health,
  14. bool:IsDead
  15. };
  16. static OtocanInfo[MAX_OTOCAN][OTOCAN_enum];
  17.  
  18.  
  19.  
  20. main() {}
  21. public OnGameModeInit()
  22. {
  23. //El infierno
  24. CreateObject(18759, -767.42926, -1981.55005, 39.57150, 0.00000, 0.00000, 0.00000);
  25. CreateObject(704, -824.98560, -2026.47717, 67.19260, -125.00000, 0.00000, 303.70905);
  26. CreateObject(704, -834.75928, -2002.42920, 72.77048, -125.00000, 0.00000, 299.39023);
  27. CreateObject(704, -789.39569, -1901.72607, 70.01269, -125.00000, 0.00000, 205.77780);
  28. CreateObject(704, -788.54712, -1935.57080, 46.23990, -110.00000, 0.00000, 181.46280);
  29. CreateObject(704, -733.16882, -1915.93359, 68.81982, -125.00000, 0.00000, 163.86092);
  30. CreateObject(704, -693.33319, -1955.30225, 74.24191, -125.00000, 0.00000, 109.62669);
  31. CreateObject(704, -688.31378, -2014.21545, 82.70863, -125.00000, 0.00000, 61.19062);
  32. CreateObject(704, -789.39569, -1901.72607, 69.94617, -125.00000, 0.00000, 181.46284);
  33. CreateObject(704, -834.75928, -2002.42920, 69.94617, -125.00000, 0.00000, 268.12457);
  34. CreateObject(704, -688.31378, -2014.21545, 78.16839, -125.00000, 0.00000, 77.75431);
  35. CreateObject(704, -693.33319, -1955.30225, 73.62672, -125.00000, 0.00000, 94.92651);
  36. CreateObject(704, -814.64697, -1990.18909, 55.31329, -95.50000, 0.00000, 337.08340);
  37. CreateObject(704, -791.92889, -1902.29468, 51.00562, -95.50000, 0.00000, 233.85573);
  38. CreateObject(704, -718.68518, -2012.90173, 56.81020, -95.50000, 0.00000, 7.14715);
  39. CreateObject(3279, -713.41101, -2013.39148, 21.61770, 0.00000, 0.00000, 267.64673);
  40. CreateObject(3279, -714.89667, -2013.16357, 7.53995, 0.00000, 0.00000, 176.92107);
  41. CreateObject(3279, -816.00806, -2042.67822, 23.97438, 0.00000, 0.00000, 30.45559);
  42. CreateObject(3279, -816.01300, -2042.65881, 38.21647, 0.00000, 0.00000, 120.19669);
  43. CreateObject(3279, -695.21753, -2021.65674, 17.99723, 0.00000, 0.00000, 185.94908);
  44. CreateObject(3279, -693.07544, -2021.36877, 32.17956, 0.00000, 0.00000, 276.76498);
  45. CreateObject(3279, -748.47504, -2054.60034, 7.38144, 0.00000, 0.00000, 185.94908);
  46. CreateObject(3279, -747.23572, -2054.71265, 21.45761, 0.00000, 0.00000, 276.76498);
  47. CreateObject(3279, -830.97968, -1976.59814, 7.38144, 0.00000, 0.00000, 176.92102);
  48. CreateObject(3279, -830.80511, -1976.32666, 21.45761, 0.00000, 0.00000, 267.64667);
  49. CreateObject(3279, -805.96313, -1932.37354, 7.38144, 0.00000, 0.00000, 92.77055);
  50. CreateObject(3279, -805.33911, -1931.12927, 21.45761, 0.00000, 0.00000, 182.65479);
  51. CreateObject(3279, -733.10101, -1916.71753, 0.64966, 0.00000, 0.00000, 92.77055);
  52. CreateObject(3279, -731.38342, -1915.39990, 14.65851, 0.00000, 0.00000, 182.65479);
  53. CreateObject(3279, -715.03723, -1964.66138, 7.53995, 0.00000, 0.00000, 92.77055);
  54. CreateObject(3279, -713.20178, -1964.18628, 21.61770, 0.00000, 0.00000, 182.65479);
  55. CreateObject(3267, -746.97797, -2054.52930, 37.08360, 0.00000, 0.00000, 0.00000);
  56. CreateObject(3267, -693.54968, -2021.19409, 47.52684, 0.00000, 0.00000, 61.80023);
  57. CreateObject(3267, -713.45734, -2012.97766, 37.25429, 0.00000, 0.00000, 61.80023);
  58. CreateObject(3267, -713.25116, -1964.00464, 37.25429, 0.00000, 0.00000, 111.60461);
  59. CreateObject(3267, -731.57617, -1914.92664, 30.50204, 0.00000, 0.00000, 144.85730);
  60. CreateObject(3267, -805.52625, -1930.94019, 37.06062, 0.00000, 0.00000, 214.87155);
  61. CreateObject(3267, -830.62469, -1976.48206, 37.06062, 0.00000, 0.00000, 267.76056);
  62. CreateObject(3267, -815.90320, -2042.72131, 53.93014, 0.00000, 0.00000, 323.76425);
  63. CreateObject(19377, -784.89807, -1961.38196, 44.34390, 0.00000, 0.00000, 0.00000);
  64. CreateObject(19377, -749.39807, -1961.38196, 44.34390, 0.00000, 0.00000, 0.00000);
  65. CreateObject(19377, -788.53760, -1969.01050, 38.42820, 0.00000, 0.00000, 308.89050);
  66. CreateObject(19377, -745.88489, -1969.31604, 38.31544, 0.00000, 0.00000, 228.43469);
  67. CreateObject(19325, -781.54596, -1966.15210, 41.53012, 0.00000, 0.00000, 90.00000);
  68. CreateObject(19325, -775.04602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
  69. CreateObject(19325, -768.54602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
  70. CreateObject(19325, -762.04602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
  71. CreateObject(19325, -755.54602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
  72. CreateObject(19325, -749.04602, -1966.15210, 41.53010, 0.00000, 0.00000, 90.00000);
  73. CreateObject(19377, -779.89807, -1961.38196, 43.54660, 0.00000, 90.00000, 0.00000);
  74. CreateObject(19377, -769.39807, -1961.38196, 43.54660, 0.00000, 90.00000, 0.00000);
  75. CreateObject(19377, -758.89807, -1961.38196, 43.54660, 0.00000, 90.00000, 0.00000);
  76. CreateObject(19377, -751.89807, -1961.38196, 43.49066, 0.00000, 90.00000, 0.00000);
  77.  
  78. new text1 = CreateObject(19325, -746.0397, -1969.3499, 41.5714, 0.0000, 0.0000, 48.0430);
  79. new text2 = CreateObject(19325, -788.4275, -1969.0405, 41.6114, 0.0000, 0.0000, 128.9335);
  80. SetObjectMaterialText(text1, "OTOCAN KILLER", 0, 90, "Arial", 35, 1, -65536, -16776961, 1);
  81. SetObjectMaterialText(text2, "OTOCAN KILLER", 0, 90, "Arial", 35, 1, -65536, -16776961, 1);
  82.  
  83. for(new i = 0; i < MAX_OTOCAN; i++)
  84. {
  85. new str[21];
  86. format(str, 21, "OTOCAN_%d", i);
  87. ConnectRNPC(str);
  88. }
  89. return 1;
  90. }
  91.  
  92.  
  93.  
  94.  
  95. public OnPlayerConnect(playerid)
  96. {
  97. if(IsPlayerRNPC(playerid))
  98. {
  99. SpawnPlayer(playerid);
  100. RNPC_SetShootable(playerid, true);
  101. return 1;
  102. }
  103. return 1;
  104. }
  105.  
  106. public OnPlayerSpawn(playerid)
  107. {
  108. if(!IsPlayerRNPC(playerid))
  109. {
  110. GivePlayerWeapon(playerid, 31, 50000);
  111. GivePlayerWeapon(playerid, 36, 50000);
  112. GivePlayerWeapon(playerid, 22, 50000);
  113.  
  114. SetPlayerPos(playerid, -784.2378, -1982.0018, 41.0);
  115. return 1;
  116. }
  117.  
  118. RNPC_CreateBuild(playerid, PLAYER_RECORDING_TYPE_ONFOOT);
  119. RNPC_AddMovement(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  120. RNPC_FinishBuild();
  121. RNPC_StartBuildPlayback(playerid);
  122.  
  123. SetPlayerSkin(playerid, 5);
  124. OtocanInfo[playerid][Health] = 100.0;
  125. OtocanInfo[playerid][IsDead] = false;
  126.  
  127. SetTimerEx("SpawnEx", 500, false, "d", playerid);
  128. return 1;
  129. }
  130.  
  131.  
  132.  
  133. forward SpawnEx(npcid);
  134. public SpawnEx(npcid)
  135. {
  136. new Float:randx, Float:randy;
  137. GetRandomPos(randx, randy);
  138.  
  139. RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT);
  140. RNPC_AddMovement(randx, randy, 40.67380, randx, randy, 40.67380);
  141. RNPC_FinishBuild();
  142. RNPC_StartBuildPlayback(npcid);
  143.  
  144. SetTimerEx("SpawnEx2", 100, false, "d", npcid);
  145. return 1;
  146. }
  147.  
  148.  
  149.  
  150. forward SpawnEx2(npcid);
  151. public SpawnEx2(npcid)
  152. {
  153. new Float:randx, Float:randy;
  154. GetRandomPos(randx, randy);
  155.  
  156. RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT);
  157. RNPC_AddMovement(randx, randy, 40.67380, randx, randy, 40.67380);
  158. RNPC_FinishBuild();
  159. RNPC_StartBuildPlayback(npcid);
  160.  
  161. OtocanInfo[npcid][Timer] = SetTimerEx("OTOCAN_MoveFatAss", random(7000) + 3000, false, "d", npcid);
  162. return 1;
  163. }
  164.  
  165.  
  166. forward OTOCAN_MoveFatAss(otocanid);
  167. public OTOCAN_MoveFatAss(otocanid)
  168. {
  169. ClearAnimations(otocanid);
  170.  
  171. new Float:Pos[3];
  172. new Float:randx, Float:randy;
  173.  
  174. GetPlayerPos(otocanid, Pos[0], Pos[1], Pos[2]);
  175. GetRandomPos(randx, randy);
  176.  
  177. RNPC_CreateBuild(otocanid, PLAYER_RECORDING_TYPE_ONFOOT);
  178. RNPC_AddMovement(Pos[0], Pos[1], 40.67380, randx, randy, 40.67380);
  179. RNPC_FinishBuild();
  180. RNPC_StartBuildPlayback(otocanid);
  181. SetPlayerCheckpoint(otocanid, randx, randy, 40.67380, 5.0);
  182. return 1;
  183. }
  184.  
  185.  
  186. public OnPlayerEnterCheckpoint(playerid) // OTOCANs will repose they fat ass
  187. {
  188. ClearAnimations(playerid);
  189.  
  190. new Float:Pos[3];
  191. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  192.  
  193. RNPC_CreateBuild(playerid, PLAYER_RECORDING_TYPE_ONFOOT);
  194. RNPC_AddMovement(Pos[0], Pos[1], Pos[2], Pos[0], Pos[1], Pos[2]);
  195. RNPC_FinishBuild();
  196. RNPC_StartBuildPlayback(playerid);
  197.  
  198. ApplyAnimation(playerid, "FAT", "IDLE_tired", 4.1, 1, 0, 0, 0, 10000, 1);
  199. ApplyAnimation(playerid, "FAT", "IDLE_tired", 4.1, 1, 0, 0, 0, 10000, 1);
  200.  
  201. KillTimer(OtocanInfo[playerid][Timer]);
  202. OtocanInfo[playerid][Timer] = SetTimerEx("OTOCAN_MoveFatAss", random(5000), false, "d", playerid);
  203. return 1;
  204. }
  205.  
  206.  
  207. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  208. {
  209. new Float:health = OtocanInfo[damagedid][Health] -= amount;
  210.  
  211. if(health <= 0.0 && OtocanInfo[damagedid][IsDead] == false)
  212. {
  213. health = OtocanInfo[damagedid][Health] = 0;
  214. OtocanInfo[damagedid][IsDead] = false;
  215. KillTimer(OtocanInfo[damagedid][Timer]);
  216.  
  217. ApplyAnimation(damagedid, "PED", "FLOOR_hit_f", 4.0, 0, 1, 1, 1, 1);
  218. ApplyAnimation(damagedid, "PED", "FLOOR_hit_f", 4.0, 0, 1, 1, 1, 1);
  219. }
  220.  
  221.  
  222. new str[10];
  223.  
  224. format(str, sizeof(str), "~w~%0.2f", health);
  225. GameTextForPlayer(playerid, str, 2000, 3);
  226. return 1;
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement