Advertisement
pro12345

Untitled

Oct 8th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 97.38 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <cstrike>
  4. #include <fakemeta>
  5. #include <engine>
  6. #include <hamsandwich>
  7. #include <nvault>
  8. #include <colorchat>
  9.  
  10. #define PLUGIN "Call of Duty: MW Mod"
  11. #define VERSION "0.8.0"
  12. #define AUTHOR "QTM_Peyote"
  13.  
  14. #define STANDARDNA_brzina 250.0
  15.  
  16. #define ZADATAK_POKAZI_INFORMACIJE 672
  17. #define ZADATAK_PROVERA 704
  18. #define ZADATAK_POKAZI_REKLAME 768
  19. #define ZADATAK_POSTAVI_brzinu 832
  20. #define weapon
  21.  
  22. //#define BOTY 1
  23.  
  24. new za_hejtere[] = "MARS U PICKU MATERINU I TI I DISASSEMBLER, BOTINO RASPALA" // hvala desikac
  25.  
  26. new SyncHudObj;
  27. new SyncHudObj3;
  28. new g_msg_screenfade;
  29.  
  30. new cvar_xp_za_ubistvo;
  31.  
  32. new sprite_white;
  33. new sprite_blast;
  34. new sprite_beam;
  35.  
  36. new g_vault;
  37.  
  38. new iskustvo_za_pare;
  39. new iskustvo_za_mnogopara;
  40.  
  41. new Ubrania_CT[4][]={"sas","gsg9","urban","gign"};
  42. new Ubrania_Terro[4][]={"arctic","leet","guerilla","terror"};
  43.  
  44. new const maxAmmo[31]={0,52,0,90,1,32,1,100,90,1,120,100,100,90,90,90,100,120,30,120,200,32,90,120,90,2,35,90,90,0,100};
  45. new const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
  46. 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
  47.  
  48. new informacije_predmet_igraca[33][2];
  49. new const naziv_predmeta[][] = {"Nema",
  50. "Necujne Cizme", //1
  51. "Dupli Pancir", //2
  52. "Ojacani Pancir", //3
  53. "Veteran sa nozem", //4
  54. "Iznenadi neprijatelje", //5
  55. "Nevidljivost", //6
  56. "Respawn", //7
  57. "Noz Marinca", //8
  58. "Kamuflaza", //9
  59. "HE Expert", //10
  60. "Dupli Skok", //11
  61. "Vojna tajna", //12
  62. "AWP Master",//13
  63. "Adrenalin",//14
  64. "Rambova tajna",//15
  65. "Deagle Manijak",//16
  66. "Super Pancir",//17
  67. "Extra HP++",//18
  68. "Komplet za prvu pomoc",//19
  69. "No Recoil",//20
  70. "Titanijumski metci",//21
  71. "Pukovnikovi metci",//22
  72. "Ogranicen no-recoil",//23
  73. "SWAT Stit",//24
  74. "50 HP++",//25
  75. "Nano Oklop",//26
  76. "BulletProof",//27
  77. "Jetpack",
  78. "Gravitacija",
  79. "Speed",
  80. "Scout Expert",
  81. "Elixir",
  82. "Madjionicar",
  83. "Dupli XP",
  84. "Assassinov plast"
  85.  
  86. };
  87.  
  88. new const opis_predmet[][] = {"Ubi nekog i dobices predmet",
  89. "Necujno trcanje",
  90. "Smanjuje stetu za LW %",
  91. "Smanjuje stetu za LW %",
  92. "Brze ubijas nozem",
  93. "Kada pogodite nekog od pozadi, povrede su dva puta vece",
  94. "Imate LW % nevidljivosti",
  95. "1/LW sanse da se respawn posle smrti",
  96. "Brzo ubijanje nozem",
  97. "Imate 1/LW sanse da odmah ubijete sa HE. Takodje izgledate kao neprijatelj",
  98. "Instant kill sa granatom (HE). Zadajes LW % dodatne stete",
  99. "Dupli skok",
  100. "Vase povrede su smanjene za 5. Imate 1/LW sanse da oslepite neprijatelja",
  101. "Instant kill sa AWP",
  102. "Za svaki kill dobijate 50hp",
  103. "Za svaki kill dobijate pun sarzer i 20hp",
  104. "Dobijate Deagle",
  105. "Imate 500 stita",
  106. "Dobijate +100hp svake runde, ali zato ste sporiji",
  107. "Koristite da regeneriste maximalni HP",
  108. "Nema trzanja puske kad pucate",
  109. "Zadajete protivnicima +10 vise stete",
  110. "Zadajete protivnicima +20 vise stete",
  111. "Smanjeno trazanje puske",
  112. "Ni jedan predmet nece uticati na vas",
  113. "Dobijate +50hp svake runde, ali zato ste sporiji",
  114. "Imate 1/LW sanse da izbegnete stetu",
  115. "Otporni ste na 3 metka u svakom krugu",
  116. "Pritisnite CRTL i SPACE da koristite jetpack, jetpack se obnavlja svake 4 sec",
  117. "Smanjena gravitacija",
  118. "Povecana Brzina",
  119. "Dodaje vam 200HP",
  120. "Kad cucite sa nozem nevidljivi ste",
  121. "Dobijate duplo vise XP za kill",
  122. "Nevidljivi ste dok drzite noz"
  123. };
  124.  
  125. new klasa_igraca[33];
  126. new level_igraca[33] = 1;
  127. new iskustvo_igraca[33];
  128.  
  129. new nova_klasa_igraca[33];
  130.  
  131. new const iskustvo_levelu[] = {0,7,28,63,112,175,252,343,448,567,700,847,1008,1183,1372,1575,1792,2023,2268,2527,
  132. 2800,3087,3388,3703,4032,4375,4732,5103,5488,5887,6300,6727,7168,7623,8092,8575,9072,9583,10108,10647,
  133. 11200,11767,12348,12943,13552,14175,14812,15463,16128,16807,17500,18207,18928,19663,20412,21175,21952,22743,23548,24367,
  134. 25200,26047,26908,27783,28672,29575,30492,31423,32368,33327,34300,35287,36288,37303,38332,39375,40432,41503,42588,43687,
  135. 44800,45927,47068,48223,49392,50575,51772,52983,54208,55447,56700,57967,59248,60543,61852,63175,64512,65863,67228,68607,
  136. 70000,71407,72828,74263,75712,77175,78652,80143,81648,83167,84700,86247,87808,89383,90972,92575,94192,95823,97468,99127,
  137. 100800,102487,104188,105903,107632,109375,111132,112903,114688,116487,118300,120127,121968,123823,125692,127575,129472,131383,133308,135247,
  138. 137200,139167,141148,143143,145152,147175,149212,151263,153328,155407,157500,159607,161728,163863,166012,168175,170352,172543,174748,176967,
  139. 179200,181447,183708,185983,188272,190575,192892,195223,197568,199927,202300,204687,207088,209503,211932,214375,216832,219303,221788,224287,
  140. 226800,229327,231868,234423,236992,239575,242172,244783,247408,250047,252700,255367,258048,260743,263452,266175,268912,271663,274428,277207,
  141. 280000,282807,285628,288463,291312,294175,297052,299943,302848,305767,308700,311647,314608,317583,320572,323575,326592,329623,332668,335727,
  142. 338800,341887,344988,348103,351232,354375,357532,360703,363888,367087,370300,373527,376768,380023,383292,386575,389872,393183,396508,399847,
  143. 403200,406567,409948,413343,416752,420175,423612,427063,430528,434007,437500,441007,444528,448063,451612,455175,458752,462343,465948,469567,
  144. 473200,476847,480508,484183,487872,491575,495292,499023,502768,506527,510300,514087,517888,521703,525532,529375,533232,537103,540988,544887,
  145. 548800,552727,556668,560623,564592,568575,572572,576583,580608,584647,588700,592767,596848,600943,605052,609175,613312,617463,621628,625807,
  146. 630000,634207,638428,642663,646912,651175,655452,659743,664048,668367,672700,677047,681408,685783,690172,694575,698992,703423,707868,712327,
  147. 716800,721287,725788,730303,734832,739375,743932,748503,753088,757687,762300,766927,771568,776223,780892,785575,790272,794983,799708,804447,
  148. 809200,813967,818748,823543,828352,833175,838012,842863,847728,852607,857500,862407,867328,872263,877212,882175,887152,892143,897148,902167,
  149. 907200,912247,917308,922383,927472,932575,937692,942823,947968,953127,958300,963487,968688,973903,979132,984375,989632,994903,1000188,1005487,
  150. 1010800,1016127,1021468,1026823,1032192,1037575,1042972,1048383,1053808,1059247,1064700,1070167,1075648,1081143,1086652,1092175,1097712,1103263,1108828,1114407,
  151. 1120000,1125607,1131228,1136863,1142512,1148175,1153852,1159543,1165248,1170967,1176700,1182447,1188208,1193983,1199772,1205575,1211392,1217223,1223068,1228927,
  152. 1234800,1240687,1246588,1252503,1258432,1264375,1270332,1276303,1282288,1288287,1294300,1300327,1306368,1312423,1318492,1324575,1330672,1336783,1342908,1349047,
  153. 1355200,1361367,1367548,1373743,1379952,1386175,1392412,1398663,1404928,1411207,1417500,1423807,1430128,1436463,1442812,1449175,1455552,1461943,1468348,1474767,
  154. 1481200,1487647,1494108,1500583,1507072,1513575,1520092,1526623,1533168,1539727,1546300,1552887,1559488,1566103,1572732,1579375,1586032,1592703,1599388,1606087,
  155. 1612800,1619527,1626268,1633023,1639792,1646575,1653372,1660183,1667008,1673847,1680700,1687567,1694448,1701343,1708252,1715175,1722112,1729063,1736028,1743007,
  156. 1750000,1757007,1764028,1771063,1778112,1785175,1792252,1799343,1806448,1813567,1820700,1827847,1835008,1842183,1849372,1856575,1863792,1871023,1878268,1885527,
  157. 1892800,1900087,1907388,1914703,1922032,1929375,1936732,1944103,1951488,1958887,1966300,1973727,1981168,1988623,1996092,2003575,2011072,2018583,2026108,2033647,
  158. 2041200,2048767,2056348,2063943,2071552,2079175,2086812,2094463,2102128,2109807,2117500,2125207,2132928,2140663,2148412,2156175,2163952,2171743,2179548,2187367,
  159. 2195200,2203047,2210908,2218783,2226672,2234575,2242492,2250423,2258368,2266327,2274300,2282287,2290288,2298303,2306332,2314375,2322432,2330503,2338588,2346687,
  160. 2354800,2362927,2371068,2379223,2387392,2395575,2403772,2411983,2420208,2428447,2436700,2444967,2453248,2461543,2469852,2478175,2486512,2494863,2503228,2511607,
  161. 2520000,2528407,2536828,2545263,2553712,2562175,2570652,2579143,2587648,2596167,2604700,2613247,2621808,2630383,2638972,2647575,2656192,2664823,2673468,2682127,
  162. 2690800,2699487,2708188,2716903,2725632,2734375,2743132,2751903,2760688,2769487,2778300,2787127,2795968,2804823,2813692,2822575,2831472,2840383,2849308,2858247,
  163. 2867200,2876167,2885148,2894143,2903152,2912175,2921212,2930263,2939328,2948407,2957500,2966607,2975728,2984863,2994012,3003175,3012352,3021543,3030748,3039967,
  164. 3049200,3058447,3067708,3076983,3086272,3095575,3104892,3114223,3123568,3132927,3142300,3151687,3161088,3170503,3179932,3189375,3198832,3208303,3217788,3227287,
  165. 3236800,3246327,3255868,3265423,3274992,3284575,3294172,3303783,3313408,3323047,3332700,3342367,3352048,3361743,3371452,3381175,3390912,3400663,3410428,3420207,
  166. 3430000,3439807,3449628,3459463,3469312,3479175,3489052,3498943,3508848,3518767,3528700,3538647,3548608,3558583,3568572,3578575,3588592,3598623,3608668,3618727,
  167. 3628800,3638887,3648988,3659103,3669232,3679375,3689532,3699703,3709888,3720087,3730300,3740527,3750768,3761023,3771292,3781575,3791872,3802183,3812508,3822847,
  168. 3833200,3843567,3853948,3864343,3874752,3885175,3895612,3906063,3916528,3927007,3937500,3948007,3958528,3969063,3979612,3990175,4000752,4011343,4021948,4032567,
  169. 4043200,4053847,4064508,4075183,4085872,4096575,4107292,4118023,4128768,4139527,4150300,4161087,4171888,4182703,4193532,4204375,4215232,4226103,4236988,4247887,
  170. 4258800,4269727,4280668,4291623,4302592,4313575,4324572,4335583,4346608,4357647,4368700,4379767,4390848,4401943,4413052,4424175,4435312,4446463,4457628,4468807,
  171. 4480000,4491207,4502428,4513663,4524912,4536175,4547452,4558743,4570048,4581367,4592700,4604047,4615408,4626783,4638172,4649575,4660992,4672423,4683868,4695327,
  172. 4706800,4718287,4729788,4741303,4752832,4764375,4775932,4787503,4799088,4810687,4822300,4833927,4845568,4857223,4868892,4880575,4892272,4903983,4915708,4927447,
  173. 4939200,4950967,4962748,4974543,4986352,4998175,5010012,5021863,5033728,5045607,5057500,5069407,5081328,5093263,5105212,5117175,5129152,5141143,5153148,5165167,
  174. 5177200,5189247,5201308,5213383,5225472,5237575,5249692,5261823,5273968,5286127,5298300,5310487,5322688,5334903,5347132,5359375,5371632,5383903,5396188,5408487,
  175. 5420800,5433127,5445468,5457823,5470192,5482575,5494972,5507383,5519808,5532247,5544700,5557167,5569648,5582143,5594652,5607175,5619712,5632263,5644828,5657407,
  176. 5670000,5682607,5695228,5707863,5720512,5733175,5745852,5758543,5771248,5783967,5796700,5809447,5822208,5834983,5847772,5860575,5873392,5886223,5899068,5911927,
  177. 5924800,5937687,5950588,5963503,5976432,5989375,6002332,6015303,6028288,6041287,6054300,6067327,6080368,6093423,6106492,6119575,6132672,6145783,6158908,6172047,
  178. 6185200,6198367,6211548,6224743,6237952,6251175,6264412,6277663,6290928,6304207,6317500,6330807,6344128,6357463,6370812,6384175,6397552,6410943,6424348,6437767,
  179. 6451200,6464647,6478108,6491583,6505072,6518575,6532092,6545623,6559168,6572727,6586300,6599887,6613488,6627103,6640732,6654375,6668032,6681703,6695388,6709087,
  180. 6722800,6736527,6750268,6764023,6777792,6791575,6805372,6819183,6833008,6846847,6860700,6874567,6888448,6902343,6916252,6930175,6944112,6958063,6972028,6986007,
  181. 7000000,7014007,7028028,7042063,7056112,7070175,7084252,7098343,7112448,7126567,7140700,7154847,7169008,7183183,7197372,7211575,7225792,7240023,7254268,7268527,
  182. 7282800,7297087,7311388,7325703,7340032,7354375,7368732,7383103,7397488,7411887,7426300,7440727,7455168,7469623,7484092,7498575,7513072,7527583,7542108,7556647,
  183. 7571200,7585767,7600348,7614943,7629552,7644175,7658812,7673463,7688128,7702807,7717500,7732207,7746928,7761663,7776412,7791175,7805952,7820743,7835548,7850367,
  184. 7865200,7880047,7894908,7909783,7924672,7939575,7954492,7969423,7984368,7999327,8014300,8029287,8044288,8059303,8074332,8089375,8104432,8119503,8134588,8149687,
  185. 8164800,8179927,8195068,8210223,8225392,8240575,8255772,8270983,8286208,8301447,8316700,8331967,8347248,8362543,8377852,8393175,8408512,8423863,8439228,8454607,
  186. 8470000,8485407,8500828,8516263,8531712,8547175,8562652,8578143,8593648,8609167,8624700,8640247,8655808,8671383,8686972,8702575,8718192,8733823,8749468,8765127,
  187. 8780800,8796487,8812188,8827903,8843632,8859375,8875132,8890903,8906688,8922487,8938300,8954127,8969968,8985823,9001692,9017575,9033472,9049383,9065308,9081247,
  188. 9097200,9113167,9129148,9145143,9161152,9177175,9193212,9209263,9225328,9241407,9257500,9273607,9289728,9305863,9322012,9338175,9354352,9370543,9386748,9402967,
  189. 9419200,9435447,9451708,9467983,9484272,9500575,9516892,9533223,9549568,9565927,9582300,9598687,9615088,9631503,9647932,9664375,9680832,9697303,9713788,9730287,
  190. 9746800,9763327,9779868,9796423,9812992,9829575,9846172,9862783,9879408,9896047,9912700,9929367,9946048,9962743,9979452,9996175,10012912,10029663,10046428,10063207,
  191. 10080000,10096807,10113628,10130463,10147312,10164175,10181052,10197943,10214848,10231767,10248700,10265647,10282608,10299583,10316572,10333575,10350592,10367623,10384668,10401727,
  192. 10418800,10435887,10452988,10470103,10487232,10504375,10521532,10538703,10555888,10573087,10590300,10607527,10624768,10642023,10659292,10676575,10693872,10711183,10728508,10745847,
  193. 10763200,10780567,10797948,10815343,10832752,10850175,10867612,10885063,10902528,10920007,10937500,10955007,10972528,10990063,11007612,11025175,11042752,11060343,11077948,11095567,
  194. 11113200,11130847,11148508,11166183,11183872,11201575,11219292,11237023,11254768,11272527,11290300,11308087,11325888,11343703,11361532,11379375,11397232,11415103,11432988,11450887,
  195. 11468800,11486727,11504668,11522623,11540592,11558575,11576572,11594583,11612608,11630647,11648700,11666767,11684848,11702943,11721052,11739175,11757312,11775463,11793628,11811807,
  196. 11830000,11848207,11866428,11884663,11902912,11921175,11939452,11957743,11976048,11994367,12012700,12031047,12049408,12067783,12086172,12104575,12122992,12141423,12159868,12178327,
  197. 12196800,12215287,12233788,12252303,12270832,12289375,12307932,12326503,12345088,12363687,12382300,12400927,12419568,12438223,12456892,12475575,12494272,12512983,12531708,12550447,
  198. 12569200,12587967,12606748,12625543,12644352,12663175,12682012,12700863,12719728,12738607,12757500,12776407,12795328,12814263,12833212,12852175,12871152,12890143,12909148,12928167,
  199. 12947200,12966247,12985308,13004383,13023472,13042575,13061692,13080823,13099968,13119127,13138300,13157487,13176688,13195903,13215132,13234375,13253632,13272903,13292188,13311487,
  200. 13330800,13350127,13369468,13388823,13408192,13427575,13446972,13466383,13485808,13505247,13524700,13544167,13563648,13583143,13602652,13622175,13641712,13661263,13680828,13700407,
  201. 13720000,13739607,13759228,13778863,13798512,13818175,13837852,13857543,13877248,13896967,13916700,13936447,13956208,13975983,13995772,14015575,14035392,14055223,14075068,14094927,
  202. 14114800,14134687,14154588,14174503,14194432,14214375,14234332,14254303,14274288,14294287,14314300,14334327,14354368,14374423,14394492,14414575,14434672,14454783,14474908,14495047,
  203. 14515200,14535367,14555548,14575743,14595952,14616175,14636412,14656663,14676928,14697207,14717500,14737807,14758128,14778463,14798812,14819175,14839552,14859943,14880348,14900767,
  204. 14921200,14941647,14962108,14982583,15003072,15023575,15044092,15064623,15085168,15105727,15126300,15146887,15167488,15188103,15208732,15229375,15250032,15270703,15291388,15312087,
  205. 15332800,15353527,15374268,15395023,15415792,15436575,15457372,15478183,15499008,15519847,15540700,15561567,15582448,15603343,15624252,15645175,15666112,15687063,15708028,15729007};
  206.  
  207. new poeni_igraca[33];
  208. new energija_igraca[33];
  209. new inteligencija_igraca[33];
  210. new snaga_igraca[33];
  211. new Float:smanjene_povrede_igraca[33];
  212. new kondicija_igraca[33];
  213. new maximalna_energija_igraca[33];
  214. new Float:brzina_igraca[33];
  215.  
  216. enum { NONE = 0, Snajperista, Marinac, Pro_Strelac, Mitraljezac, Doktor, Vatrena_Podrska, Miner, Demolitions, Rusher, Rambo, Partizan, Spijun, Bombarder, Gunner, Pesadinac, Pobunjenik, Assassin, SWAT, Crysis, Warrior, Super_Miner, Predator, General, Revolveras, Univerzalni_Vojnik, Joker, Cyrax, Jason_Bourne, Hunter, Destroyer, Cetnik, Steven_Seagal, SAS};
  217. new const energija_klasa[] = { 0, 120, 140, 110, 120, 110, 100, 100, 110, 100, 130, 100, 70, 140, 125, 100, 125, 10, 100, 80, 120, 105, 100, 100, 120, 220, 180, 120, 210, 250, 100, 110, 230, 120};
  218. new const Float:brzina_klasa[] = {0.0, 1.2, 1.35, 0.8, 0.8, 1.0, 1.0, 1.0, 1.0, 1.3 , 1.15, 1.1, 1.2, 0.9, 0.9, 1.35, 1.2, 2.0, 0.8, 1.35, 0.9, 1.0, 1.1, 1.0, 1.1, 1.1, 0.9, 1.0, 1.1, 1.2, 1.0, 1.0, 1.1, 1.1};
  219. new const oklop_klase[] = { 0, 100, 100, 100, 150, 100, 0, 100, 100, 0, 150, 0, 0, 150, 50, 0, 25, 100, 0, 100, 100, 100, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100};
  220. new const naziv_klase[][] = {"Nema",
  221. "Snajperista",
  222. "Marinac",
  223. "Pro-Strelac",
  224. "Mitraljezac",
  225. "Doktor",
  226. "Vatrena podrska",
  227. "Miner",
  228. "Demolitions",
  229. "Rusher",
  230. "Rambo (Premium)",
  231. "Partizan",
  232. "Spijun",
  233. "Bombarder",
  234. "Gunner(Premium)",
  235. "Pesadinac",
  236. "Pobunjenik",
  237. "Assassin (Premium)",
  238. "SWAT",
  239. "Crysis",
  240. "Warrior",
  241. "Super Miner",
  242. "Predator",
  243. "General",
  244. "Revolveras",
  245. "Univerzalni Vojnik (Premium)",
  246. "Joker (Premium)",
  247. "Cyrax",
  248. "Jason Bourne (Premium)",
  249. "Hunter (Super)",
  250. "Destroyer",
  251. "Cetnik",
  252. "Steven Seagal (Super)",
  253. "SAS"
  254. };
  255.  
  256. new const frakcije[][] = {
  257. "Nema",
  258. "\yObicne Klase",
  259. "\yPremium Klase",
  260. "\ySuper Klase"
  261. }
  262.  
  263. enum {
  264. NONE = 0,
  265. obicna,
  266. premium,
  267. super
  268. }
  269.  
  270. new const pripada[] = {
  271. NONE, // Nema 0
  272. obicna, // Snajperista 1
  273. obicna, // Marinac 2
  274. obicna, // Pro Strelac 3
  275. obicna, // Mitraljezac 4
  276. obicna, // Doktor 5
  277. obicna, // Vatrena Podrska 6
  278. obicna, // Miner 7
  279. obicna, // Demolitions 8
  280. obicna, // Rusher 9
  281. premium, // Rambo (Premium) 10
  282. obicna, // Partizan 11
  283. obicna, // Spijun 12
  284. obicna, // Bomberder 13
  285. obicna, // Gunner (Premium) 14
  286. obicna, // Pesadinac 15
  287. obicna, // Pobunjenik 16
  288. obicna, // terorista 17
  289. premium, // Assassin (Premium) 18
  290. obicna, // SWAT 19
  291. obicna, // Crysis 20
  292. obicna, // Warrior 21
  293. obicna, // Super Miner 22
  294. obicna, // Predator 23
  295. obicna, // General 24
  296. obicna, // Revolveras 25
  297. premium, // Univerzalni Vojnik (Premium) 26
  298. premium, // Joker (Premium) 27
  299. obicna, // Cyrax 28
  300. premium, // Jason Bourne (Premium) 29
  301. super, // Hunter (Super) 30
  302. obicna, // Destroyer 31
  303. obicna, // Cetnik 32
  304. super, // Steven Seagal (Super) 33
  305. obicna, // SAS 34
  306.  
  307.  
  308. }
  309. new frakcija_igraca[33]
  310.  
  311. new const opis_klase[][] = {"Nema",
  312. "\yOruzije:\w AWP, Deagle, Scout^n\yEnergija:\w 120 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 120%^n\ySpecijalne moci:\w 1:3 sansa za brzo ubijanje nozem",
  313. "\yOruzije:\w Deagle^n\yEnergija:\w 140 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 135%^n\ySpecijalne moci:\w Odma ubija nozem",
  314. "\yOruzije:\w AK47, M4A1^n\yEnergija:\w 110 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 80%^n\ySpecijalne moci:\w Nema",
  315. "\yOruzije:\w M249(krmaca)^n\yEnergija:\w 120 HP^n\yArmor:\w 150 AP^n\yBrzina:\w 80%^n\ySpecijalne moci:\w Otporan na mine, ima sve bombe",
  316. "\yOruzije:\w UMP45, TMP^n\yEnergija:\w 110 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Ima komplet za prvu pomoc i otporan na noz",
  317. "\yOruzije:\w MP5^n\yEnergija:\w 100 HP^n\yArmor:\w 0 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Ima dve rakete",
  318. "\yOruzije:\w P90^n\yEnergija:\w 100 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Dobija 3 mine",
  319. "\yOruzije:\w AUG^n\yEnergija:\w 110 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Ima sve bombe, dobija dinamit, koji ubija sve u krugu od 1m",
  320. "\yOruzije:\w M3(pumparica)^n\yEnergija:\w 100 HP^n\yArmor:\w 0 AP^n\yBrzina:\w 130%^n\ySpecijalne moci:\w Nema",
  321. "\yOruzije:\w FAMAS^n\yEnergija:\w 130 HP^n\yArmor:\w 150 AP^n\yBrzina:\w 115%^n\ySpecijalne moci:\w Za svako ubistvo dobija 20 HP i pun sanzer, dupli skok^n\yKontakt:\w vaske.va08@hotmail.com",
  322. "\yOruzije:\w P90, FLASHBANG^n\yEnergija:\w 100 HP^n\yArmor:\w 0 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Manje je vidljiv",
  323. "\yOruzije:\w Deagle^n\yEnergija:\w 70 HP^n\yArmor:\w 0 AP^n\yBrzina:\w 120%^n\ySpecijalne moci:\w Kamuflaza (izgleda kao neprijatelj)",
  324. "\yOruzije:\w M4A1, Deagle, HE-Grenade^n\yEnergija:\w 140 HP^n\yArmor:\w 150 AP^n\yBrzina:\w 90%^n\ySpecijalne moci:\w Nema",
  325. "\yOruzije:\w G3/SG-1(rafalni snajper)^n\yEnergija:\w 125 HP^n\yArmor:\w 50 AP^n\yBrzina:\w 90%^n\ySpecijalne moci:\w Ima 1 raketu^n\yKontakt:\w vaske.va08@hotmail.com",
  326. "\yOruzije:\w GAIL + P228,^n\yEnergija:\w 100 HP^n\yArmor:\w 0 AP^n\yBrzina:\w 135%^n\ySpecijalne moci:\w Nema",
  327. "\yOruzije:\w SG552, HE-Grenade^n\yEnergija:\w 100 HP^n\yArmor:\w 25 AP^n\yBrzina:\w 120%^n\ySpecijalne moci:\w Ima 1 minu",
  328. "\yOruzije:\w Noz, USP^n\yEnergija:\w 10 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 200%^n\ySpecijalne moci:\w Nevidljiv kad ima noz^n\yKontakt:\w vaske.va08@hotmail.com",
  329. "\yOruzije:\w M4a1^n\yEnergija:\w 100 HP^n\yArmor:\w 0 AP^n\yBrzina:\w 80%^n\ySpecijalne moci:\w Otporan na noz",
  330. "\yOruzije:\w M4a1, Sig 552^n\yEnergija:\w 80 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 135%^n\ySpecijalne moci:\w Ima jednu raketu",
  331. "\yOruzije:\w FAMAS^n\yEnergija:\w 120 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 90%^n\ySpecijalne moci:\w Nema",
  332. "\yOruzije:\w P90^n\yEnergija:\w 105 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Ima 5 mina",
  333. "\yOruzije:\w Deagle^n\yEnergija:\w 100 HP^n\yArmor:\w 50 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Manje je vidljiv i ima jednu raketu i instant nozem",
  334. "\yOruzije:\w AWP, M4a1, HE^n\yEnergija:\w 100 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Ima 1 / 5 sanse za instant kill AWP-om",
  335. "\yOruzije:\w Svi pistolji^n\yEnergija:\w 120 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Nema",
  336. "\yOruzije:\w M4a1^n\yEnergija:\w 220 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Ima Komplet za prvu pomoc i otporan je na noz",
  337. "\yOruzije:\w M3, XM 1014^n\yEnergija:\w 180 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 90%^n\ySpecijalne moci:\w Ima JetPack, otporan na noz i ima 2 dinamita",
  338. "\yOruzije:\w AUG, SCOUT, 2FB^n\yEnergija:\w 120 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Ima 1 dinamit",
  339. "\yOruzije:\w M4a1, TMP, DEAGLE^n\yEnergija:\w 210 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Otporan na noz i ima 1 / 7 sanse za instant sa DEAGLE-om",
  340. "\yOruzije:\w TMP, AWP^n\yEnergija:\w 250 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 120%^n\ySpecijalne moci:\w Ima 1 / 3 sa AWP, otporan na noz i nevidljiv je kad cuci sa nozem",
  341. "\yOruzije:\w AK47, DEAGLE^n\yEnergija:\w 100 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Duplo se brze leveluje",
  342. "\yOruzije:\w Galil^n\yEnergija:\w 110 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 100%^n\ySpecijalne moci:\w Nema",
  343. "\yOruzije:\w M4a1, TMP^n\yEnergija:\w 230 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Komplet za prvu pomoc, otporan na noz i ima bulletproof",
  344. "\yOruzije:\w M4a1^n\yEnergija:\w 120 HP^n\yArmor:\w 100 AP^n\yBrzina:\w 110%^n\ySpecijalne moci:\w Nema"
  345. };
  346.  
  347. new broj_medkit_igraca[33];
  348. new broj_raketa_igraca[33];
  349. new Float:prethodna_raketa_igraca[33];
  350. new broj_min_igraca[33];
  351. new broj_dinamita_igraca[33];
  352. new broj_skokova_igraca[33];
  353.  
  354. new bool:freezetime = true;
  355.  
  356. public plugin_init()
  357. {
  358. register_plugin(PLUGIN, VERSION, AUTHOR);
  359.  
  360. g_vault = nvault_open("CodMod");
  361.  
  362. register_think("MedKit","MedKitThink");
  363.  
  364. RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
  365. RegisterHam(Ham_Spawn, "player", "Pocetak", 1);
  366. RegisterHam(Ham_Touch, "armoury_entity", "DodirOruzija");
  367. RegisterHam(Ham_Touch, "weapon_shield", "DodirOruzija");
  368. RegisterHam(Ham_Touch, "weaponbox", "DodirOruzija");
  369.  
  370. register_forward(FM_CmdStart, "CmdStart");
  371. register_forward(FM_EmitSound, "EmitSound");
  372.  
  373. register_logevent("PocetakRunde", 2, "1=Round_Start");
  374.  
  375. register_event("DeathMsg", "Death", "ade");
  376. register_event("Damage", "Damage", "b", "2!=0");
  377. register_event("CurWeapon","CurWeapon","be", "1=1");
  378. register_event("HLTV", "novaRunda", "a", "1=0", "2=0");
  379.  
  380. register_touch("Rocket", "*" , "DodirRakete");
  381. register_touch("Mine", "player", "DodirMine");
  382.  
  383. cvar_xp_za_ubistvo = register_cvar("cod_killxp", "70");
  384.  
  385. register_clcmd("say /klasa", "IzaberiKlasu");
  386. register_clcmd("say /opis", "OpisKlase");
  387. register_clcmd("say /predmet", "OpisPredmeta");
  388. register_clcmd("say /item", "OpisPredmeta");
  389. register_clcmd("say /drop", "IzbaciPredmet");
  390. register_clcmd("say /izbaci", "IzbaciPredmet");
  391. register_clcmd("say /reset", "KomandaResetujPoene");
  392. register_clcmd("say /shop", "Shop");
  393. register_clcmd("say /pomoc", "Pomoc");
  394. register_clcmd("say /help", "Pomoc");
  395. register_clcmd("fullupdate", "BlokirajKomande");
  396.  
  397. g_msg_screenfade = get_user_msgid("ScreenFade");
  398.  
  399. SyncHudObj = CreateHudSyncObj();
  400. SyncHudObj3 = CreateHudSyncObj();
  401.  
  402. register_menucmd(register_menuid("Klasa:"), 1023, "OpisKlase");
  403. iskustvo_za_pare = 400;
  404. iskustvo_za_mnogopara = 1000;
  405.  
  406. format(za_hejtere, 10, "1")
  407. }
  408.  
  409. public plugin_cfg()
  410. {
  411. server_cmd("sv_maxspeed 9999");
  412. }
  413.  
  414. public plugin_precache()
  415. {
  416. new Entity = create_entity( "info_map_parameters" );
  417.  
  418. DispatchKeyValue( Entity, "buying", "3" );
  419. DispatchSpawn( Entity );
  420.  
  421. sprite_white = precache_model("sprites/white.spr") ;
  422. sprite_blast = precache_model("sprites/dexplo.spr");
  423. sprite_beam = precache_model("sprites/zbeam4.spr")
  424.  
  425. precache_sound("QTM_CodMod/select.wav");
  426. precache_sound("QTM_CodMod/start.wav");
  427. precache_sound("QTM_CodMod/start2.wav");
  428. precache_sound("QTM_CodMod/levelup.wav");
  429.  
  430. precache_model("models/w_medkit.mdl");
  431. precache_model("models/rpgrocket.mdl");
  432. precache_model("models/mine.mdl");
  433. }
  434.  
  435. public pfn_keyvalue( Entity )
  436. {
  437. new ClassName[ 20 ], Dummy[ 2 ];
  438. copy_keyvalue( ClassName, charsmax( ClassName ), Dummy, charsmax( Dummy ), Dummy, charsmax( Dummy ) );
  439.  
  440. if( equal( ClassName, "info_map_parameters" ) )
  441. {
  442. remove_entity( Entity );
  443. return PLUGIN_HANDLED ;
  444. }
  445. return PLUGIN_CONTINUE;
  446. }
  447.  
  448. public CmdStart(id, uc_handle)
  449. {
  450. if(!is_user_alive(id))
  451. return FMRES_IGNORED;
  452.  
  453. new button = get_uc(uc_handle, UC_Buttons);
  454. new flags = pev(id, pev_flags);
  455.  
  456. if(informacije_predmet_igraca[id][0] == 11 || klasa_igraca[id] == Rambo)
  457. {
  458. new oldbutton = pev(id, pev_oldbuttons);
  459.  
  460. if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && broj_skokova_igraca[id] > 0)
  461. {
  462. broj_skokova_igraca[id]--;
  463. new Float:velocity[3];
  464. pev(id, pev_velocity,velocity);
  465. velocity[2] = random_float(265.0,285.0);
  466. set_pev(id, pev_velocity,velocity);
  467. }
  468. else if(flags & FL_ONGROUND)
  469. {
  470. broj_skokova_igraca[id] = 0;
  471. if(informacije_predmet_igraca[id][0] == 11)
  472. broj_skokova_igraca[id]++;
  473. if(klasa_igraca[id] == Rambo)
  474. broj_skokova_igraca[id]++;
  475. }
  476. }
  477.  
  478. if(button & IN_ATTACK)
  479. {
  480. new Float:punchangle[3];
  481.  
  482. if(informacije_predmet_igraca[id][0] == 20)
  483. set_pev(id, pev_punchangle, punchangle);
  484. if(informacije_predmet_igraca[id][0] == 23)
  485. {
  486. set_pev(id, pev_punchangle, punchangle);
  487. for(new i=0; i<3;i++)
  488. punchangle[i]*=0.9;
  489. set_pev(id, pev_punchangle, punchangle);
  490. }
  491. }
  492.  
  493.  
  494. if((informacije_predmet_igraca[id][0] == 33 || klasa_igraca[id] == Hunter) && weapon == CSW_KNIFE)
  495. {
  496. if(button & IN_DUCK)
  497. set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 1);
  498. else
  499. set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
  500. }
  501.  
  502.  
  503. if((informacije_predmet_igraca[id][0] == 28 || klasa_igraca[id] == Joker) && button & IN_JUMP && button & IN_DUCK && flags & FL_ONGROUND && get_gametime() > informacije_predmet_igraca[id][1]+4.0)
  504. {
  505. informacije_predmet_igraca[id][1] = floatround(get_gametime());
  506. new Float:velocity[3];
  507. VelocityByAim(id, 700, velocity);
  508. velocity[2] = random_float(265.0,285.0);
  509. set_pev(id, pev_velocity, velocity);
  510. }
  511. return FMRES_IGNORED;
  512. }
  513.  
  514. public Shop(id)
  515. {
  516. new menu = menu_create("Shop:", "Shop_Handle");
  517. menu_additem(menu, "Aspirin \r[Dodaje 50 HP] \yCena: \r3000$");
  518. menu_additem(menu, "Morfijum \r[Dodaje 100 HP] \yCena: \r5000$");
  519. menu_additem(menu, "RedBull \r[Veci Skok + Veca Brzina] \yCena: \r7500$");
  520. menu_additem(menu, "Iskustvo \r[Dodaje 400 XP] \yCena: \r5000$");
  521. menu_additem(menu, "Super iskustvo \r[Dodaje 1000 XP] \yCena: \r10000$");
  522. menu_additem(menu, "Slucajni Izbor \r[Predmet] \yCena: \r3000$");
  523. menu_additem(menu, "Mine \r[Dobijate 2 Mine] \yCena: \r10000$");
  524. menu_display(id, menu);
  525. }
  526. public Shop_Handle(id, menu, item)
  527. {
  528. client_cmd(id, "spk QTM_CodMod/select");
  529.  
  530. if(item == MENU_EXIT)
  531. {
  532. menu_destroy(menu);
  533. return PLUGIN_CONTINUE;
  534. }
  535. menu_display(id, menu);
  536. new pare_igraca = cs_get_user_money(id);
  537. new hp = get_user_health(id);
  538. switch(item)
  539. {
  540. case 0:
  541. {
  542. new cena = 3000;
  543. if (pare_igraca<cena)
  544. {
  545. ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
  546. return PLUGIN_CONTINUE;
  547. }
  548. if(hp >= maximalna_energija_igraca[id] || klasa_igraca[id] == Assassin)
  549. {
  550. ColorChat(id,GREEN,"[Shop] ^1Vec imate maximalnu energiju.");
  551. return PLUGIN_CONTINUE;
  552. }
  553. new ammount=50;
  554. new nova_energija = (hp+ammount<maximalna_energija_igraca[id])? hp+ammount: maximalna_energija_igraca[id];
  555. set_user_health(id, nova_energija);
  556. ColorChat(id,GREEN,"[Shop] ^1kupio si ^3Aspirin");
  557. cs_set_user_money(id, pare_igraca-cena);
  558. }
  559. case 1:
  560. {
  561. new cena = 5000;
  562. if (pare_igraca<cena)
  563. {
  564. ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
  565. return PLUGIN_CONTINUE;
  566. }
  567. if(hp >= maximalna_energija_igraca[id] || klasa_igraca[id] == Assassin)
  568. {
  569. ColorChat(id,GREEN,"[Shop] ^1Vec imate maximalnu energiju.");
  570. return PLUGIN_CONTINUE;
  571. }
  572. new ammount=100;
  573. new nova_energija = (hp+ammount<maximalna_energija_igraca[id])? hp+ammount: maximalna_energija_igraca[id];
  574. set_user_health(id, nova_energija);
  575. ColorChat(id,GREEN,"[Shop] ^1Kupio si^3 Morfijum");
  576. cs_set_user_money(id, pare_igraca-cena);
  577. }
  578. case 2:
  579. {
  580. new cena = 7500;
  581. if (pare_igraca<cena)
  582. {
  583. ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
  584. return PLUGIN_CONTINUE;
  585. }
  586. set_user_gravity(id,get_user_gravity(id) - 0.3);
  587. set_user_maxspeed(id,get_user_maxspeed(id) + 10.0);
  588. ColorChat(id,GREEN,"[Shop]^1 Kupio si^3 RedBull");
  589. cs_set_user_money(id, pare_igraca-cena)
  590. }
  591. case 3:
  592. {
  593. new cena = 5000;
  594. if (pare_igraca<cena)
  595. {
  596. ColorChat(id,GREEN,"[Shop]^1 Nemas dovoljno para.");
  597. return PLUGIN_CONTINUE;
  598. }
  599. iskustvo_igraca[id] += iskustvo_za_pare;
  600. ColorChat(id,GREEN,"[Shop] ^1Kupio si ^3Iskustvo");
  601. cs_set_user_money(id, pare_igraca-cena)
  602. ProveriNivo(id);
  603. }
  604. case 4:
  605. {
  606. new cena = 10000;
  607. if (pare_igraca<cena)
  608. {
  609. ColorChat(id,GREEN,"[Shop]^1 Nemas dovoljno para.");
  610. return PLUGIN_CONTINUE;
  611. }
  612. iskustvo_igraca[id] += iskustvo_za_mnogopara;
  613. ColorChat(id,GREEN,"[Shop]^1Kupio si ^3Super Iskustvo");
  614. cs_set_user_money(id, pare_igraca-cena)
  615. ProveriNivo(id);
  616. }
  617. case 5:
  618. {
  619. new cena = 3000;
  620. if (pare_igraca<cena)
  621. {
  622. ColorChat(id,RED,"[Shop]^1 Nemas dovoljno para!");
  623. return PLUGIN_CONTINUE;
  624. }
  625. cs_set_user_money(id, pare_igraca-cena)
  626. DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
  627. }
  628. case 6:
  629. {
  630. new cena = 10000;
  631. if (pare_igraca<cena)
  632. {
  633. ColorChat(id,RED,"[Shop]^1 Nemas dovoljno para!");
  634. return PLUGIN_HANDLED;
  635. }
  636. else if(klasa_igraca[id] == Vatrena_Podrska || klasa_igraca[id] == Marinac || klasa_igraca[id] == Miner || klasa_igraca[id] == Demolitions || klasa_igraca[id] == Gunner)
  637. {
  638. ColorChat(id,GREEN,"[Shop]^1 Vasa klasa ne moze da kupi mine");
  639. return PLUGIN_CONTINUE;
  640. }
  641. broj_min_igraca[id] +=2;
  642. ColorChat(id,GREEN,"[Shop]^1 Kupio si^3 2 ^1mine");
  643. cs_set_user_money(id, pare_igraca-cena)
  644. }
  645. }
  646. return PLUGIN_CONTINUE;
  647. }
  648.  
  649. public Pocetak(id)
  650. {
  651. if(!is_user_alive(id) || !is_user_connected(id))
  652. return PLUGIN_CONTINUE;
  653.  
  654. if(nova_klasa_igraca[id])
  655. {
  656. klasa_igraca[id] = nova_klasa_igraca[id];
  657. nova_klasa_igraca[id] = 0;
  658. strip_user_weapons(id);
  659. give_item(id, "weapon_knife");
  660.  
  661. UcitajPodatke(id, klasa_igraca[id]);
  662. }
  663.  
  664. if(!klasa_igraca[id])
  665. {
  666. IzaberiKlasu(id);
  667. return PLUGIN_CONTINUE;
  668. }
  669.  
  670. switch(klasa_igraca[id])
  671. {
  672. case Snajperista:
  673. {
  674. give_item(id, "weapon_awp");
  675. give_item(id, "weapon_scout");
  676. give_item(id, "weapon_deagle");
  677. }
  678. case Marinac:
  679. {
  680. give_item(id, "weapon_deagle");
  681. }
  682. case Pro_Strelac:
  683. {
  684. give_item(id, "weapon_m4a1");
  685. give_item(id, "weapon_ak47");
  686. }
  687. case Mitraljezac:
  688. {
  689. give_item(id, "weapon_m249");
  690. give_item(id, "weapon_hegrenade");
  691. give_item(id, "weapon_flashbang");
  692. give_item(id, "weapon_smokegrenade");
  693. }
  694. case Doktor:
  695. {
  696. give_item(id, "weapon_ump45");
  697. give_item(id, "weapon_tmp");
  698. broj_medkit_igraca[id] = 2;
  699. }
  700. case Vatrena_Podrska:
  701. {
  702. give_item(id, "weapon_mp5navy");
  703. broj_raketa_igraca[id] = 3;
  704. }
  705. case Miner:
  706. {
  707. give_item(id, "weapon_p90");
  708. broj_min_igraca[id] = 3;
  709. }
  710. case Demolitions:
  711. {
  712. give_item(id, "weapon_aug");
  713. give_item(id, "weapon_hegrenade");
  714. give_item(id, "weapon_flashbang");
  715. give_item(id, "weapon_smokegrenade");
  716. broj_dinamita_igraca[id] = 1;
  717. }
  718. case Rusher:
  719. {
  720. give_item(id, "weapon_m3");
  721. }
  722. case Rambo:
  723. {
  724. give_item(id, "weapon_famas");
  725. }
  726. case Partizan:
  727. {
  728. give_item(id, "weapon_p90");
  729. give_item(id, "weapon_flashbang");
  730. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 70);
  731. }
  732. case Spijun:
  733. {
  734. give_item(id, "weapon_deagle");
  735. PromeniModel(id, 0);
  736. }
  737. case Bombarder:
  738. {
  739. give_item(id, "weapon_m4a1");
  740. give_item(id, "weapon_deagle");
  741. give_item(id, "weapon_hegrenade");
  742. }
  743. case Gunner:
  744. {
  745. give_item(id, "weapon_g3sg1");
  746. broj_raketa_igraca[id] = 1 ;
  747. }
  748. case Pesadinac:
  749. {
  750. give_item(id, "weapon_galil");
  751. give_item(id, "weapon_p228");
  752. }
  753. case Pobunjenik:
  754. {
  755. give_item(id, "weapon_sg552");
  756. give_item(id, "weapon_hegrenade");
  757. broj_min_igraca[id] = 1 ;
  758. }
  759. case Assassin:
  760. {
  761. give_item(id, "weapon_knife");
  762. give_item(id, "weapon_usp");
  763. }
  764. case SWAT:
  765. {
  766. give_item(id, "weapon_m4a1");
  767. }
  768. case Crysis:
  769. {
  770. give_item(id, "weapon_m4a1");
  771. give_item(id, "weapon_sg552");
  772. broj_raketa_igraca[id] = 1;
  773. }
  774. case Warrior:
  775. {
  776. give_item(id, "weapon_famas");
  777. }
  778. case Super_Miner:
  779. {
  780. give_item(id, "weapon_p90");
  781. broj_min_igraca[id] = 5;
  782. }
  783. case Predator:
  784. {
  785. give_item(id, "weapon_deagle");
  786. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 70);
  787. broj_raketa_igraca[id] = 1 ;
  788. }
  789. case General:
  790. {
  791. give_item(id, "weapon_awp");
  792. give_item(id, "weapon_m4a1");
  793. give_item(id, "weapon_hegrenade");
  794. }
  795. case Revolveras:
  796. {
  797. give_item(id, "weapon_deagle");
  798. give_item(id, "weapon_elite");
  799. give_item(id, "weapon_fiveseven");
  800. give_item(id, "weapon_glock18");
  801. give_item(id, "weapon_p228");
  802. give_item(id, "weapon_usp");
  803. }
  804. case Univerzalni_Vojnik:
  805. {
  806. give_item(id, "weapon_m4a1");
  807. }
  808. case Joker:
  809. {
  810. give_item(id, "weapon_m3");
  811. give_item(id, "weapon_xm1014");
  812. broj_dinamita_igraca[id] = 2;
  813. }
  814. case Cyrax:
  815. {
  816. give_item(id, "weapon_aug");
  817. give_item(id, "weapon_scout");
  818. give_item(id, "weapon_flashbang");
  819. give_item(id, "weapon_flashbang");
  820. broj_dinamita_igraca[id] = 1;
  821. }
  822. case Jason_Bourne:
  823. {
  824. give_item(id, "weapon_m4a1");
  825. give_item(id, "weapon_tmp");
  826. give_item(id, "weapon_deagle");
  827. }
  828. case Hunter:
  829. {
  830. give_item(id, "weapon_tmp");
  831. give_item(id, "weapon_awp");
  832. }
  833. case Destroyer:
  834. {
  835. give_item(id, "weapon_ak47");
  836. give_item(id, "weapon_deagle");
  837. }
  838. case Steven Seagal:
  839. {
  840. give_item(id, "weapon_m4a1");
  841. give_item(id, "weapon_tmp");
  842. }
  843. case SAS
  844. {
  845. give_item(id, "weapon_m4a1");
  846. }
  847.  
  848.  
  849. }
  850.  
  851. if(poeni_igraca[id]>0)
  852. DodelaPoena(id);
  853.  
  854. if(informacije_predmet_igraca[id][0] == 10 || informacije_predmet_igraca[id][0] == 9)
  855. give_item(id, "weapon_hegrenade");
  856.  
  857. if(informacije_predmet_igraca[id][0] == 9)
  858. PromeniModel(id, 0);
  859.  
  860. if(informacije_predmet_igraca[id][0] == 1)
  861. set_user_footsteps(id, 1);
  862. else
  863. set_user_footsteps(id, 0);
  864.  
  865. if(informacije_predmet_igraca[id][0] == 13)
  866. give_item(id, "weapon_awp");
  867.  
  868. if(informacije_predmet_igraca[id][0] == 16)
  869. give_item(id, "weapon_deagle");
  870.  
  871. if(informacije_predmet_igraca[id][0] == 31)
  872. give_item(id, "weapon_scout");
  873.  
  874. if(((informacije_predmet_igraca[id][0] == 19) || (klasa_igraca[id] == Univerzalni_Vojnik) || (klasa_igraca[id] == Steven_Seagal)
  875. informacije_predmet_igraca[id][1] = 1;
  876.  
  877. if((informacije_predmet_igraca[id][0] == 27) || klasa_igraca[id] == Steven_Seagal)
  878. informacije_predmet_igraca[id][1] = 3;
  879.  
  880. if(informacije_predmet_igraca[id][0] == 29)
  881. set_user_gravity(id,get_user_gravity(id) - 0.4);
  882.  
  883. new weapons[32];
  884. new weaponsnum;
  885. get_user_weapons(id, weapons, weaponsnum);
  886. for(new i=0; i<weaponsnum; i++)
  887. if(is_user_alive(id))
  888. if(maxAmmo[weapons[i]] > 0)
  889. cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
  890.  
  891. PostaviAtribute(id)
  892.  
  893. return PLUGIN_CONTINUE;
  894. }
  895.  
  896. public PostaviAtribute(id)
  897. {
  898. smanjene_povrede_igraca[id] = (0.7*(1.0-floatpower(1.1, -0.112311341*float(snaga_igraca[id]))));
  899. maximalna_energija_igraca[id] = energija_klasa[klasa_igraca[id]]+energija_igraca[id]*2;
  900. brzina_igraca[id] = STANDARDNA_brzina*brzina_klasa[klasa_igraca[id]]+floatround(kondicija_igraca[id]*1.3);
  901.  
  902. if(informacije_predmet_igraca[id][0] == 18 && klasa_igraca[id] != Assassin)
  903. {
  904. maximalna_energija_igraca[id] += 100;
  905. brzina_igraca[id] -= 0.4;
  906. }
  907.  
  908. if(informacije_predmet_igraca[id][0] == 32)
  909. {
  910. maximalna_energija_igraca[id] += 200;
  911. }
  912.  
  913. if(informacije_predmet_igraca[id][0] == 25 && klasa_igraca[id] != Assassin)
  914. {
  915. maximalna_energija_igraca[id] += 50;
  916. brzina_igraca[id] -= 0.3;
  917. }
  918. if(informacije_predmet_igraca[id][0] == 30)
  919. {
  920. brzina_igraca[id] += 1.2;
  921. }
  922. set_user_armor(id, oklop_klase[klasa_igraca[id]]);
  923.  
  924. if(informacije_predmet_igraca[id][0] == 17)
  925. set_user_armor(id, 500);
  926.  
  927. set_user_health(id, maximalna_energija_igraca[id]);
  928.  
  929. if(klasa_igraca[id] == Partizan)
  930. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 70);
  931. else
  932. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255);
  933. }
  934.  
  935. public PocetakRunde()
  936. {
  937. freezetime = false;
  938. for(new id=0;id<=32;id++)
  939. {
  940. if(!is_user_alive(id))
  941. continue;
  942.  
  943. set_task(0.1, "PostaviBrzinu", id+ZADATAK_POSTAVI_brzinu);
  944.  
  945. switch(get_user_team(id))
  946. {
  947. case 1: client_cmd(id, "spk QTM_CodMod/start2");
  948. case 2: client_cmd(id, "spk QTM_CodMod/start");
  949. }
  950. }
  951. }
  952.  
  953. public novaRunda()
  954. {
  955. freezetime = true;
  956. new iEnt = find_ent_by_class(-1, "Mine");
  957. while(iEnt > 0)
  958. {
  959. remove_entity(iEnt);
  960. iEnt = find_ent_by_class(iEnt, "Mine");
  961. }
  962. }
  963.  
  964. public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
  965. {
  966. if(!is_user_alive(this) || !is_user_connected(this) || informacije_predmet_igraca[this][0] == 24 || !is_user_connected(idattacker) || get_user_team(this) == get_user_team(idattacker) || !klasa_igraca[idattacker])
  967. return HAM_IGNORED;
  968.  
  969. new health = get_user_health(this);
  970. new weapon = get_user_weapon(idattacker);
  971.  
  972. if(health < 2)
  973. return HAM_IGNORED;
  974.  
  975. if((informacije_predmet_igraca[this][0] == 27 && informacije_predmet_igraca[this][1]>0) || klasa_igraca[id] == Steven_Seagal)
  976. {
  977. informacije_predmet_igraca[this][1]--;
  978. return HAM_SUPERCEDE;
  979. }
  980.  
  981. if(snaga_igraca[this]>0)
  982. damage -= smanjene_povrede_igraca[this]*damage;
  983.  
  984. if(informacije_predmet_igraca[this][0] == 2 || informacije_predmet_igraca[this][0] == 3)
  985. damage-=(float(informacije_predmet_igraca[this][1])<damage)? float(informacije_predmet_igraca[this][1]): damage;
  986.  
  987. if(informacije_predmet_igraca[idattacker][0] == 5 && !UTIL_In_FOV(this, idattacker) && UTIL_In_FOV(idattacker, this))
  988. damage*=2.0;
  989.  
  990. if(informacije_predmet_igraca[idattacker][0] == 10)
  991. damage+=informacije_predmet_igraca[idattacker][1];
  992.  
  993. if(informacije_predmet_igraca[this][0] == 12)
  994. damage-=(5.0<damage)? 5.0: damage;
  995.  
  996. if(weapon == CSW_AWP && informacije_predmet_igraca[idattacker][0] == 13)
  997. damage=float(health);
  998.  
  999. if(informacije_predmet_igraca[idattacker][0] == 21)
  1000. damage+=10;
  1001.  
  1002. if(informacije_predmet_igraca[idattacker][0] == 22)
  1003. damage+=20;
  1004.  
  1005. if(idinflictor != idattacker && entity_get_int(idinflictor, EV_INT_movetype) != 5)
  1006. {
  1007. if((informacije_predmet_igraca[idattacker][0] == 9 && random_num(1, informacije_predmet_igraca[idattacker][1]) == 1) || informacije_predmet_igraca[idattacker][0] == 10)
  1008. damage = float(health);
  1009. }
  1010.  
  1011. if(weapon == CSW_KNIFE)
  1012. {
  1013. if(klasa_igraca[idattacker] == Predator)
  1014. damage = float(health);
  1015. if(klasa_igraca[idattacker] == Assassin)
  1016. damage = float(health);
  1017. if(klasa_igraca[this] == SWAT)
  1018. return HAM_SUPERCEDE;
  1019. if(klasa_igraca[this] == Doktor)
  1020. return HAM_SUPERCEDE;
  1021. if(klasa_igraca[this] == Univerzalni_Vojnik)
  1022. return HAM_SUPERCEDE;
  1023. if(klasa_igraca[this] == Joker)
  1024. return HAM_SUPERCEDE;
  1025. if(klasa_igraca[this] == Jason_Bourne)
  1026. return HAM_SUPERCEDE;
  1027. if(klasa_igraca[this] == Hunter)
  1028. return HAM_SUPERCEDE;
  1029. if(klasa_igraca[this] == Steven_Seagal)
  1030. return HAM_SUPERCEDE;
  1031. if(informacije_predmet_igraca[this][0] == 4)
  1032. damage=damage*1.4+inteligencija_igraca[idattacker];
  1033. if(informacije_predmet_igraca[idattacker][0] == 8 || (klasa_igraca[idattacker] == Snajperista && random_num(1,2) == 1) || klasa_igraca[idattacker] == Marinac || klasa_igraca[idattacker] == Assassin && !(get_user_button(idattacker) & IN_ATTACK))
  1034. damage = float(health);
  1035.  
  1036.  
  1037. }
  1038. if(klasa_igraca[idattacker] == General)
  1039. {
  1040. if(weapon == CSW_AWP && !random(5))
  1041. damage = float(health);
  1042. }
  1043. if(klasa_igraca[idattacker] == Hunter)
  1044. {
  1045. if(weapon == CSW_AWP && !random(3))
  1046. damage = float(health);
  1047. }
  1048. if(klasa_igraca[idattacker] == Jason_Bourne)
  1049. {
  1050. if(weapon == CSW_DEAGLE && !random(7))
  1051. damage = float(health);
  1052. }
  1053. if(informacije_predmet_igraca[idattacker][0] == 30)
  1054. {
  1055. if(weapon == CSW_SCOUT && !random(2))
  1056. damage = float(health);
  1057. }
  1058. if(informacije_predmet_igraca[this][0] == 26 && random_num(1, informacije_predmet_igraca[this][1]) == 1)
  1059. {
  1060. SetHamParamEntity(3, this);
  1061. SetHamParamEntity(1, idattacker);
  1062. }
  1063.  
  1064.  
  1065. SetHamParamFloat(4, damage);
  1066. return HAM_IGNORED;
  1067. }
  1068.  
  1069. public Damage(id)
  1070. {
  1071. new attacker = get_user_attacker(id);
  1072. new damage = read_data(2);
  1073. if(!is_user_alive(attacker) || !is_user_connected(attacker) || id == attacker || !klasa_igraca[attacker])
  1074. return PLUGIN_CONTINUE;
  1075.  
  1076. if(informacije_predmet_igraca[attacker][0] == 12 && random_num(1, informacije_predmet_igraca[id][1]) == 1)
  1077. Display_Fade(id,1<<14,1<<14 ,1<<16,255,155,50,230);
  1078.  
  1079. if(get_user_team(id) != get_user_team(attacker))
  1080. {
  1081. while(damage>20)
  1082. {
  1083. damage-=20;
  1084. iskustvo_igraca[attacker]++;
  1085. }
  1086. }
  1087. ProveriNivo(attacker);
  1088. return PLUGIN_CONTINUE;
  1089. }
  1090.  
  1091. public Death()
  1092. {
  1093. new id = read_data(2);
  1094. new attacker = read_data(1);
  1095.  
  1096. if(!is_user_alive(attacker) || !is_user_connected(attacker))
  1097. return PLUGIN_CONTINUE;
  1098.  
  1099. new weapon = get_user_weapon(attacker);
  1100. new energija = get_user_health(attacker);
  1101.  
  1102. if(get_user_team(id) != get_user_team(attacker) && klasa_igraca[attacker])
  1103. {
  1104. new iskustvo_za_ubistvo = get_pcvar_num(cvar_xp_za_ubistvo);
  1105. new novo_iskustvo = get_pcvar_num(cvar_xp_za_ubistvo);
  1106.  
  1107. if(klasa_igraca[id] == Rambo && klasa_igraca[attacker] != Rambo)
  1108. novo_iskustvo += iskustvo_za_ubistvo*2;
  1109.  
  1110. if(klasa_igraca[id] == Destroyer && klasa_igraca[attacker] != Destroyer)
  1111. novo_iskustvo += iskustvo_za_ubistvo*2;
  1112.  
  1113. if(informacije_predmet_igraca[attacker][0] == 34)
  1114. {
  1115. novo_iskustvo += iskustvo_za_ubistvo;
  1116. }
  1117. if(informacije_predmet_igraca[id][0] == 34 && informacije_predmet_igraca[attacker][0] != 34)
  1118. novo_iskustvo += iskustvo_za_ubistvo*2;
  1119.  
  1120. if(level_igraca[id] > level_igraca[attacker])
  1121. novo_iskustvo += (level_igraca[id]-level_igraca[attacker])*(iskustvo_za_ubistvo/10);
  1122.  
  1123. if(klasa_igraca[attacker] == Rambo || informacije_predmet_igraca[attacker][0] == 15 && maxClip[weapon] != -1)
  1124. {
  1125.  
  1126. new nova_energija = (energija+20<maximalna_energija_igraca[attacker])? energija+20: maximalna_energija_igraca[attacker];
  1127. set_user_clip(attacker, maxClip[weapon]);
  1128. set_user_health(attacker, nova_energija);
  1129. }
  1130. #if defined BOTY
  1131. if(is_user_bot2(attacker) && random(9) == 0)
  1132. IzbaciPredmet(id);
  1133. #endif
  1134. if(!informacije_predmet_igraca[attacker][0])
  1135. DajPredmet(attacker, random_num(1, sizeof naziv_predmeta-1));
  1136.  
  1137. if(informacije_predmet_igraca[attacker][0] == 14)
  1138. {
  1139. new nova_energija = (energija+50<maximalna_energija_igraca[attacker])? energija+50: maximalna_energija_igraca[attacker];
  1140. set_user_health(attacker, nova_energija);
  1141. }
  1142. iskustvo_igraca[attacker] += novo_iskustvo;
  1143. }
  1144.  
  1145. ProveriNivo(attacker);
  1146.  
  1147. if(informacije_predmet_igraca[id][0] == 7 && random_num(1, informacije_predmet_igraca[id][1]) == 1)
  1148. set_task(0.1, "Provera", id+ZADATAK_PROVERA);
  1149.  
  1150. return PLUGIN_CONTINUE;
  1151. }
  1152.  
  1153. public client_putinserver(id)
  1154. {
  1155. DeleteSkills(id);
  1156.  
  1157. ObrisiZadatke(id);
  1158. Obrisipredmet(id);
  1159.  
  1160. set_task(3.0, "PokaziInformacije", id+ZADATAK_POKAZI_INFORMACIJE);
  1161. set_task(10.0, "PokaziReklame", id+ZADATAK_POKAZI_REKLAME);
  1162. }
  1163.  
  1164. public client_disconnect(id)
  1165. {
  1166. SacuvajPodatke(id);
  1167. DeleteSkills(id);
  1168. ObrisiZadatke(id);
  1169. Obrisipredmet(id);
  1170. }
  1171. public DeleteSkills(id)
  1172. {
  1173. klasa_igraca[id] = 0;
  1174. level_igraca[id] = 0;
  1175. iskustvo_igraca[id] = 0;
  1176. poeni_igraca[id] = 0;
  1177. energija_igraca[id] = 0;
  1178. inteligencija_igraca[id] = 0;
  1179. snaga_igraca[id] = 0;
  1180. kondicija_igraca[id] = 0;
  1181. maximalna_energija_igraca[id] = 0;
  1182. brzina_igraca[id] = 0.0;
  1183. }
  1184.  
  1185. public ObrisiZadatke(id)
  1186. {
  1187. remove_task(id+ZADATAK_POKAZI_INFORMACIJE);
  1188. remove_task(id+ZADATAK_POKAZI_REKLAME);
  1189. remove_task(id+ZADATAK_POSTAVI_brzinu);
  1190. remove_task(id+ZADATAK_PROVERA);
  1191. }
  1192.  
  1193. public OpisKlase(id)
  1194. {
  1195. new menu = menu_create("Izaberi Klasu:", "OpisKlase_Handle");
  1196. for(new i=1; i <sizeof naziv_klase; i++)
  1197. menu_additem(menu, naziv_klase[i]);
  1198. menu_setprop(menu, MPROP_EXITNAME, "Izlaz");
  1199. menu_setprop(menu, MPROP_BACKNAME, "Prethodna strana");
  1200. menu_setprop(menu, MPROP_NEXTNAME, "Sledeca strana");
  1201. menu_display(id, menu);
  1202.  
  1203. client_cmd(id, "spk QTM_CodMod/select");
  1204. }
  1205.  
  1206. public OpisKlase_Handle(id, menu, item)
  1207. {
  1208. client_cmd(id, "spk QTM_CodMod/select");
  1209.  
  1210. if(item++ == MENU_EXIT)
  1211. {
  1212. menu_destroy(menu);
  1213. return PLUGIN_CONTINUE;
  1214. }
  1215. new opis[512];
  1216. format(opis, charsmax(opis), "\yKlasa: \w%s^n%s", naziv_klase[item], opis_klase[item]);
  1217. show_menu(id, 1023, opis);
  1218.  
  1219. return PLUGIN_CONTINUE;
  1220. }
  1221. public IzaberiKlasu(id)
  1222. {
  1223. new menu = menu_create("\rIzaberi Klase:", "IzaberiFrakciju_Handle");
  1224. for(new i = 1;i<sizeof(frakcije);i++)
  1225. {
  1226. menu_additem(menu, frakcije[i]);
  1227. }
  1228. menu_display(id, menu);
  1229. menu_setprop(menu, MPROP_EXITNAME, "Izadji");
  1230. }
  1231.  
  1232. public IzaberiFrakciju_Handle(id, menu2, item)
  1233. {
  1234. if(item == MENU_EXIT)
  1235. {
  1236. menu_destroy(menu2);
  1237. return PLUGIN_CONTINUE;
  1238. }
  1239.  
  1240. item++;
  1241. frakcija_igraca[id] = item;
  1242. new menu = menu_create("\rIzaberi Klase:", "IzaberiKlasu_Handle");
  1243. new klasa[50];
  1244. for(new i=1; i<sizeof naziv_klase; i++)
  1245. {
  1246. if(pripada[i] == item)
  1247. {
  1248. UcitajPodatke(id, i);
  1249. format(klasa, 49, "\y%s \rLevel: %i", naziv_klase[i], level_igraca[id]);
  1250. menu_additem(menu, klasa);
  1251. }
  1252. }
  1253.  
  1254. UcitajPodatke(id, klasa_igraca[id]);
  1255.  
  1256. menu_setprop(menu, MPROP_EXITNAME, "Izadji");
  1257. menu_setprop(menu, MPROP_BACKNAME, "Predhodna Strana");
  1258. menu_setprop(menu, MPROP_NEXTNAME, "Sledeca Strana");
  1259. menu_display(id, menu);
  1260.  
  1261. client_cmd(id, "spk QTM_CodMod/select");
  1262.  
  1263. return PLUGIN_CONTINUE;
  1264. }
  1265. public IzaberiKlasu_Handle(id, menu, item)
  1266. {
  1267.  
  1268. client_cmd(id, "spk QTM_CodMod/select");
  1269.  
  1270. if(item == MENU_EXIT)
  1271. {
  1272. menu_destroy(menu);
  1273. return PLUGIN_CONTINUE;
  1274. }
  1275.  
  1276. item++;
  1277.  
  1278. new ile = 0;
  1279. for(new i=1; i<sizeof naziv_klase; i++)
  1280. {
  1281. if(pripada[i] == frakcija_igraca[id])
  1282. {
  1283. ile++;
  1284. }
  1285. if(ile == item)
  1286. {
  1287. item = i;
  1288. break;
  1289. }
  1290. }
  1291.  
  1292. if(item == klasa_igraca[id])
  1293. return PLUGIN_CONTINUE;
  1294.  
  1295. if(item == Assassin && !(get_user_flags(id) & ADMIN_LEVEL_A))
  1296. {
  1297. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1298. IzaberiKlasu(id);
  1299. return PLUGIN_CONTINUE;
  1300. }
  1301. if(item == Rambo && !(get_user_flags(id) & ADMIN_LEVEL_H))
  1302. {
  1303. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1304. IzaberiKlasu(id);
  1305. return PLUGIN_CONTINUE;
  1306. }
  1307. if(item == Gunner && !(get_user_flags(id) & ADMIN_LEVEL_H))
  1308. {
  1309. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1310. IzaberiKlasu(id);
  1311. return PLUGIN_CONTINUE;
  1312. }
  1313. if(item == Univerzalni_Vojnik && !(get_user_flags(id) & ADMIN_LEVEL_B))
  1314. {
  1315. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1316. IzaberiKlasu(id);
  1317. return PLUGIN_CONTINUE;
  1318. }
  1319. if(item == Joker && !(get_user_flags(id) & ADMIN_LEVEL_C))
  1320. {
  1321. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1322. IzaberiKlasu(id);
  1323. return PLUGIN_CONTINUE;
  1324. }
  1325. if(item == Jason_Bourne && !(get_user_flags(id) & ADMIN_LEVEL_D))
  1326. {
  1327. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1328. IzaberiKlasu(id);
  1329. return PLUGIN_CONTINUE;
  1330. }
  1331. if(item == Hunter && !(get_user_flags(id) & ADMIN_LEVEL_E))
  1332. {
  1333. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
  1334. IzaberiKlasu(id);
  1335. return PLUGIN_CONTINUE;
  1336. }
  1337.  
  1338. if(klasa_igraca[id])
  1339. {
  1340. nova_klasa_igraca[id] = item;
  1341. ColorChat(id, NORMAL, "^4[COD:MW] ^1Klasa ce biti izmenjena u sledecoj rundi.");
  1342. }
  1343. else
  1344. {
  1345. klasa_igraca[id] = item;
  1346. UcitajPodatke(id, klasa_igraca[id]);
  1347. Pocetak(id);
  1348. }
  1349. return PLUGIN_CONTINUE;
  1350. }
  1351.  
  1352. public DodelaPoena(id)
  1353. {
  1354. new inteligencija[65], inteligencija10[65];
  1355. new energija[60], energija10[60];
  1356. new snaga[60], snaga10[60];
  1357. new kondicija[60], kondicija10[60];
  1358. new naslov[25];
  1359. format(inteligencija, 64, "Inteligencija: \r%i \y(Povecava napad)", inteligencija_igraca[id]);
  1360. format(energija, 59, "Energija: \r%i \y(Povecaca energiju)", energija_igraca[id]);
  1361. format(snaga, 59, "Snaga: \r%i \y(Smanjuje povrede)", snaga_igraca[id]);
  1362. format(kondicija, 59, "Kondicija: \r%i \y(Povecava tempo hodanja)", kondicija_igraca[id]);
  1363. format(inteligencija10, 64, "Dodaj 10 poena na inteligenciju");
  1364. format(energija10, 59, "Dodaj 10 poena na energiju");
  1365. format(snaga10, 59, "Dodaj 10 poena na snagu");
  1366. format(kondicija10, 59, "Dodaj 10 poena na kondiciju");
  1367. format(naslov, 24, "Dodeli poena(%i):", poeni_igraca[id]);
  1368. new menu = menu_create(naslov, "DodelaPoena_Handler");
  1369. menu_additem(menu, inteligencija);
  1370. menu_additem(menu, energija);
  1371. menu_additem(menu, snaga);
  1372. menu_additem(menu, kondicija);
  1373. menu_additem(menu, inteligencija10);
  1374. menu_additem(menu, energija10);
  1375. menu_additem(menu, snaga10);
  1376. menu_additem(menu, kondicija10);
  1377. menu_display(id, menu);
  1378. #if defined BOTY
  1379. if(is_user_bot2(id))
  1380. DodelaPoena_Handler(id, menu, random(4));
  1381. #endif
  1382. }
  1383.  
  1384. public DodelaPoena_Handler(id, menu, item)
  1385. {
  1386. client_cmd(id, "spk QTM_CodMod/select");
  1387.  
  1388. if(item == MENU_EXIT)
  1389. {
  1390. menu_destroy(menu);
  1391. return PLUGIN_CONTINUE;
  1392. }
  1393.  
  1394.  
  1395. if(poeni_igraca[id] < 1)
  1396. return PLUGIN_CONTINUE;
  1397.  
  1398. switch(item)
  1399. {
  1400. case 0:
  1401. {
  1402. if(inteligencija_igraca[id]<4001)
  1403. {
  1404. inteligencija_igraca[id]++;
  1405. poeni_igraca[id]--;
  1406. }
  1407. else
  1408. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo inteligencije");
  1409.  
  1410. }
  1411. case 1:
  1412. {
  1413. if(energija_igraca[id]<4001)
  1414. {
  1415. energija_igraca[id]++;
  1416. poeni_igraca[id]--;
  1417. }
  1418. else
  1419. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo energije");
  1420. }
  1421. case 2:
  1422. {
  1423. if(snaga_igraca[id]<4001)
  1424. {
  1425. snaga_igraca[id]++;
  1426. poeni_igraca[id]--;
  1427. }
  1428. else
  1429. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo snage");
  1430.  
  1431. }
  1432. case 3:
  1433. {
  1434. if(kondicija_igraca[id]<4001)
  1435. {
  1436. kondicija_igraca[id]++;
  1437. poeni_igraca[id]--;
  1438. }
  1439. else
  1440. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo kondicije");
  1441. }
  1442. case 4:
  1443. {
  1444. if(poeni_igraca[id] < 10)
  1445. {
  1446. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dovoljno poena");
  1447. }
  1448. else if(inteligencija_igraca[id]<4001)
  1449. {
  1450. inteligencija_igraca[id]+=10;
  1451. poeni_igraca[id]-=10
  1452. }
  1453. else
  1454. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo inteligencije");
  1455. }
  1456. case 5:
  1457. {
  1458. if(poeni_igraca[id] < 10)
  1459. {
  1460. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dovoljno poena");
  1461. }
  1462. else if(energija_igraca[id]<4001)
  1463. {
  1464. energija_igraca[id]+=10;
  1465. poeni_igraca[id]-=10;
  1466. }
  1467. else
  1468. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo energije");
  1469. }
  1470. case 6:
  1471. {
  1472. if(poeni_igraca[id] < 10)
  1473. {
  1474. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dovoljno poena");
  1475. }
  1476. else if(snaga_igraca[id]<4001)
  1477. {
  1478. snaga_igraca[id]+=10;
  1479. poeni_igraca[id]-=10;
  1480. }
  1481. else
  1482. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo snage");
  1483. }
  1484. case 7:
  1485. {
  1486. if(poeni_igraca[id] < 10)
  1487. {
  1488. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dovoljno poena");
  1489. }
  1490. else if(kondicija_igraca[id]<4001)
  1491. {
  1492. kondicija_igraca[id]+=10;
  1493. poeni_igraca[id]-=10;
  1494. }
  1495. else
  1496. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo kondicije");
  1497. }
  1498.  
  1499. }
  1500.  
  1501. if(poeni_igraca[id]>0)
  1502. DodelaPoena(id);
  1503.  
  1504. return PLUGIN_CONTINUE;
  1505. }
  1506.  
  1507. public KomandaResetujPoene(id)
  1508. {
  1509. ColorChat(id, NORMAL, "^4[COD:MW] ^1Poeni su resetovani");
  1510. client_cmd(id, "spk QTM_CodMod/select");
  1511.  
  1512. ResetujPoene(id)
  1513. }
  1514.  
  1515. public ResetujPoene(id)
  1516. {
  1517. poeni_igraca[id] = level_igraca[id]*2-2;
  1518. inteligencija_igraca[id] = 0;
  1519. energija_igraca[id] = 0;
  1520. kondicija_igraca[id] = 0;
  1521. snaga_igraca[id] = 0;
  1522.  
  1523. if(poeni_igraca[id])
  1524. DodelaPoena(id);
  1525. }
  1526.  
  1527. public KreirajMedKit(id)
  1528. {
  1529. if (!broj_medkit_igraca[id])
  1530. {
  1531. client_print(id, print_center, "Imate samo 2 paketa za prvu pomoc u jednoj rundi!");
  1532. return PLUGIN_CONTINUE;
  1533. }
  1534.  
  1535. if(inteligencija_igraca[id] < 1)
  1536. client_print(id, print_center, "Da koristite paket za prvu pomoc, morate povecati inteligenciju");
  1537.  
  1538. broj_medkit_igraca[id]--;
  1539.  
  1540. new Float:origin[3];
  1541. entity_get_vector(id, EV_VEC_origin, origin);
  1542.  
  1543. new ent = create_entity("info_target");
  1544. entity_set_string(ent, EV_SZ_classname, "MedKit");
  1545. entity_set_edict(ent, EV_ENT_owner, id);
  1546. entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  1547. entity_set_vector(ent, EV_VEC_origin, origin);
  1548. entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
  1549.  
  1550.  
  1551. entity_set_model(ent, "models/w_medkit.mdl");
  1552. set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) ;
  1553. drop_to_floor(ent);
  1554.  
  1555. entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
  1556.  
  1557. return PLUGIN_CONTINUE;
  1558. }
  1559.  
  1560. public MedKitThink(ent)
  1561. {
  1562. new id = entity_get_edict(ent, EV_ENT_owner);
  1563. new totem_dist = 300;
  1564. new totem_heal = 5+floatround(inteligencija_igraca[id]*0.5);
  1565. if (entity_get_edict(ent, EV_ENT_euser2) == 1)
  1566. {
  1567. new Float:forigin[3], origin[3];
  1568. entity_get_vector(ent, EV_VEC_origin, forigin);
  1569. FVecIVec(forigin,origin);
  1570.  
  1571. new entlist[33];
  1572. new numfound = find_sphere_class(0,"player",totem_dist+0.0,entlist, 32,forigin);
  1573.  
  1574. for (new i=0; i < numfound; i++)
  1575. {
  1576. new pid = entlist[i];
  1577.  
  1578. if (get_user_team(pid) != get_user_team(id))
  1579. continue;
  1580.  
  1581. new energija = get_user_health(pid);
  1582. new nova_energija = (energija+totem_heal<maximalna_energija_igraca[pid])?energija+totem_heal:maximalna_energija_igraca[pid];
  1583. if (is_user_alive(pid)) set_user_health(pid, nova_energija);
  1584. }
  1585.  
  1586. entity_set_edict(ent, EV_ENT_euser2, 0);
  1587. entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5);
  1588.  
  1589. return PLUGIN_CONTINUE;
  1590. }
  1591.  
  1592. if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
  1593. {
  1594. remove_entity(ent);
  1595. return PLUGIN_CONTINUE;
  1596. }
  1597.  
  1598. if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
  1599. set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ) ;
  1600.  
  1601. new Float:forigin[3], origin[3];
  1602. entity_get_vector(ent, EV_VEC_origin, forigin);
  1603. FVecIVec(forigin,origin);
  1604.  
  1605. //Find people near and give them health
  1606. message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
  1607. write_byte( TE_BEAMCYLINDER );
  1608. write_coord( origin[0] );
  1609. write_coord( origin[1] );
  1610. write_coord( origin[2] );
  1611. write_coord( origin[0] );
  1612. write_coord( origin[1] + totem_dist );
  1613. write_coord( origin[2] + totem_dist );
  1614. write_short( sprite_white );
  1615. write_byte( 0 ); // startframe
  1616. write_byte( 0 ); // framerate
  1617. write_byte( 10 ); // life
  1618. write_byte( 10 ); // width
  1619. write_byte( 255 ); // noise
  1620. write_byte( 255 ); // r, g, b
  1621. write_byte( 100 );// r, g, b
  1622. write_byte( 100 ); // r, g, b
  1623. write_byte( 128 ); // brightness
  1624. write_byte( 5 ); // speed
  1625. message_end();
  1626.  
  1627. entity_set_edict(ent, EV_ENT_euser2 ,1);
  1628. entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
  1629.  
  1630.  
  1631. return PLUGIN_CONTINUE;
  1632. }
  1633.  
  1634. public KreirajRakete(id)
  1635. {
  1636. if (!broj_raketa_igraca[id])
  1637. {
  1638. client_print(id, print_center, "Vec ste iskoristili sve rakete!");
  1639. return PLUGIN_CONTINUE;
  1640. }
  1641.  
  1642. if(prethodna_raketa_igraca[id] + 2.0 > get_gametime())
  1643. {
  1644. client_print(id, print_center, "Mozate da koristite raketu za 2 sekunde!");
  1645. return PLUGIN_CONTINUE;
  1646. }
  1647.  
  1648. if (is_user_alive(id))
  1649. {
  1650. if(inteligencija_igraca[id] < 1)
  1651. client_print(id, print_center, "Da koristite rakete, morate povecati inteligenciju!");
  1652.  
  1653. prethodna_raketa_igraca[id] = get_gametime();
  1654. broj_raketa_igraca[id]--;
  1655.  
  1656. new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
  1657.  
  1658. entity_get_vector(id, EV_VEC_v_angle, vAngle);
  1659. entity_get_vector(id, EV_VEC_origin , Origin);
  1660.  
  1661. new Ent = create_entity("info_target");
  1662.  
  1663. entity_set_string(Ent, EV_SZ_classname, "Rocket");
  1664. entity_set_model(Ent, "models/rpgrocket.mdl");
  1665.  
  1666. vAngle[0] *= -1.0;
  1667.  
  1668. entity_set_origin(Ent, Origin);
  1669. entity_set_vector(Ent, EV_VEC_angles, vAngle);
  1670.  
  1671. entity_set_int(Ent, EV_INT_effects, 2);
  1672. entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
  1673. entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
  1674. entity_set_edict(Ent, EV_ENT_owner, id);
  1675.  
  1676. VelocityByAim(id, 1000 , Velocity);
  1677. entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
  1678.  
  1679. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  1680. write_byte(22)
  1681. write_short(Ent)
  1682. write_short(sprite_beam)
  1683. write_byte(45)
  1684. write_byte(4)
  1685. write_byte(255)
  1686. write_byte(105)
  1687. write_byte(180)
  1688. write_byte(25)
  1689. message_end()
  1690. }
  1691. return PLUGIN_CONTINUE;
  1692. }
  1693.  
  1694. public KreirajDinamit(id)
  1695. {
  1696. if(!broj_dinamita_igraca[id])
  1697. {
  1698. client_print(id, print_center, "Vec ste iskoristili sav dinamit!");
  1699. return PLUGIN_CONTINUE;
  1700. }
  1701.  
  1702. if(inteligencija_igraca[id] < 1)
  1703. client_print(id, print_center, "Da koristite dinamit, morate povecati inteligenciju!");
  1704.  
  1705. broj_dinamita_igraca[id]--;
  1706.  
  1707. new Float:fOrigin[3];
  1708. entity_get_vector(id, EV_VEC_origin, fOrigin);
  1709.  
  1710. new iOrigin[3];
  1711. for(new i=0;i<3;i++)
  1712. iOrigin[i] = floatround(fOrigin[i]);
  1713.  
  1714. message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  1715. write_byte(TE_EXPLOSION);
  1716. write_coord(iOrigin[0]);
  1717. write_coord(iOrigin[1]);
  1718. write_coord(iOrigin[2]);
  1719. write_short(sprite_blast);
  1720. write_byte(32);
  1721. write_byte(20);
  1722. write_byte(0);
  1723. message_end();
  1724.  
  1725. message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
  1726. write_byte( TE_BEAMCYLINDER );
  1727. write_coord( iOrigin[0] );
  1728. write_coord( iOrigin[1] );
  1729. write_coord( iOrigin[2] );
  1730. write_coord( iOrigin[0] );
  1731. write_coord( iOrigin[1] + 300 );
  1732. write_coord( iOrigin[2] + 300 );
  1733. write_short( sprite_white );
  1734. write_byte( 0 ); // startframe
  1735. write_byte( 0 ); // framerate
  1736. write_byte( 10 ); // life
  1737. write_byte( 10 ); // width
  1738. write_byte( 255 ); // noise
  1739. write_byte( 255 ); // r, g, b
  1740. write_byte( 100 );// r, g, b
  1741. write_byte( 100 ); // r, g, b
  1742. write_byte( 128 ); // brightness
  1743. write_byte( 8 ); // speed
  1744. message_end();
  1745.  
  1746. new entlist[33];
  1747. new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
  1748.  
  1749. for (new i=0; i < numfound; i++)
  1750. {
  1751. new pid = entlist[i];
  1752.  
  1753. if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24)
  1754. continue;
  1755. ExecuteHam(Ham_TakeDamage, pid, 0, id, 90.0+float(inteligencija_igraca[id]) , 1);
  1756. }
  1757. return PLUGIN_CONTINUE;
  1758. }
  1759.  
  1760. public PostaviMine(id)
  1761. {
  1762. if (!broj_min_igraca[id])
  1763. {
  1764. client_print(id, print_center, "Vec ste iskoristili sve mine!");
  1765. return PLUGIN_CONTINUE;
  1766. }
  1767.  
  1768. if(inteligencija_igraca[id] < 1)
  1769. client_print(id, print_center, "Da koristite mine, morate povecati inteligenciju!");
  1770.  
  1771. broj_min_igraca[id]--;
  1772.  
  1773. new Float:origin[3];
  1774. entity_get_vector(id, EV_VEC_origin, origin);
  1775.  
  1776. new ent = create_entity("info_target");
  1777. entity_set_string(ent ,EV_SZ_classname, "Mine");
  1778. entity_set_edict(ent ,EV_ENT_owner, id);
  1779. entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);
  1780. entity_set_origin(ent, origin);
  1781. entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  1782.  
  1783. entity_set_model(ent, "models/mine.mdl");
  1784. entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});
  1785.  
  1786. drop_to_floor(ent);
  1787.  
  1788. entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
  1789.  
  1790. set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,50) ;
  1791.  
  1792.  
  1793. return PLUGIN_CONTINUE;
  1794. }
  1795.  
  1796. public DodirMine(ent, id)
  1797. {
  1798. new attacker = entity_get_edict(ent, EV_ENT_owner);
  1799. if (get_user_team(attacker) != get_user_team(id))
  1800. {
  1801. new Float:fOrigin[3];
  1802. entity_get_vector( ent, EV_VEC_origin, fOrigin);
  1803.  
  1804. new iOrigin[3];
  1805. for(new i=0;i<3;i++)
  1806. iOrigin[i] = floatround(fOrigin[i]);
  1807.  
  1808. message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  1809. write_byte(TE_EXPLOSION);
  1810. write_coord(iOrigin[0]);
  1811. write_coord(iOrigin[1]);
  1812. write_coord(iOrigin[2]);
  1813. write_short(sprite_blast);
  1814. write_byte(32); // scale
  1815. write_byte(20); // framerate
  1816. write_byte(0);// flags
  1817. message_end();
  1818. new entlist[33];
  1819. new numfound = find_sphere_class(ent,"player", 90.0 ,entlist, 32);
  1820.  
  1821. for (new i=0; i < numfound; i++)
  1822. {
  1823. new pid = entlist[i];
  1824.  
  1825. if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24 || klasa_igraca[id] == Mitraljezac)
  1826. continue;
  1827.  
  1828. ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 90.0+float(inteligencija_igraca[attacker]) , 1);
  1829. }
  1830. remove_entity(ent);
  1831. }
  1832. }
  1833.  
  1834. public DodirRakete(ent)
  1835. {
  1836. if ( !is_valid_ent(ent))
  1837. return;
  1838.  
  1839. new attacker = entity_get_edict(ent, EV_ENT_owner);
  1840.  
  1841. new Float:fOrigin[3];
  1842. entity_get_vector(ent, EV_VEC_origin, fOrigin);
  1843.  
  1844. new iOrigin[3];
  1845. for(new i=0;i<3;i++)
  1846. iOrigin[i] = floatround(fOrigin[i]);
  1847.  
  1848. message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  1849. write_byte(TE_EXPLOSION);
  1850. write_coord(iOrigin[0]);
  1851. write_coord(iOrigin[1]);
  1852. write_coord(iOrigin[2]);
  1853. write_short(sprite_blast);
  1854. write_byte(32); // scale
  1855. write_byte(20); // framerate
  1856. write_byte(0);// flags
  1857. message_end();
  1858.  
  1859. new entlist[33];
  1860. new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32);
  1861.  
  1862. for (new i=0; i < numfound; i++)
  1863. {
  1864. new pid = entlist[i];
  1865.  
  1866. if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24)
  1867. continue;
  1868. ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0+float(inteligencija_igraca[attacker]) , 1);
  1869. }
  1870. remove_entity(ent);
  1871. }
  1872.  
  1873. public CurWeapon(id)
  1874. {
  1875. if(freezetime || !klasa_igraca[id])
  1876. return PLUGIN_CONTINUE;
  1877.  
  1878. new weapon = get_user_weapon(id);
  1879.  
  1880. if(klasa_igraca[id] == Assassin && weapon == CSW_KNIFE)
  1881. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 10);
  1882. else if(klasa_igraca[id] == Assassin && weapon != CSW_KNIFE)
  1883. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255);
  1884.  
  1885. if(informacije_predmet_igraca[id][0] == 35 && weapon == CSW_KNIFE)
  1886. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 10);
  1887. else if(informacije_predmet_igraca[id][0] == 35 && weapon != CSW_KNIFE)
  1888. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255);
  1889.  
  1890. new weapons[32];
  1891. new weaponsnum;
  1892. get_user_weapons(id, weapons, weaponsnum);
  1893. for(new i=0; i<weaponsnum; i++)
  1894. if(is_user_alive(id))
  1895. if(maxAmmo[weapons[i]] > 0)
  1896. cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
  1897.  
  1898. PostaviBrzinu(id);
  1899. return PLUGIN_CONTINUE;
  1900. }
  1901.  
  1902. public EmitSound(id, iChannel, szSound[], Float:fVol, Float:fAttn, iFlags, iPitch )
  1903. {
  1904. if(!is_user_alive(id))
  1905. return FMRES_IGNORED;
  1906.  
  1907. if(equal(szSound, "common/wpn_denyselect.wav"))
  1908. {
  1909. KoristiPredmet(id);
  1910. return FMRES_SUPERCEDE;
  1911. }
  1912.  
  1913. return FMRES_IGNORED;
  1914. }
  1915.  
  1916. public KoristiPredmet(id)
  1917. {
  1918. if((informacije_predmet_igraca[id][0] == 19 && informacije_predmet_igraca[id][1]>0) || (klasa_igraca[id] == Univerzalni_Vojnik) || (klasa_igraca[id] == Steven_Seagal)
  1919. {
  1920. set_user_health(id, maximalna_energija_igraca[id]);
  1921. informacije_predmet_igraca[id][1]--;
  1922. }
  1923.  
  1924. if(broj_medkit_igraca[id]>0)
  1925. KreirajMedKit(id);
  1926. if(broj_raketa_igraca[id]>0)
  1927. KreirajRakete(id);
  1928. if(broj_min_igraca[id]>0)
  1929. PostaviMine(id);
  1930. if(broj_dinamita_igraca[id]>0)
  1931. KreirajDinamit(id);
  1932.  
  1933. return PLUGIN_HANDLED;
  1934. }
  1935.  
  1936. public SacuvajPodatke(id)
  1937. {
  1938. if(!klasa_igraca[id])
  1939. return PLUGIN_CONTINUE;
  1940.  
  1941. new vaultkey[128],vaultdata[256], ID_igraca[64];
  1942. format(vaultdata, charsmax(vaultdata),"#%i#%i#%i#%i#%i#%i", iskustvo_igraca[id], level_igraca[id], inteligencija_igraca[id], energija_igraca[id], snaga_igraca[id], kondicija_igraca[id]);
  1943.  
  1944. get_user_authid(id, ID_igraca, charsmax(ID_igraca))
  1945.  
  1946. format(vaultkey, charsmax(vaultkey),"%s-%i-cod", ID_igraca, klasa_igraca[id]);
  1947. nvault_set(g_vault,vaultkey,vaultdata);
  1948.  
  1949. return PLUGIN_CONTINUE;
  1950. }
  1951.  
  1952. public UcitajPodatke(id, klasa)
  1953. {
  1954. new vaultkey[128],vaultdata[256], ID_igraca[64];
  1955.  
  1956. get_user_authid(id, ID_igraca, charsmax(ID_igraca))
  1957.  
  1958. format(vaultkey, charsmax(vaultkey),"%s-%i-cod", ID_igraca, klasa);
  1959. nvault_get(g_vault,vaultkey,vaultdata,255);
  1960.  
  1961. replace_all(vaultdata, 255, "#", " ");
  1962.  
  1963. new playerdata[6][32];
  1964.  
  1965. parse(vaultdata, playerdata[0], 31, playerdata[1], 31, playerdata[2], 31, playerdata[3], 31, playerdata[4], 31, playerdata[5], 31);
  1966.  
  1967. iskustvo_igraca[id] = str_to_num(playerdata[0]);
  1968. level_igraca[id] = str_to_num(playerdata[1])>0?str_to_num(playerdata[1]):1;
  1969. inteligencija_igraca[id] = str_to_num(playerdata[2]);
  1970. energija_igraca[id] = str_to_num(playerdata[3]);
  1971. snaga_igraca[id] = str_to_num(playerdata[4]);
  1972. kondicija_igraca[id] = str_to_num(playerdata[5]);
  1973. poeni_igraca[id] = (level_igraca[id]-1)*2-inteligencija_igraca[id]-energija_igraca[id]-snaga_igraca[id]-kondicija_igraca[id];
  1974.  
  1975. return PLUGIN_CONTINUE;
  1976. }
  1977.  
  1978. public IzbaciPredmet(id)
  1979. {
  1980. if(informacije_predmet_igraca[id][0])
  1981. {
  1982. ColorChat(id, NORMAL, "^4[COD:MW] ^1Bacio si ^3%s.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
  1983. Obrisipredmet(id);
  1984. }
  1985. else
  1986. ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate nijedan predmet.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
  1987. }
  1988.  
  1989. public Obrisipredmet(id)
  1990. {
  1991. informacije_predmet_igraca[id][0] = 0;
  1992. informacije_predmet_igraca[id][1] = 0;
  1993. if(is_user_alive(id))
  1994. {
  1995. set_user_footsteps(id, 0);
  1996. set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
  1997. PromeniModel(id, 1);
  1998. }
  1999. }
  2000.  
  2001. public DajPredmet(id, predmet)
  2002. {
  2003. Obrisipredmet(id);
  2004. informacije_predmet_igraca[id][0] = predmet;
  2005. ColorChat(id, NORMAL, "^4[COD:MW] ^1Dobio si ^3%s.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
  2006.  
  2007. switch(predmet)
  2008. {
  2009. case 1:
  2010. {
  2011. set_user_footsteps(id, 1);
  2012. }
  2013. case 2:
  2014. {
  2015. informacije_predmet_igraca[id][1] = random_num(3,6);
  2016. }
  2017. case 3:
  2018. {
  2019. informacije_predmet_igraca[id][1] = random_num(6, 11);
  2020. }
  2021. case 5:
  2022. {
  2023. informacije_predmet_igraca[id][1] = random_num(6, 9);
  2024. }
  2025. case 6:
  2026. {
  2027. if(klasa_igraca[id] == Partizan || klasa_igraca[id] == Assassin )
  2028. {
  2029. DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
  2030. }
  2031. else
  2032. {
  2033. informacije_predmet_igraca[id][1] = random_num(100, 150);
  2034. set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, informacije_predmet_igraca[id][1]);
  2035. }
  2036. }
  2037. case 7:
  2038. {
  2039. informacije_predmet_igraca[id][1] = random_num(2, 4);
  2040. }
  2041. case 8:
  2042. {
  2043. if(klasa_igraca[id] == Marinac || klasa_igraca[id] == Assassin)
  2044. DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
  2045. }
  2046. case 9:
  2047. {
  2048. informacije_predmet_igraca[id][1] = random_num(1, 3);
  2049. PromeniModel(id, 0);
  2050. give_item(id, "weapon_hegrenade");
  2051. }
  2052. case 10:
  2053. {
  2054. informacije_predmet_igraca[id][1] = random_num(4, 8);
  2055. give_item(id, "weapon_hegrenade");
  2056. }
  2057. case 12:
  2058. {
  2059. informacije_predmet_igraca[id][1] = random_num(1, 4);
  2060. }
  2061. case 13:
  2062. {
  2063. give_item(id, "weapon_awp");
  2064. }
  2065. case 15:
  2066. {
  2067. if(klasa_igraca[id] == Rambo)
  2068. DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
  2069. }
  2070. case 19:
  2071. {
  2072. informacije_predmet_igraca[id][1] = 1;
  2073. }
  2074. case 26:
  2075. {
  2076. informacije_predmet_igraca[id][1] = random_num(3, 6);
  2077. }
  2078. case 27:
  2079. {
  2080. informacije_predmet_igraca[id][1] = 3;
  2081. }
  2082. case 31:
  2083. {
  2084. give_item(id, "weapon_scout");
  2085. }
  2086. }
  2087. }
  2088.  
  2089. public OpisPredmeta(id)
  2090. {
  2091. new opis_predmeta[128];
  2092. new slucajne_vrednosti[3];
  2093. num_to_str(informacije_predmet_igraca[id][1], slucajne_vrednosti, 2);
  2094. format(opis_predmeta, 127, opis_predmet[informacije_predmet_igraca[id][0]]);
  2095. replace_all(opis_predmeta, 127, "LW", slucajne_vrednosti);
  2096.  
  2097. ColorChat(id, NORMAL, "^4Predmet: ^1%s.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
  2098. ColorChat(id, NORMAL, "^4Opis: ^1%s.", opis_predmeta);
  2099. }
  2100.  
  2101. public Provera(id)
  2102. {
  2103. id-=ZADATAK_PROVERA;
  2104. ExecuteHamB(Ham_CS_RoundRespawn, id);
  2105. }
  2106.  
  2107. public ProveriNivo(id)
  2108. {
  2109. if(level_igraca[id] < 1200)
  2110. {
  2111. while(iskustvo_igraca[id] >= iskustvo_levelu[level_igraca[id]])
  2112. {
  2113. level_igraca[id]++;
  2114. set_hudmessage(60, 200, 25, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.2, 2);
  2115. ShowSyncHudMsg(id, SyncHudObj3, "Dobrodosao na %i level!", level_igraca[id]);
  2116. client_cmd(id, "spk QTM_CodMod/levelup");
  2117. }
  2118. poeni_igraca[id] = (level_igraca[id]-1)*2-inteligencija_igraca[id]-energija_igraca[id]-snaga_igraca[id]-kondicija_igraca[id];
  2119. }
  2120. SacuvajPodatke(id);
  2121. }
  2122.  
  2123. public PokaziInformacije(id)
  2124. {
  2125. id -= ZADATAK_POKAZI_INFORMACIJE;
  2126.  
  2127. set_task(0.1, "PokaziInformacije", id+ZADATAK_POKAZI_INFORMACIJE);
  2128.  
  2129. if(is_user_connected(id) && !is_user_alive(id))
  2130. {
  2131. new target = entity_get_int(id, EV_INT_iuser2);
  2132.  
  2133. if(!target)
  2134. return PLUGIN_CONTINUE;
  2135.  
  2136. set_hudmessage(255, 255, 255, 0.6, -1.0, 0, 0.0, 0.3, 0.0, 0.0, 2);
  2137. ShowSyncHudMsg(id, SyncHudObj, "Klasa : %s^nIskustvo : %i / %i^nLevel : %i^nPredmet : %s^nEnergija %d", naziv_klase[klasa_igraca[target]], iskustvo_igraca[target], iskustvo_levelu[level_igraca[target]], level_igraca[target], naziv_predmeta[informacije_predmet_igraca[target][0]], get_user_health(target));
  2138.  
  2139. return PLUGIN_CONTINUE;
  2140. }
  2141. set_hudmessage(0, 255, 0, 0.02, 0.23, 0, 0.0, 0.3, 0.0, 0.0, -1);
  2142. ShowSyncHudMsg(id, SyncHudObj, "[Klasa : %s]^n[Iskustvo : %i / %i]^n[Level : %i]^n[Predmet : %s]^n[Energija: %d]", naziv_klase[klasa_igraca[id]], iskustvo_igraca[id], iskustvo_levelu[level_igraca[id]], level_igraca[id], naziv_predmeta[informacije_predmet_igraca[id][0]], get_user_health(id));
  2143.  
  2144. return PLUGIN_CONTINUE;
  2145. }
  2146.  
  2147. public PokaziReklame(id)
  2148. {
  2149. id-=ZADATAK_POKAZI_REKLAME;
  2150. ColorChat(id, NORMAL, "^4[COD:MW] ^1Za vise informacija kucajte ^3/pomoc.");
  2151. }
  2152.  
  2153. public Pomoc(id)
  2154. show_menu(id, 1023, "\y/reset\w - Resetuje poene^n\y/klasa\w - Promeni klasu^n\y/drop\w - Izbaci predmet^n\y/perk\w - Pokazuje opis vaseg predmeta^n\y/opis\w - Pokazuje opis klase^n\y+use\w - Koristi specijalne moci klase", -1, "Pomoc");
  2155.  
  2156. public PostaviBrzinu(id)
  2157. {
  2158. id -= id>32? ZADATAK_POSTAVI_brzinu: 0;
  2159.  
  2160. if(klasa_igraca[id])
  2161. set_user_maxspeed(id, brzina_igraca[id]);
  2162. }
  2163.  
  2164. public PromeniModel(id,reset)
  2165. {
  2166. if (id<1 || id>32 || !is_user_connected(id))
  2167. return PLUGIN_CONTINUE;
  2168.  
  2169. if (reset)
  2170. cs_reset_user_model(id);
  2171. else
  2172. {
  2173. new num = random_num(0,3);
  2174. switch(get_user_team(id))
  2175. {
  2176. case 1: cs_set_user_model(id, Ubrania_CT[num]);
  2177. case 2:cs_set_user_model(id, Ubrania_Terro[num]);
  2178. }
  2179. }
  2180. return PLUGIN_CONTINUE;
  2181. }
  2182.  
  2183. public DodirOruzija(weapon,id)
  2184. {
  2185. if(!is_user_connected(id))
  2186. return HAM_IGNORED;
  2187.  
  2188. new model[23];
  2189. pev(weapon, pev_model, model, 22);
  2190. if (pev(weapon, pev_owner) == id || containi(model, "w_backpack") != -1)
  2191. return HAM_IGNORED;
  2192. return HAM_SUPERCEDE;
  2193. }
  2194.  
  2195. stock bool:UTIL_In_FOV(id,target)
  2196. {
  2197. if (Find_Angle(id,target,9999.9) > 0.0)
  2198. return true;
  2199.  
  2200. return false;
  2201. }
  2202. #if defined BOTY
  2203. public is_user_bot2(id)
  2204. {
  2205. new ping, loss
  2206. get_user_ping(id, ping, loss)
  2207. if(ping > 0 && loss > 0)
  2208. return false
  2209. return true
  2210. }
  2211. #endif
  2212.  
  2213. stock Float:Find_Angle(Core,Target,Float:dist)
  2214. {
  2215. new Float:vec2LOS[2];
  2216. new Float:flDot;
  2217. new Float:CoreOrigin[3];
  2218. new Float:TargetOrigin[3];
  2219. new Float:CoreAngles[3];
  2220.  
  2221. pev(Core,pev_origin,CoreOrigin);
  2222. pev(Target,pev_origin,TargetOrigin);
  2223.  
  2224. if (get_distance_f(CoreOrigin,TargetOrigin) > dist)
  2225. return 0.0;
  2226.  
  2227. pev(Core,pev_angles, CoreAngles);
  2228.  
  2229. for ( new i = 0; i < 2; i++ )
  2230. vec2LOS[i] = TargetOrigin[i] - CoreOrigin[i];
  2231.  
  2232. new Float:veclength = Vec2DLength(vec2LOS);
  2233.  
  2234. //Normalize V2LOS
  2235. if (veclength <= 0.0)
  2236. {
  2237. vec2LOS[0] = 0.0;
  2238. vec2LOS[1] = 0.0;
  2239. }
  2240. else
  2241. {
  2242. new Float:flLen = 1.0 / veclength;
  2243. vec2LOS[0] = vec2LOS[0]*flLen;
  2244. vec2LOS[1] = vec2LOS[1]*flLen;
  2245. }
  2246.  
  2247. //Do a makevector to make v_forward right
  2248. engfunc(EngFunc_MakeVectors,CoreAngles);
  2249.  
  2250. new Float:v_forward[3];
  2251. new Float:v_forward2D[2];
  2252. get_global_vector(GL_v_forward, v_forward);
  2253.  
  2254. v_forward2D[0] = v_forward[0];
  2255. v_forward2D[1] = v_forward[1];
  2256.  
  2257. flDot = vec2LOS[0]*v_forward2D[0]+vec2LOS[1]*v_forward2D[1];
  2258.  
  2259. if ( flDot > 0.5 )
  2260. {
  2261. return flDot;
  2262. }
  2263.  
  2264. return 0.0;
  2265. }
  2266.  
  2267. stock Float:Vec2DLength( Float:Vec[2] )
  2268. {
  2269. return floatsqroot(Vec[0]*Vec[0] + Vec[1]*Vec[1] );
  2270. }
  2271.  
  2272. stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha)
  2273. {
  2274. message_begin( MSG_ONE, g_msg_screenfade,{0,0,0},id );
  2275. write_short( duration ); // Duration of fadeout
  2276. write_short( holdtime ); // Hold time of color
  2277. write_short( fadetype ); // Fade type
  2278. write_byte ( red ); // Red
  2279. write_byte ( green ); // Green
  2280. write_byte ( blue ); // Blue
  2281. write_byte ( alpha ); // Alpha
  2282. message_end();
  2283. }
  2284.  
  2285. stock set_user_clip(id, ammo)
  2286. {
  2287. new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
  2288. get_weaponname(weapon, weaponname, 31);
  2289. while ((weaponid = find_ent_by_class(weaponid, weaponname)) != 0)
  2290. if(entity_get_edict(weaponid, EV_ENT_owner) == id)
  2291. {
  2292. set_pdata_int(weaponid, 51, ammo, 4);
  2293. return weaponid;
  2294. }
  2295. return 0;
  2296. }
  2297.  
  2298. public BlokirajKomande()
  2299. return PLUGIN_HANDLED;
  2300.  
  2301. public plugin_end()
  2302. nvault_close( g_vault )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement