Advertisement
Guest User

Untitled

a guest
Dec 6th, 2014
759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. /*
  2. ---------------------------------------------------
  3. Naziv FS: VATROMET
  4. Autor Filescripte: Selvedin
  5. Molim da ne brisete kreditse !
  6. ---------------------------------------------------
  7.  
  8. ---------------------DEFINICIJE--------------------
  9. */
  10. #define FILTERSCRIPT
  11. /*
  12. ---------------------INCLUDOVI---------------------
  13. */
  14. #include <a_samp>
  15. #include <zcmd>
  16. #include <sscanf2>
  17. #include <foreach>
  18. #include <streamer>
  19. /*
  20. -------------------BOJE----------------------------
  21. */
  22. #define COLOR_GREY 0xAFAFAFAA
  23. #define COLOR_WHITE 0xFFFFFFAA
  24. #define COLOR_YELLOW 0xFFFF00AA
  25. #define RaketaVisina 50
  26. #define RaketaSirenje 30
  27. #define MAX_POKRETANJA 20
  28. #define MAX_RAKETA 100
  29. /*
  30. --------------NEWOVI-VARIJABLE---------------------
  31. */
  32. new Raketa[MAX_POKRETANJA];
  33. new RaketaOsvjetljenje[MAX_POKRETANJA];
  34. new RaketaDim[MAX_POKRETANJA];
  35. new ExplozijaRakete[MAX_POKRETANJA];
  36. new Float:rx[MAX_POKRETANJA];
  37. new Float:ry[MAX_POKRETANJA];
  38. new Float:rz[MAX_POKRETANJA];
  39. new RaketaUkupno;
  40. new Zapaljivost;
  41. /*
  42. ------------------ISPISUJE IME IGRACA-------------
  43. */
  44. GetPlayerNameEx(playerid) {
  45.  
  46. new sz_playerName[MAX_PLAYER_NAME], i_pos;
  47.  
  48. GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME);
  49. while ((i_pos = strfind(sz_playerName, "_", false, i_pos)) != -1) sz_playerName[i_pos] = ' ';
  50. return sz_playerName;
  51. }
  52.  
  53. forward Raketaa(i);
  54. public Raketaa(i)
  55. {
  56. new Float:x, Float:y, Float:z;
  57. x = rx[i];
  58. y = ry[i];
  59. z = rz[i];
  60. z += RaketaVisina;
  61. if (ExplozijaRakete[i] == 0)
  62. {
  63. DestroyDynamicObject(Raketa[i]);
  64. DestroyDynamicObject(RaketaOsvjetljenje[i]);
  65. DestroyDynamicObject(RaketaDim[i]);
  66. CreateExplosion(x ,y, z, 4, 10);
  67. CreateExplosion(x ,y, z, 5, 10);
  68. CreateExplosion(x ,y, z, 6, 10);
  69. }
  70. else if (ExplozijaRakete[i] >= MAX_RAKETA)
  71. {
  72. for (new j = 0; j <= RaketaSirenje; j++)
  73. {
  74. CreateExplosion(x + float(j - (RaketaSirenje / 2)), y, z, 7, 10);
  75. CreateExplosion(x, y + float(j - (RaketaSirenje / 2)), z, 7, 10);
  76. CreateExplosion(x, y, z + float(j - (RaketaSirenje / 2)), 7, 10);
  77. }
  78. ExplozijaRakete[i] = -1;
  79. RaketaUkupno = 0;
  80. Zapaljivost = 0;
  81. return 1;
  82. }
  83. else
  84. {
  85. x += float(random(RaketaSirenje) - (RaketaSirenje / 2));
  86. y += float(random(RaketaSirenje) - (RaketaSirenje / 2));
  87. z += float(random(RaketaSirenje) - (RaketaSirenje / 2));
  88. CreateExplosion(x, y, z, 7, 10);
  89. }
  90. ExplozijaRakete[i]++;
  91. SetTimerEx("Raketaa", 250, 0, "i", i);
  92. return 1;
  93. }
  94. /*
  95. --------------KOMANDE ZA VATROMET---------------
  96. */
  97. CMD:postavivatromet(playerid, params[])
  98. {
  99. if(RaketaUkupno == MAX_POKRETANJA)
  100. {
  101. SendClientMessage(playerid, COLOR_WHITE, "Postavilo/la si maksimalan broj vatrometa!");
  102. return 1;
  103. }
  104. if(Zapaljivost == 1)
  105. {
  106. SendClientMessage(playerid, COLOR_WHITE, "Pricekaj, za postavljanje novog vatrometa!");
  107. return 1;
  108. }
  109. new string[128];
  110. format(string, sizeof(string), "%s je postavio vatromet.", GetPlayerNameEx(playerid));
  111. new Float:x, Float:y, Float:z, Float:a;
  112. GetPlayerPos(playerid, x, y, z);
  113. foreach(Player, i)
  114. {
  115. if(IsPlayerInRangeOfPoint(i, 30, x, y, z)) {
  116. SendClientMessage(i, COLOR_YELLOW, string);
  117. }
  118. }
  119. GetPlayerFacingAngle(playerid, a);
  120. x += (2 * floatsin(-a, degrees));
  121. y += (2 * floatcos(-a, degrees));
  122. Raketa[RaketaUkupno] = CreateDynamicObject(3786, x, y, z, 0, 90, 0);
  123. RaketaOsvjetljenje[RaketaUkupno] = CreateDynamicObject(354, x, y, z + 1, 0, 90, 0);
  124. RaketaDim[RaketaUkupno] = CreateDynamicObject(18716, x, y, z - 4, 0, 0, 0);
  125. rx[RaketaUkupno] = x;
  126. ry[RaketaUkupno] = y;
  127. rz[RaketaUkupno] = z;
  128. ExplozijaRakete[RaketaUkupno] = 0;
  129. RaketaUkupno++;
  130. return 1;
  131. }
  132.  
  133. CMD:pokrenivatromet(playerid, params[])
  134. {
  135. if(RaketaUkupno == 0)
  136. {
  137. SendClientMessage(playerid, COLOR_WHITE, "Nemas vatromet!");
  138. return 1;
  139. }
  140. if(Zapaljivost == 1)
  141. {
  142. SendClientMessage(playerid, COLOR_WHITE, "Vec imas postavljen vatromet!");
  143. return 1;
  144. }
  145. for(new i = 0; i < RaketaUkupno; i++)
  146. {
  147. CreateExplosion(rx[i] ,ry[i], rz[i], 12, 5);
  148. new time = MoveDynamicObject(Raketa[i], rx[i] ,ry[i], rz[i] + RaketaVisina, 10);
  149. MoveDynamicObject(RaketaOsvjetljenje[i], rx[i] ,ry[i], rz[i] + 2 + RaketaVisina, 10);
  150. MoveDynamicObject(RaketaDim[i], rx[i] ,ry[i], rz[i] + RaketaVisina, 10);
  151. SetTimerEx("Raketaa", time, 0, "i", i);
  152. }
  153. Zapaljivost = 1;
  154. return 1;
  155. }
  156.  
  157. /*
  158. --------------------------------------KRAJ--------------------------------------
  159. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement