Advertisement
Guest User

Killstreak

a guest
Dec 17th, 2015
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.91 KB | None | 0 0
  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  2. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA,AMUNRA,AMUNRA>>>>>>>>>>>>>>>*/
  3. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA,AMUNRA,AMUNRA,AMUNRA>>>>>>>>>>>>*/
  4. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>*/
  5. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  6. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  7. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  8. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  9. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  10. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  11. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  12. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  13. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  14. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  15. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  16. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  17. /*>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
  18. /*>>>>>>>>>>>>>>>AMUNRA,AMUNRA,AMUNRA,AMUNRA>>>>>>>AMUNRA>>>>>>>>>>>>>>>>>>>AMUNRA>>>*/
  19. /*>>>>>>>>>>>>>>>AMUNRA,AMUNRA,AMUNRA,AMUNRA>>>>>>>>AMUNRA,AMUNRA,AMUNRA,AMUNRA>>>>>>*/
  20. /*>>>>>>>>>>>>>>>AMUNRA,AMUNRA,AMUNRA,AMUNRA>>>>>>>>>>>AMUNRA,AMUNRA,AMUNRA.>>>>>>>>*/
  21. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  22. /* MY SERVER [LC]Legendary Criminals */
  23.  
  24. #define FILTERSCRIPT
  25.  
  26. #include <a_samp>
  27. #include <Dini>
  28. #include <Dutils>
  29. #include <Dudb>
  30.  
  31. #define savefolder "killstreak/%s.ini"
  32.  
  33. #pragma unused ret_memcpy
  34. #pragma unused strtok
  35. #pragma tabsize 0
  36.  
  37. #define ks1 1
  38. #define ks2 1
  39. #define ks3 1
  40. #define ks4 1
  41. #define ks5 2
  42. #define ks6 2
  43. #define ks7 2
  44. #define ks8 2
  45. #define ks9 2
  46. #define ks10 3
  47. #define ks11 3
  48. //===================================cash======================================
  49. #define cash1 2000
  50. #define cash2 3000
  51. #define cash3 4000
  52. #define cash4 5000
  53. #define cash5 6000
  54. #define cash6 7000
  55. #define cash7 8000
  56. #define cash8 9000
  57. #define cash9 10000
  58. #define cash10 11000
  59. #define cash11 12000
  60.  
  61. #define COLOR_BLUE 0x0000BBAA
  62.  
  63. new Killz[MAX_PLAYERS];
  64. new Deathz[MAX_PLAYERS];
  65. new Streaks[MAX_PLAYERS];
  66. new string2[50];
  67.  
  68. public OnFilterScriptInit()
  69. {
  70. print("\n--------------------------------------");
  71. print(" >>>>>>>>FILTERSCRIPT CREATED BY <<<<<<<");
  72. print(" >>>>>>>>>>>>>>>>>AMUNRA<<<<<<<<<<<<<<<<");
  73. print("--------------------------------------\n");
  74. return 1;
  75. }
  76. public OnPlayerConnect(playerid)
  77. {
  78. new pname[128];
  79. new file[128];
  80. Streaks[playerid] = 0;
  81. GetPlayerName(playerid, pname, sizeof(pname));
  82. format(file, sizeof(file), savefolder,pname);
  83. if(!dini_Exists(file)) {
  84. dini_Create(file);
  85. dini_IntSet(file, "Score", 0);
  86. dini_IntSet(file, "Money", 0);
  87. dini_IntSet(file, "Kills", Killz[playerid]);
  88. dini_IntSet(file, "Deaths", Deathz[playerid]);
  89. dini_IntSet(file, "Skin", 0);
  90. SetPlayerScore(playerid, dini_Int(file, "Score"));
  91. SetPlayerMoney(playerid, dini_Int(file, "Money"));
  92. SetPlayerSkin(playerid, dini_Int(file, "Skin"));
  93.  
  94. }
  95. else {
  96. SetPlayerScore(playerid, dini_Int(file, "Score"));
  97. SetPlayerMoney(playerid, dini_Int(file, "Money"));
  98. SetPlayerSkin(playerid, dini_Int(file, "Skin"));
  99. }
  100. return 1;
  101. }
  102.  
  103. public OnPlayerDisconnect(playerid, reason)
  104. {
  105. new pname[128];
  106. new file[128];
  107. Streaks[playerid] = 0;
  108. GetPlayerName(playerid, pname, sizeof(pname));
  109. format(file, sizeof(file), savefolder,pname);
  110. if(!dini_Exists(file)) {
  111. }
  112. else {
  113. dini_IntSet(file, "Score", GetPlayerScore(playerid));
  114. dini_IntSet(file, "Money", GetPlayerMoney(playerid));
  115. dini_IntSet(file, "Kills", Killz[playerid]);
  116. dini_IntSet(file, "Deaths", Deathz[playerid]);
  117. dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
  118. }
  119. return 1;
  120. }
  121.  
  122.  
  123.  
  124. public OnPlayerDeath(playerid, killerid, reason)
  125. {
  126. if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID ) { //check if the player is connected and it's a VALID KILL
  127. if(GetPlayerWantedLevel(killerid) < 6) //if the player's wantedlevel is under 6
  128. {
  129. SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1); //increase it by 1
  130. }
  131. Streaks[killerid] ++; //the sign '++' means, increase the variable for the killerid by 1
  132. GivePlayerMoney(killerid, 500); //if you like, give the killer some money, else comment this line out
  133. }
  134. SetPlayerWantedLevel(playerid, 0); //the player who died will get his wanted level reset to 0
  135. Streaks[playerid] = 0; //and his streak will end, while giving the value '0' to this variable
  136. SetPlayerScore(killerid,GetPlayerScore(killerid)+1); //not really necessary, would increase the player's score by 1 point
  137. new str[ 256 ], KillerName[MAX_PLAYER_NAME]; //here, you're defining a string2 and the killername
  138. GetPlayerName(killerid, KillerName, sizeof(KillerName)); //receive the information of the killer's name
  139. switch(Streaks[killerid]) //IMPORTANT: with the function "switch", you're switching / toggling through the killstreaks of a player (Streals). you need the killerid here, because the playerid is the one which is GETTING killed
  140. {
  141. case 2: // we won't start with the first kill (case 1), because it wouldn't be countable as streak
  142. {
  143. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190090/doublekill.mp3");
  144. format(str, sizeof(str), "[KILLSTREAK] ~g~%s has performed a ~y~double kill!", KillerName); //here, you're formatting the defined string2 and add the content (text)
  145. GameTextForAll(str,4000,4); //this is a function, which will show a short, colored big text for all the players (str, 4000ms, stylenumber 4)
  146.  
  147. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash1, ks1);
  148. SendClientMessage(killerid, COLOR_BLUE, string2);
  149.  
  150. GivePlayerMoney(killerid, cash1);
  151. GivePlayerScore(killerid, ks1);
  152. }
  153. case 3:
  154. {
  155. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190250/triplekill.mp3");
  156. format(str, sizeof(str), "[KILLSTREAK] ~y~Triple Kill for ~b~%s!", KillerName);
  157. GameTextForAll(str,4000,4);
  158.  
  159. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash2, ks2);
  160. SendClientMessage(killerid, COLOR_BLUE, string2);
  161.  
  162. GivePlayerMoney(killerid, cash2);
  163. GivePlayerScore(killerid, ks2);
  164. }
  165. case 4:
  166. {
  167. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  168. format(str, sizeof(str), "[KILLSTREAK] ~p~I Got you for ~r~%s!", KillerName);
  169. GameTextForAll(str,4000,4);
  170.  
  171. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash3, ks3);
  172. SendClientMessage(killerid, COLOR_BLUE, string2);
  173.  
  174. GivePlayerMoney(killerid, cash3);
  175. GivePlayerScore(killerid, ks3);
  176. }
  177. case 5:
  178. {
  179. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  180. format(str, sizeof(str), "[KILLSTREAK] ~r~%s is dominating with ~p~five kills!", KillerName);
  181. GameTextForAll(str,4000,4);
  182.  
  183. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash4, ks4);
  184. SendClientMessage(killerid, COLOR_BLUE, string2);
  185.  
  186. GivePlayerMoney(killerid, cash4);
  187. GivePlayerScore(killerid, ks4); }
  188. case 6:
  189. {
  190. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  191. format(str, sizeof(str), "[KILLSTREAK] ~w~%s is godlike with ~y~six kills!", KillerName);
  192. GameTextForAll(str,4000,4);
  193.  
  194. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash5, ks5);
  195. SendClientMessage(killerid, COLOR_BLUE, string2);
  196.  
  197. GivePlayerMoney(killerid, cash5);
  198. GivePlayerScore(killerid, ks5); }
  199. case 7:
  200. {
  201. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  202. format(str, sizeof(str), "[KILLSTREAK] ~r~RAMPAGE for %s with ~w~seven kills!", KillerName);
  203. GameTextForAll(str,4000,4);
  204.  
  205. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash6, ks6);
  206. SendClientMessage(killerid, COLOR_BLUE, string2);
  207.  
  208. GivePlayerMoney(killerid, cash6);
  209. GivePlayerScore(killerid, ks6); }
  210. case 8:
  211. {
  212. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  213. format(str, sizeof(str), "[KILLSTREAK] ~p~%s is unbelievable with ~y~eight kills!Someone Want to killed", KillerName);
  214. GameTextForAll(str,4000,4);
  215.  
  216. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash7, ks7);
  217. SendClientMessage(killerid, COLOR_BLUE, string2);
  218.  
  219. GivePlayerMoney(killerid, cash7);
  220. GivePlayerScore(killerid, ks7);
  221. }
  222. case 9:
  223. {
  224. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  225. format(str, sizeof(str), "[KILLSTREAK] ~g~%s is So Nice,With ~b~nine kills!Got you", KillerName);
  226. GameTextForAll(str,4000,4);
  227.  
  228. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash8, ks8);
  229. SendClientMessage(killerid, COLOR_BLUE, string2);
  230.  
  231. GivePlayerMoney(killerid, cash8);
  232. GivePlayerScore(killerid, ks8);
  233. }
  234. case 10:
  235. {
  236. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  237. format(str, sizeof(str), "[KILLSTREAK] ~b~%s is annihilating with ~g~ten kills!", KillerName);
  238. GameTextForAll(str,4000,4);
  239.  
  240. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash9, ks9);
  241. SendClientMessage(killerid, COLOR_BLUE, string2);
  242.  
  243. GivePlayerMoney(killerid, cash9);
  244. GivePlayerScore(killerid, ks9);
  245. }
  246. case 11:
  247. {
  248. PlayAudioStreamForPlayer(killerid,"http://downloads.ziddu.com/downloadfiles/11190086/chainkiller.mp3");
  249. format(str, sizeof(str), "[KILLSTREAK] ~b~%s GOD KILLER..~g~I Can't Lose...!", KillerName);
  250. GameTextForAll(str,4000,4);
  251.  
  252. format(string2, sizeof(string2), "You get $%i and +%i score! (KILLSTREAK BONUS bonus)", cash10, ks10);
  253. SendClientMessage(killerid, COLOR_BLUE, string2);
  254.  
  255. GivePlayerMoney(killerid, cash10);
  256. GivePlayerScore(killerid, ks10);
  257. }
  258. }
  259. GivePlayerMoney(killerid, 10000); //change the amount to whatever u want
  260. SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
  261. SetPlayerScore(playerid, GetPlayerScore(playerid)-1);
  262. Killz[killerid] ++;
  263. Deathz[playerid] ++;
  264. return 1;
  265. }
  266.  
  267. stock GivePlayerScore(playerid, score)
  268. {
  269. SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
  270. return 1;
  271. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement