Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fun>
- #include <cstrike>
- #include <fakemeta>
- #include <engine>
- #include <hamsandwich>
- #include <nvault>
- #include <colorchat>
- #define PLUGIN "Call of Duty: MW Mod"
- #define VERSION "0.7.9 Beta"
- #define AUTHOR "QTM_Peyote"
- #define EDIT "Nightime"
- #define STANDARDNA_brzina 250.0
- #define ZADATAK_POKAZI_INFORMACIJE 672
- #define ZADATAK_PROVERA 704
- #define ZADATAK_WYSZKOLENIE_SANITARNE 736
- #define ZADATAK_POKAZI_REKLAME 768
- #define ZADATAK_POSTAVI_brzinu 832
- //#define BOTY 1
- new SyncHudObj;
- new SyncHudObj2;
- new SyncHudObj3;
- new g_msg_screenfade;
- new sprite_white;
- new sprite_blast;
- new g_vault;
- new postavljena;
- new deaktivirana;
- new iskustvo_za_ubistvo;
- new iskustvo_za_c4;
- new iskustvo_za_pare;
- new iskustvo_za_mnogopara;
- new iskustvo_za_tiket;
- new iskustvo_za_budale;
- new Ubrania_CT[4][]={"sas","gsg9","urban","gign"};
- new Ubrania_Terro[4][]={"arctic","leet","guerilla","terror"};
- 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};
- new const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
- 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
- new informacije_predmet_igraca[33][2];
- new const naziv_predmeta[][] = {"Nema",
- "Necujne Cizme", //1
- "Dupli Pancir", //2
- "Ojacani Pancir", //3
- "Veteran sa nozem", //4
- "Iznenadi neprijatelje", //5
- "Nevidljivost", //6
- "Respawn", //7
- "Noz Marinca", //8
- "Kamuflaza", //9
- "HE Expert", //10
- "Dupli Skok", //11
- "Vojna tajna", //12
- "AWP Master",//13
- "Adrenalin",//14
- "Rambova tajna",//15
- "Auto-Healer",//16
- "Super Pancir",//17
- "Extra HP++",//18
- "Komplet za prvu pomoc",//19
- "No Recoil",//20
- "Titanijumski metci",//21
- "Pukovnikovi metci",//22
- "Ogranicen no-recoil",//23
- "SWAT Stit",//24
- "50 HP++",//25
- "Nano Oklop",//26
- "BulletProof",//27
- "Jetpack",
- "Madjionicar",
- "Scout Master",
- "Kovceg s blagom",
- "Unlimited Ammo",
- "Assassinov plast",
- "Gravitacija",
- "Dupli XP",
- "Generalova Oprema"
- };
- new const opis_predmet[][] = {"Ubi nekog i dobices predmet",
- "Necujno trcanje",
- "Smanjuje stetu za LW %",
- "Smanjuje stetu za LW %",
- "Brze ubijas nozem",
- "Kada pogodite nekog od pozadi, povrede su dva puta vece",
- "Imate LW % nevidljivosti",
- "1/LW sanse da se respawn posle smrti",
- "Brzo ubijanje nozem",
- "Imate 1/LW sanse da odmah ubijete sa HE. Takodje izgledate kao neprijatelj",
- "Instant kill sa granatom (HE). Zadajes LW % dodatne stete",
- "Dupli skok",
- "Vase povrede su smanjene za 5. Imate 1/LW sanse da oslepite neprijatelja",
- "Instant kill sa AWP",
- "Za svaki kill dobijate 50hp",
- "Za svaki kill dobijate pun sarzer i 20hp",
- "Dobijate 10hp svakih 5 sec",
- "Imate 500 stita",
- "Dobijate +100hp svake runde, ali zato ste sporiji",
- "Koristite da regeneriste maximalni HP",
- "Nema trzanja puske kad pucate",
- "Zadajete protivnicima +10 vise stete",
- "Zadajete protivnicima +25 vise stete",
- "Smanjeno trazanje puske",
- "Ni jedan predmet nece uticati na vas",
- "Dobijate +50hp svake runde, ali zato ste sporiji",
- "Imate 1/LW sanse da izbegnete stetu",
- "Otporni ste na 3 metka u svakom krugu",
- "Pritisnite CRTL i SPACE da koristite jetpack, jetpack se obnavlja svake 4 sec",
- "Nevidljivi ste dok cucite",
- "Imate 1/2 sanse za instant kill scoutom",
- "Dobijate 6000$ svake runde",
- "Imate beskonacno municije",
- "Nevidljivi ste dok drzite noz",
- "Imate manju gravitaciju",
- "Dobijate dupli xp za kill",
- "Dobijate M4A1, AWP i 1 / 3 sa AWP"
- };
- new ID_igraca[33][35];
- new klasa_igraca[33];
- new level_igraca[33] = 1;
- new iskustvo_igraca[33];
- new nova_klasa_igraca[33];
- new const iskustvo_levelu[] = {0,7,28,63,112,175,252,343,448,567,700,847,1008,1183,1372,1575,1792,2023,2268,2527,
- 2800,3087,3388,3703,4032,4375,4732,5103,5488,5887,6300,6727,7168,7623,8092,8575,9072,9583,10108,10647,
- 11200,11767,12348,12943,13552,14175,14812,15463,16128,16807,17500,18207,18928,19663,20412,21175,21952,22743,23548,24367,
- 25200,26047,26908,27783,28672,29575,30492,31423,32368,33327,34300,35287,36288,37303,38332,39375,40432,41503,42588,43687,
- 44800,45927,47068,48223,49392,50575,51772,52983,54208,55447,56700,57967,59248,60543,61852,63175,64512,65863,67228,68607,
- 70000,71407,72828,74263,75712,77175,78652,80143,81648,83167,84700,86247,87808,89383,90972,92575,94192,95823,97468,99127,
- 100800,102487,104188,105903,107632,109375,111132,112903,114688,116487,118300,120127,121968,123823,125692,127575,129472,131383,133308,135247,
- 137200,139167,141148,143143,145152,147175,149212,151263,153328,155407,157500,159607,161728,163863,166012,168175,170352,172543,174748,176967,
- 179200,181447,183708,185983,188272,190575,192892,195223,197568,199927,202300,204687,207088,209503,211932,214375,216832,219303,221788,224287,
- 226800,229327,231868,234423,236992,239575,242172,244783,247408,250047,252700,255367,258048,260743,263452,266175,268912,271663,274428,277207,
- 280000,282807,285628,288463,291312,294175,297052,299943,302848,305767,308700,311647,314608,317583,320572,323575,326592,329623,332668,335727,
- 338800,341887,344988,348103,351232,354375,357532,360703,363888,367087,370300,373527,376768,380023,383292,386575,389872,393183,396508,399847,
- 403200,406567,409948,413343,416752,420175,423612,427063,430528,434007,437500,441007,444528,448063,451612,455175,458752,462343,465948,469567,
- 473200,476847,480508,484183,487872,491575,495292,499023,502768,506527,510300,514087,517888,521703,525532,529375,533232,537103,540988,544887,
- 548800,552727,556668,560623,564592,568575,572572,576583,580608,584647,588700,592767,596848,600943,605052,609175,613312,617463,621628,625807,
- 630000,634207,638428,642663,646912,651175,655452,659743,664048,668367,672700,677047,681408,685783,690172,694575,698992,703423,707868,712327,
- 716800,721287,725788,730303,734832,739375,743932,748503,753088,757687,762300,766927,771568,776223,780892,785575,790272,794983,799708,804447,
- 809200,813967,818748,823543,828352,833175,838012,842863,847728,852607,857500,862407,867328,872263,877212,882175,887152,892143,897148,902167,
- 907200,912247,917308,922383,927472,932575,937692,942823,947968,953127,958300,963487,968688,973903,979132,984375,989632,994903,1000188,1005487,
- 1010800,1016127,1021468,1026823,1032192,1037575,1042972,1048383,1053808,1059247,1064700,1070167,1075648,1081143,1086652,1092175,1097712,1103263,1108828,1114407,
- 1120000,1125607,1131228,1136863,1142512,1148175,1153852,1159543,1165248,1170967,1176700,1182447,1188208,1193983,1199772,1205575,1211392,1217223,1223068,1228927,
- 1234800,1240687,1246588,1252503,1258432,1264375,1270332,1276303,1282288,1288287,1294300,1300327,1306368,1312423,1318492,1324575,1330672,1336783,1342908,1349047,
- 1355200,1361367,1367548,1373743,1379952,1386175,1392412,1398663,1404928,1411207,1417500,1423807,1430128,1436463,1442812,1449175,1455552,1461943,1468348,1474767,
- 1481200,1487647,1494108,1500583,1507072,1513575,1520092,1526623,1533168,1539727,1546300,1552887,1559488,1566103,1572732,1579375,1586032,1592703,1599388,1606087,
- 1612800,1619527,1626268,1633023,1639792,1646575,1653372,1660183,1667008,1673847,1680700,1687567,1694448,1701343,1708252,1715175,1722112,1729063,1736028,1743007,
- 1750000,1757007,1764028,1771063,1778112,1785175,1792252,1799343,1806448,1813567,1820700,1827847,1835008,1842183,1849372,1856575,1863792,1871023,1878268,1885527,
- 1892800,1900087,1907388,1914703,1922032,1929375,1936732,1944103,1951488,1958887,1966300,1973727,1981168,1988623,1996092,2003575,2011072,2018583,2026108,2033647,
- 2041200,2048767,2056348,2063943,2071552,2079175,2086812,2094463,2102128,2109807,2117500,2125207,2132928,2140663,2148412,2156175,2163952,2171743,2179548,2187367,
- 2195200,2203047,2210908,2218783,2226672,2234575,2242492,2250423,2258368,2266327,2274300,2282287,2290288,2298303,2306332,2314375,2322432,2330503,2338588,2346687,
- 2354800,2362927,2371068,2379223,2387392,2395575,2403772,2411983,2420208,2428447,2436700,2444967,2453248,2461543,2469852,2478175,2486512,2494863,2503228,2511607,
- 2520000,2528407,2536828,2545263,2553712,2562175,2570652,2579143,2587648,2596167,2604700,2613247,2621808,2630383,2638972,2647575,2656192,2664823,2673468,2682127,
- 2690800,2699487,2708188,2716903,2725632,2734375,2743132,2751903,2760688,2769487,2778300,2787127,2795968,2804823,2813692,2822575,2831472,2840383,2849308,2858247,
- 2867200,2876167,2885148,2894143,2903152,2912175,2921212,2930263,2939328,2948407,2957500,2966607,2975728,2984863,2994012,3003175,3012352,3021543,3030748,3039967,
- 3049200,3058447,3067708,3076983,3086272,3095575,3104892,3114223,3123568,3132927,3142300,3151687,3161088,3170503,3179932,3189375,3198832,3208303,3217788,3227287,
- 3236800,3246327,3255868,3265423,3274992,3284575,3294172,3303783,3313408,3323047,3332700,3342367,3352048,3361743,3371452,3381175,3390912,3400663,3410428,3420207,
- 3430000,3439807,3449628,3459463,3469312,3479175,3489052,3498943,3508848,3518767,3528700,3538647,3548608,3558583,3568572,3578575,3588592,3598623,3608668,3618727,
- 3628800,3638887,3648988,3659103,3669232,3679375,3689532,3699703,3709888,3720087,3730300,3740527,3750768,3761023,3771292,3781575,3791872,3802183,3812508,3822847,
- 3833200,3843567,3853948,3864343,3874752,3885175,3895612,3906063,3916528,3927007,3937500,3948007,3958528,3969063,3979612,3990175,4000752,4011343,4021948,4032567,
- 4043200,4053847,4064508,4075183,4085872,4096575,4107292,4118023,4128768,4139527,4150300,4161087,4171888,4182703,4193532,4204375,4215232,4226103,4236988,4247887,
- 4258800,4269727,4280668,4291623,4302592,4313575,4324572,4335583,4346608,4357647,4368700,4379767,4390848,4401943,4413052,4424175,4435312,4446463,4457628,4468807,
- 4480000,4491207,4502428,4513663,4524912,4536175,4547452,4558743,4570048,4581367,4592700,4604047,4615408,4626783,4638172,4649575,4660992,4672423,4683868,4695327,
- 4706800,4718287,4729788,4741303,4752832,4764375,4775932,4787503,4799088,4810687,4822300,4833927,4845568,4857223,4868892,4880575,4892272,4903983,4915708,4927447,
- 4939200,4950967,4962748,4974543,4986352,4998175,5010012,5021863,5033728,5045607,5057500,5069407,5081328,5093263,5105212,5117175,5129152,5141143,5153148,5165167,
- 5177200,5189247,5201308,5213383,5225472,5237575,5249692,5261823,5273968,5286127,5298300,5310487,5322688,5334903,5347132,5359375,5371632,5383903,5396188,5408487,
- 5420800,5433127,5445468,5457823,5470192,5482575,5494972,5507383,5519808,5532247,5544700,5557167,5569648,5582143,5594652,5607175,5619712,5632263,5644828,5657407,
- 5670000,5682607,5695228,5707863,5720512,5733175,5745852,5758543,5771248,5783967,5796700,5809447,5822208,5834983,5847772,5860575,5873392,5886223,5899068,5911927,
- 5924800,5937687,5950588,5963503,5976432,5989375,6002332,6015303,6028288,6041287,6054300,6067327,6080368,6093423,6106492,6119575,6132672,6145783,6158908,6172047,
- 6185200,6198367,6211548,6224743,6237952,6251175,6264412,6277663,6290928,6304207,6317500,6330807,6344128,6357463,6370812,6384175,6397552,6410943,6424348,6437767,
- 6451200,6464647,6478108,6491583,6505072,6518575,6532092,6545623,6559168,6572727,6586300,6599887,6613488,6627103,6640732,6654375,6668032,6681703,6695388,6709087,
- 6722800,6736527,6750268,6764023,6777792,6791575,6805372,6819183,6833008,6846847,6860700,6874567,6888448,6902343,6916252,6930175,6944112,6958063,6972028,6986007,
- 7000000,7014007,7028028,7042063,7056112,7070175,7084252,7098343,7112448,7126567,7140700,7154847,7169008,7183183,7197372,7211575,7225792,7240023,7254268,7268527,
- 7282800,7297087,7311388,7325703,7340032,7354375,7368732,7383103,7397488,7411887,7426300,7440727,7455168,7469623,7484092,7498575,7513072,7527583,7542108,7556647,
- 7571200,7585767,7600348,7614943,7629552,7644175,7658812,7673463,7688128,7702807,7717500,7732207,7746928,7761663,7776412,7791175,7805952,7820743,7835548,7850367,
- 7865200,7880047,7894908,7909783,7924672,7939575,7954492,7969423,7984368,7999327,8014300,8029287,8044288,8059303,8074332,8089375,8104432,8119503,8134588,8149687,
- 8164800,8179927,8195068,8210223,8225392,8240575,8255772,8270983,8286208,8301447,8316700,8331967,8347248,8362543,8377852,8393175,8408512,8423863,8439228,8454607,
- 8470000,8485407,8500828,8516263,8531712,8547175,8562652,8578143,8593648,8609167,8624700,8640247,8655808,8671383,8686972,8702575,8718192,8733823,8749468,8765127,
- 8780800,8796487,8812188,8827903,8843632,8859375,8875132,8890903,8906688,8922487,8938300,8954127,8969968,8985823,9001692,9017575,9033472,9049383,9065308,9081247,
- 9097200,9113167,9129148,9145143,9161152,9177175,9193212,9209263,9225328,9241407,9257500,9273607,9289728,9305863,9322012,9338175,9354352,9370543,9386748,9402967,
- 9419200,9435447,9451708,9467983,9484272,9500575,9516892,9533223,9549568,9565927,9582300,9598687,9615088,9631503,9647932,9664375,9680832,9697303,9713788,9730287,
- 9746800,9763327,9779868,9796423,9812992,9829575,9846172,9862783,9879408,9896047,9912700,9929367,9946048,9962743,9979452,9996175,10012912,10029663,10046428,10063207,
- 10080000,10096807,10113628,10130463,10147312,10164175,10181052,10197943,10214848,10231767,10248700,10265647,10282608,10299583,10316572,10333575,10350592,10367623,10384668,10401727,
- 10418800,10435887,10452988,10470103,10487232,10504375,10521532,10538703,10555888,10573087,10590300,10607527,10624768,10642023,10659292,10676575,10693872,10711183,10728508,10745847,
- 10763200,10780567,10797948,10815343,10832752,10850175,10867612,10885063,10902528,10920007,10937500,10955007,10972528,10990063,11007612,11025175,11042752,11060343,11077948,11095567,
- 11113200,11130847,11148508,11166183,11183872,11201575,11219292,11237023,11254768,11272527,11290300,11308087,11325888,11343703,11361532,11379375,11397232,11415103,11432988,11450887,
- 11468800,11486727,11504668,11522623,11540592,11558575,11576572,11594583,11612608,11630647,11648700,11666767,11684848,11702943,11721052,11739175,11757312,11775463,11793628,11811807,
- 11830000,11848207,11866428,11884663,11902912,11921175,11939452,11957743,11976048,11994367,12012700,12031047,12049408,12067783,12086172,12104575,12122992,12141423,12159868,12178327,
- 12196800,12215287,12233788,12252303,12270832,12289375,12307932,12326503,12345088,12363687,12382300,12400927,12419568,12438223,12456892,12475575,12494272,12512983,12531708,12550447,
- 12569200,12587967,12606748,12625543,12644352,12663175,12682012,12700863,12719728,12738607,12757500,12776407,12795328,12814263,12833212,12852175,12871152,12890143,12909148,12928167,
- 12947200,12966247,12985308,13004383,13023472,13042575,13061692,13080823,13099968,13119127,13138300,13157487,13176688,13195903,13215132,13234375,13253632,13272903,13292188,13311487,
- 13330800,13350127,13369468,13388823,13408192,13427575,13446972,13466383,13485808,13505247,13524700,13544167,13563648,13583143,13602652,13622175,13641712,13661263,13680828,13700407,
- 13720000,13739607,13759228,13778863,13798512,13818175,13837852,13857543,13877248,13896967,13916700,13936447,13956208,13975983,13995772,14015575,14035392,14055223,14075068,14094927,
- 14114800,14134687,14154588,14174503,14194432,14214375,14234332,14254303,14274288,14294287,14314300,14334327,14354368,14374423,14394492,14414575,14434672,14454783,14474908,14495047,
- 14515200,14535367,14555548,14575743,14595952,14616175,14636412,14656663,14676928,14697207,14717500,14737807,14758128,14778463,14798812,14819175,14839552,14859943,14880348,14900767,
- 14921200,14941647,14962108,14982583,15003072,15023575,15044092,15064623,15085168,15105727,15126300,15146887,15167488,15188103,15208732,15229375,15250032,15270703,15291388,15312087,
- 15332800,15353527,15374268,15395023,15415792,15436575,15457372,15478183,15499008,15519847,15540700,15561567,15582448,15603343,15624252,15645175,15666112,15687063,15708028,15729007};
- new poeni_igraca[33];
- new energija_igraca[33];
- new inteligencija_igraca[33];
- new snaga_igraca[33];
- new Float:smanjene_povrede_igraca[33];
- new kondicija_igraca[33];
- new maximalna_energija_igraca[33];
- new Float:brzina_igraca[33];
- new bool:igrac_resetuje[33];
- enum { NONE = 0, Snajperista, Marinac, Pro_Strelac, Branilac, Doktor, Vatrena_podrska, Miner, Demolitions, Rusher, Rambo, Partizan, Spijun, Bombarder, Gunner, Pesadinac, Pobunjenik, Ninja, Chuck_Norris, Crysis, Warrior, SWAT, General, Pukovnik, Defender, Predator, Assassin, Univerzalni_vojnik, Destroyer, Revolveras, Pro_Miner, Jason_Bourne, Joker};
- new const energija_klasa[] = { 0, 120, 140, 110, 120, 110, 100, 100, 110, 100, 130, 100, 70, 140, 125, 100, 125, 70, 100, 120, 140, 110, 120, 100, 90, 100, 30, 200, 120, 110, 110, 200, 230};
- 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, 1.5, 1.3, 1.3, 0.9, 0.95, 1.2, 1.1, 1.2, 1.25, 1.4, 1.0, 1.1, 1.0, 1.0, 1.2, 0.8};
- new const oklop_klase[] = { 0, 100, 100, 100, 150, 100, 0, 100, 100, 0, 150, 0, 0, 150, 50, 0, 25, 0, 100, 100, 100, 100, 70, 100, 90, 50, 0, 100, 0, 100, 100, 100, 100};
- new const naziv_klase[][] = {"Nema",
- "Snajperista",
- "Marinac",
- "Pro-Strelac",
- "Mitraljezac",
- "Doktor",
- "Vatrena podrska",
- "Miner",
- "Demolitions",
- "Rusher",
- "Rambo (Premium Klasa)",
- "Partizan",
- "Spijun",
- "Bombarder",
- "Gunner",
- "Pesadinac",
- "Pobunjenik",
- "Terorista",
- "Chuck Norris",
- "Crysis",
- "Warrior",
- "SWAT",
- "General",
- "Pukovnik",
- "Defender",
- "Predator",
- "Assassin (Premium Klasa)",
- "Univerzalni vojnik (Premium Klasa)",
- "Destroyer",
- "Revolveras",
- "Pro Miner",
- "Jason Bourne (Premium Klasa)",
- "Joker (Premium Klasa)"
- };
- new const frakcije[][] = {
- "Nema",
- "\yObicne Klase",
- "\yPremium Klase"
- }
- enum {
- NONE = 0,
- obicna,
- premium
- }
- new const pripada[] = {
- NONE, // Nema 0
- obicna, // Snajperista 1
- obicna, // Marinac 2
- obicna, // Pro Strelac 3
- obicna, // Mitraljezac 4
- obicna, // Doktor 5
- obicna, // Vatrena Podrska 6
- obicna, // Miner 7
- obicna, // Demolitions 8
- obicna, // Rusher 9
- premium, // Rambo (Premium) 10
- obicna, // Partizan 11
- obicna, // Spijun 12
- obicna, // Bomberder 13
- obicna, // Gunner 14
- obicna, // Pesadinac 15
- obicna, // Pobunjenik 16
- obicna, // Terorista 17
- obicna, // Chuck Norris 18
- obicna, // Crysis 19
- obicna, // Warrior 20
- obicna, // SWAT 21
- obicna, // General 22
- obicna, // Pukovnik 23
- obicna, // Defender 24
- obicna, // Predator
- premium, // Assassin (Premium) 25
- premium, // Univerzalni vojnik (Premium) 26
- obicna, // Destroyer 27
- obicna, // Revolveras 28
- obicna, // Pro Miner 29
- premium, // Jason Bourne (Premium) 30
- premium, // Joker (Premium) 31
- }
- new frakcija_igraca[33]
- new const opis_klase[][] = {"Nema",
- "Dobija AWP, Deagle i Scout, 120hp, i 1 / 4 sanse za instant sa AWP i SCOUT, 110% trcanje, 100 Oklop",
- "Dobija Deagle, 140hp, odma ubija nozem (desni taster misa), 135% trcanje, 100 Oklop",
- "Dobija AK47 i M4A1, 110hp, 80% trcanje, 100 Oklop",
- "Dobija M249(krmaca), 120hp, 80% trcanje, otporan na mine, ima sve bombe, 150 Oklop",
- "Dobija UMP45, TMP, 110hp, komplet za prvu pomoc, 100 Oklop",
- "Dobija MP5, 100hp, ima dva projektila",
- "Dobija P90, 100hp, 100 oklop, dobija 3 mine",
- "Dobija Aug 110hp, 100 oklop, ima sve bombe, dobija dinamit, koji ubija sve u krugu od 1m",
- "Dobija M3(pumparica), 100hp, 130% trcanje",
- "Dobija Famas, 130hp, 120% trcanje, za svako ubistvo + 20hp i pun sanzer, dupli skok",
- "Dobija P90 + FLASH, 100hp + manje je vidljiv",
- "Dobija Deagle, 70hp, kamuflaza (izgleda kao neprijatelj)",
- "Dobija M4a1 + Deagle + HE, 140hp + 150 oklop, ali je sporiji",
- "Dobija G3/SG-1, 125 hp, i ima 1 raketu",
- "Dobija Galil + p228, 100hp, + brzina",
- "Dobija SG552 + 1 minu + 1 HE, 100hp",
- "Dobija Elites(2 pistolja), 70hp, ali je super brz",
- "Dobija Mac10, 100hp, 130 brzinu, 100 oklop",
- "Dobija Sig 552, M4A1, 120hp, 130 brzinu, 100 oklop i 1 raketu",
- "Dobija FAMAS, HE, 140hp, 90 brzinu, 100 oklop",
- "Dobija M4A1, 110hp, 95 brzinu, 100 oklop i otporan je na noz",
- "Dobija TMP, AWP, 120hp, 120 brzinu, 70 oklop",
- "Dobija M4A1, flash, 100hp, 110 brzinu, 100 oklop i ima 1 / 4 sansu za respawn",
- "Dobija DEAGLE, stit, 90hp, 120 brzinu i 90 oklop",
- "Dobija DEAGLE, 100hp, 125 brzinu, 50 oklop, ima instant kill nozem, 1 raketu i manje je vidljiv",
- "Dobija DEAGLE, 30hp, 140 brzinu, ima instant kill nozem i nevidljiv je kad drzi noz",
- "Dobija M4A1, 200hp, 100 brzinu, 100 oklop, ima Komplet za prvu pomoc i otporan je na noz",
- "Dobija AK-47, 120hp, 110 brzinu,ima sve bombe i duplo brze se leveluje",
- "Dobija sve pistolje, 110hp, 100 brzinu, 100 oklop",
- "Dobija P90, DEAGLE, 110hp, 100 brzinu, 100 oklop i 5 mina",
- "Dobija M4A1, TMP, DEAGLE, ima 200hp, 120 brzinu, 100 oklop, otporan na noz, ima 1 / 8 sanse za instant kill deagleom",
- "Dobija M3, XM1014, ima 230hp, 80 brzinu, 100 oklop, otporan na noz, ima 2 dinamita i JetPack"
- };
- new broj_medkit_igraca[33];
- new broj_raketa_igraca[33];
- new Float:prethodna_raketa_igraca[33];
- new broj_min_igraca[33];
- new broj_dinamita_igraca[33];
- new broj_skokova_igraca[33];
- new bool:freezetime = true;
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- g_vault = nvault_open("CodMod");
- register_think("MedKit","MedKitThink");
- RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
- RegisterHam(Ham_Spawn, "player", "Pocetak", 1);
- RegisterHam(Ham_Touch, "armoury_entity", "DodirOruzija");
- RegisterHam(Ham_Touch, "weapon_shield", "DodirOruzija");
- RegisterHam(Ham_Touch, "weaponbox", "DodirOruzija");
- register_forward(FM_CmdStart, "CmdStart");
- register_forward(FM_EmitSound, "EmitSound");
- register_logevent("PocetakRunde", 2, "1=Round_Start");
- register_logevent("BombaPostavljena", 3, "2=Planted_The_Bomb");
- register_event("SendAudio", "BombaDeaktivirana", "a", "2&%!MRAD_BOMBDEF");
- register_event("BarTime", "PrebrojBombe", "be", "1=10", "1=5");
- register_event("DeathMsg", "Death", "ade");
- register_event("Damage", "Damage", "b", "2!=0");
- register_event("CurWeapon","CurWeapon","be", "1=1");
- register_event("HLTV", "novaRunda", "a", "1=0", "2=0");
- register_touch("Rocket", "*" , "DodirRakete");
- register_touch("Mine", "player", "DodirMine");
- register_cvar("cod_killxp", "500");
- register_cvar("cod_bombxp", "200");
- register_clcmd("say /klasa", "IzaberiKlasu");
- register_clcmd("say /opis", "OpisKlase");
- register_clcmd("say /predmet", "OpisPredmeta");
- register_clcmd("say /item", "OpisPredmeta");
- register_clcmd("say /drop", "IzbaciPredmet");
- register_clcmd("say /izbaci", "IzbaciPredmet");
- register_clcmd("say /reset", "KomandaResetujPoene");
- register_clcmd("say /shop", "Shop");
- register_clcmd("say", "cmdCheckSay", -1);
- register_clcmd("fullupdate", "BlokirajKomande");
- register_clcmd("cl_autobuy", "BlokirajKomande");
- register_clcmd("say /molotov", "BlokirajKomande");
- register_clcmd("say molotov", "BlokirajKomande");
- register_clcmd("cl_rebuy", "BlokirajKomande");
- register_clcmd("cl_setautobuy","BlokirajKomande");
- register_clcmd("rebuy", "BlokirajKomande");
- register_clcmd("autobuy", "BlokirajKomande");
- register_clcmd("glock", "BlokirajKomande");
- register_clcmd("usp", "BlokirajKomande");
- register_clcmd("p228", "BlokirajKomande");
- register_clcmd("deagle", "BlokirajKomande");
- register_clcmd("elites", "BlokirajKomande");
- register_clcmd("fn57", "BlokirajKomande");
- register_clcmd("m3", "BlokirajKomande");
- register_clcmd("XM1014", "BlokirajKomande");
- register_clcmd("mac10", "BlokirajKomande");
- register_clcmd("tmp", "BlokirajKomande");
- register_clcmd("mp5", "BlokirajKomande");
- register_clcmd("ump45", "BlokirajKomande");
- register_clcmd("p90", "BlokirajKomande");
- register_clcmd("galil", "BlokirajKomande");
- register_clcmd("ak47", "BlokirajKomande");
- register_clcmd("scout", "BlokirajKomande");
- register_clcmd("sg552", "BlokirajKomande");
- register_clcmd("awp", "BlokirajKomande");
- register_clcmd("g3sg1", "BlokirajKomande");
- register_clcmd("famas", "BlokirajKomande");
- register_clcmd("m4a1", "BlokirajKomande");
- register_clcmd("bullpup", "BlokirajKomande");
- register_clcmd("sg550", "BlokirajKomande");
- register_clcmd("m249", "BlokirajKomande");
- register_clcmd("shield", "BlokirajKomande");
- register_clcmd("hegren", "BlokirajKomande");
- register_clcmd("sgren", "BlokirajKomande");
- register_clcmd("flash", "BlokirajKomande");
- register_concmd("cod_setlvl", "cmd_setlvl", ADMIN_RCON, "<name> <level>");
- register_clcmd("say /prodaj", "Prodaj");
- g_msg_screenfade = get_user_msgid("ScreenFade");
- SyncHudObj = CreateHudSyncObj();
- SyncHudObj2 = CreateHudSyncObj();
- SyncHudObj3 = CreateHudSyncObj();
- iskustvo_za_ubistvo = get_cvar_num("cod_killxp");
- iskustvo_za_c4 = get_cvar_num("cod_bombxp");
- iskustvo_za_pare = 500;
- iskustvo_za_mnogopara = 1000;
- iskustvo_za_tiket = 100;
- iskustvo_za_budale = 1;
- set_task(30.0, "Pomoc");
- }
- public plugin_cfg()
- {
- server_cmd("sv_maxspeed 1600");
- }
- public plugin_precache()
- {
- sprite_white = precache_model("sprites/white.spr") ;
- sprite_blast = precache_model("sprites/dexplo.spr");
- precache_sound("QTM_CodMod/select.wav");
- precache_sound("QTM_CodMod/start.wav");
- precache_sound("QTM_CodMod/start2.wav");
- precache_sound("QTM_CodMod/levelup.wav");
- precache_model("models/w_medkit.mdl");
- precache_model("models/rpgrocket.mdl");
- precache_model("models/mine.mdl");
- }
- public Shop(id)
- {
- new menu = menu_create("Shop:", "Shop_Handle");
- menu_additem(menu, "TwiX \r[Dodaje 20 HP] \yCena: \r1500$");
- menu_additem(menu, "Aspirin \r[Dodaje 50 HP] \yCena: \r3000$");
- menu_additem(menu, "Morfijum \r[Dodaje 100 HP] \yCena: \r5000$");
- menu_additem(menu, "RedBull \r[Veci Skok + Veca Brzina] \yCena: \r7500$");
- menu_additem(menu, "Lotto \r[Tiket za loto] \yCena: \r2000$");
- menu_additem(menu, "Iskustvo \r[Dodaje 50 EXP] \yCena: \r5000$");
- menu_additem(menu, "Super iskustvo \r[Dodaje 150 EXP] \yCena: \r10000$");
- menu_additem(menu, "Slucajni Izbor \r[Predmet] \yCena: \r3000$");
- menu_display(id, menu);
- }
- public Shop_Handle(id, menu, item)
- {
- client_cmd(id, "spk QTM_CodMod/select");
- if(item == MENU_EXIT)
- {
- menu_destroy(menu);
- return PLUGIN_CONTINUE;
- }
- menu_display(id, menu);
- new pare_igraca = cs_get_user_money(id);
- new hp = get_user_health(id);
- switch(item)
- {
- case 0:
- {
- new cena = 1500;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop] ^1Nemate dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- if(hp >= maximalna_energija_igraca[id])
- {
- ColorChat(id,GREEN,"[Shop] ^1Vec imate maximalnu energiju.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- new ammount=20;
- new nova_energija = (hp+ammount<maximalna_energija_igraca[id])? hp+ammount: maximalna_energija_igraca[id];
- set_user_health(id, nova_energija);
- ColorChat(id,GREEN,"[Shop] ^1Kupio si ^3TwiX");
- }
- case 1:
- {
- new cena = 3000;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- if(hp >= maximalna_energija_igraca[id])
- {
- ColorChat(id,GREEN,"[Shop] ^1Vec imate maximalnu energiju.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- new ammount=50;
- new nova_energija = (hp+ammount<maximalna_energija_igraca[id])? hp+ammount: maximalna_energija_igraca[id];
- set_user_health(id, nova_energija);
- ColorChat(id,GREEN,"[Shop] ^1kupio si ^3Aspirin");
- }
- case 2:
- {
- new cena = 5000;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- if(hp >= maximalna_energija_igraca[id])
- {
- ColorChat(id,GREEN,"[Shop] ^1Vec imate maximalnu energiju.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- new ammount=100;
- new nova_energija = (hp+ammount<maximalna_energija_igraca[id])? hp+ammount: maximalna_energija_igraca[id];
- set_user_health(id, nova_energija);
- ColorChat(id,GREEN,"[Shop] ^1Kupio si^3 Morfijum");
- }
- case 3:
- {
- new cena = 7500;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- set_user_gravity(id,get_user_gravity(id) - 0.3);
- set_user_maxspeed(id,get_user_maxspeed(id) + 10.0);
- ColorChat(id,GREEN,"[Shop]^1 Kupio si^3 RedBull");
- }
- case 4:
- {
- new pare_igraca = cs_get_user_money(id)
- new cena = 2000;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop] ^1Nemas dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- ColorChat(id,GREEN,"[Shop] ^1Kupio si tiket za Loto");
- ColorChat(id,GREEN,"[Shop] ^1Ucitavam brojeve...");
- new rand = random_num(0,12);
- switch(rand)
- {
- case 0:
- {
- ColorChat(id,GREEN,"[Shop] ^1Dobio si^3 10$^1!")
- cs_set_user_money(id, pare_igraca + 10)
- }
- case 1:
- {
- ColorChat(id,GREEN,"[Shop] ^1Dobio si^3 Redbull^1!")
- set_user_gravity(id,get_user_gravity(id) - 0.3);
- set_user_maxspeed(id,get_user_maxspeed(id) + 10.0);
- }
- case 2:
- {
- ColorChat(id,GREEN,"[Shop] ^1Nazalost nisi nista dobio!")
- }
- case 3:
- {
- ColorChat(id,GREEN,"[Shop] ^1Dobio si^3 300$^1!")
- cs_set_user_money(id, pare_igraca + 300)
- }
- case 4:
- {
- ColorChat(id,GREEN,"[Shop] ^1Dobio si^3 1000$^1!")
- cs_set_user_money(id, pare_igraca + 1000)
- }
- case 5:
- {
- ColorChat(id,GREEN,"[Shop] ^1Nazalost nisi nista dobio!")
- }
- case 6:
- {
- ColorChat(id,GREEN,"[Shop] ^1Nazalost nisi nista dobio!")
- }
- case 7:
- {
- ColorChat(id,GREEN,"[Shop] ^1Izgubio si^3 16000$^1!")
- cs_set_user_money(id, pare_igraca - 16000)
- }
- case 8:
- {
- ColorChat(id,GREEN,"[Shop] ^1Nazalost nisi nista dobio!")
- }
- case 9:
- {
- ColorChat(id,GREEN,"[Shop]^1 Dobio si^3 150 EXP ^1!")
- iskustvo_igraca[id] += iskustvo_za_mnogopara;
- }
- case 10:
- {
- ColorChat(id,GREEN,"[Shop]^1 Dobio si^3 100 EXP^1!")
- iskustvo_igraca[id] += iskustvo_za_tiket;
- }
- case 11:
- {
- ColorChat(id,GREEN,"[Shop] ^1Nazalost nisi nista dobio!")
- }
- case 12:
- {
- ColorChat(id,GREEN,"[Shop]^1 Dobio si^3 1 EXP^1 !")
- iskustvo_igraca[id] += iskustvo_za_budale;
- }
- }
- ProveriNivo(id);
- return PLUGIN_CONTINUE;
- }
- case 5:
- {
- new cena = 5000;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop]^1 Nemas dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- iskustvo_igraca[id] += iskustvo_za_pare;
- ColorChat(id,GREEN,"[Shop] ^1Kupio si ^3Iskustvo");
- ProveriNivo(id);
- }
- case 6:
- {
- new cena = 10000;
- if (pare_igraca<cena)
- {
- ColorChat(id,GREEN,"[Shop]^1 Nemas dovoljno para.");
- return PLUGIN_CONTINUE;
- }
- cs_set_user_money(id, pare_igraca-cena);
- iskustvo_igraca[id] += iskustvo_za_mnogopara;
- ColorChat(id,GREEN,"[Shop]^1Kupio si ^3Super Iskustvo");
- ProveriNivo(id);
- }
- case 7:
- {
- new cena = 3000;
- if (pare_igraca<cena)
- {
- ColorChat(id,RED,"[Shop]^1 Nemas dovoljno para!");
- return PLUGIN_HANDLED;
- }
- cs_set_user_money(id, pare_igraca-cena);
- DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
- }
- }
- return PLUGIN_CONTINUE;
- }
- public CmdStart(id, uc_handle)
- {
- if(!is_user_alive(id))
- return FMRES_IGNORED;
- new button = get_uc(uc_handle, UC_Buttons);
- new oldbutton = get_user_oldbutton(id);
- new flags = get_entity_flags(id);
- if(informacije_predmet_igraca[id][0] == 11 || klasa_igraca[id] == Rambo)
- {
- if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && broj_skokova_igraca[id] > 0)
- {
- broj_skokova_igraca[id]--;
- new Float:velocity[3];
- entity_get_vector(id,EV_VEC_velocity,velocity);
- velocity[2] = random_float(265.0,285.0);
- entity_set_vector(id,EV_VEC_velocity,velocity);
- }
- else if(flags & FL_ONGROUND)
- {
- broj_skokova_igraca[id] = 0;
- if(informacije_predmet_igraca[id][0] == 11)
- broj_skokova_igraca[id]++;
- if(klasa_igraca[id] == Rambo)
- broj_skokova_igraca[id]++;
- }
- }
- if(button & IN_ATTACK)
- {
- new Float:punchangle[3];
- if(informacije_predmet_igraca[id][0] == 20)
- entity_set_vector(id, EV_VEC_punchangle, punchangle);
- if(informacije_predmet_igraca[id][0] == 23)
- {
- entity_get_vector(id, EV_VEC_punchangle, punchangle);
- for(new i=0; i<3;i++)
- punchangle[i]*=0.9;
- entity_set_vector(id, EV_VEC_punchangle, punchangle);
- }
- }
- 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)
- {
- informacije_predmet_igraca[id][1] = floatround(get_gametime());
- new Float:velocity[3];
- VelocityByAim(id, 700, velocity);
- velocity[2] = random_float(265.0,285.0);
- entity_set_vector(id, EV_VEC_velocity, velocity);
- }
- if(informacije_predmet_igraca[id][0] == 29)
- {
- if(button & IN_DUCK)
- set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 1)
- else
- set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255)
- }
- return FMRES_IGNORED;
- }
- public cmd_setlvl(id, level, cid)
- {
- if(!cmd_access(id,level,cid,3))
- return PLUGIN_HANDLED;
- new arg1[33];
- new arg2[6];
- read_argv(1, arg1, 32);
- read_argv(2, arg2, 5);
- new player = cmd_target(id, arg1);
- new value = str_to_num(arg2)-1;
- iskustvo_igraca[player] = iskustvo_levelu[value];
- level_igraca[player] = 0;
- ProveriNivo(player);
- return PLUGIN_HANDLED;
- }
- public Pocetak(id)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return PLUGIN_CONTINUE;
- if(nova_klasa_igraca[id])
- {
- klasa_igraca[id] = nova_klasa_igraca[id];
- nova_klasa_igraca[id] = 0;
- strip_user_weapons(id);
- give_item(id, "weapon_knife");
- switch(get_user_team(id))
- {
- case 1: give_item(id, "weapon_glock18");
- case 2: give_item(id, "weapon_usp");
- }
- UcitajPodatke(id, klasa_igraca[id]);
- }
- if(!klasa_igraca[id])
- {
- IzaberiKlasu(id);
- return PLUGIN_CONTINUE;
- }
- switch(klasa_igraca[id])
- {
- case Snajperista:
- {
- give_item(id, "weapon_awp");
- give_item(id, "weapon_scout");
- give_item(id, "weapon_deagle");
- }
- case Marinac:
- {
- give_item(id, "weapon_deagle");
- }
- case Pro_Strelac:
- {
- give_item(id, "weapon_m4a1");
- give_item(id, "weapon_ak47");
- }
- case Branilac:
- {
- give_item(id, "weapon_m249");
- give_item(id, "weapon_hegrenade");
- give_item(id, "weapon_flashbang");
- give_item(id, "weapon_smokegrenade");
- }
- case Doktor:
- {
- give_item(id, "weapon_ump45");
- give_item(id, "weapon_tmp");
- broj_medkit_igraca[id] = 2;
- }
- case Vatrena_podrska:
- {
- give_item(id, "weapon_mp5navy");
- broj_raketa_igraca[id] = 2;
- }
- case Miner:
- {
- give_item(id, "weapon_p90");
- broj_min_igraca[id] = 3;
- }
- case Demolitions:
- {
- give_item(id, "weapon_aug");
- give_item(id, "weapon_hegrenade");
- give_item(id, "weapon_flashbang");
- give_item(id, "weapon_smokegrenade");
- broj_dinamita_igraca[id] = 1;
- }
- case Rusher:
- {
- give_item(id, "weapon_m3");
- }
- case Rambo:
- {
- give_item(id, "weapon_famas");
- }
- case Partizan:
- {
- give_item(id, "weapon_p90");
- give_item(id, "weapon_flashbang");
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 70);
- }
- case Spijun:
- {
- give_item(id, "weapon_deagle");
- PromeniModel(id, 0);
- }
- case Bombarder:
- {
- give_item(id, "weapon_m4a1");
- give_item(id, "weapon_deagle");
- give_item(id, "weapon_hegrenade");
- }
- case Gunner:
- {
- give_item(id, "weapon_g3sg1");
- broj_raketa_igraca[id] = 1 ;
- }
- case Pesadinac:
- {
- give_item(id, "weapon_galil");
- give_item(id, "weapon_p228");
- }
- case Pobunjenik:
- {
- give_item(id, "weapon_sg552");
- give_item(id, "weapon_hegrenade");
- broj_min_igraca[id] = 1 ;
- }
- case Ninja:
- {
- give_item(id, "weapon_elite");
- }
- case Chuck_Norris:
- {
- give_item(id, "weapon_mac10");
- }
- case Crysis:
- {
- give_item(id, "weapon_sg552");
- give_item(id, "weapon_m4a1");
- broj_raketa_igraca[id] = 1 ;
- }
- case Warrior:
- {
- give_item(id, "weapon_famas");
- give_item(id, "weapon_hegrenade");
- }
- case SWAT:
- {
- give_item(id, "weapon_m4a1");
- }
- case General:
- {
- give_item(id, "weapon_tmp");
- give_item(id, "weapon_awp");
- }
- case Pukovnik:
- {
- give_item(id, "weapon_m4a1");
- give_item(id, "weapon_flashbang");
- }
- case Defender:
- {
- give_item(id, "weapon_deagle");
- give_item(id, "weapon_shield");
- }
- case Predator:
- {
- give_item(id, "weapon_deagle");
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 70);
- broj_raketa_igraca[id] = 1 ;
- }
- case Assassin:
- {
- give_item(id, "weapon_deagle");
- }
- case Univerzalni_vojnik:
- {
- give_item(id, "weapon_m4a1");
- }
- case Destroyer:
- {
- give_item(id, "weapon_ak47");
- }
- case Revolveras:
- {
- give_item(id, "weapon_usp");
- give_item(id, "weapon_glock18");
- give_item(id, "weapon_p228");
- give_item(id, "weapon_deagle");
- give_item(id, "weapon_fiveseven");
- give_item(id, "weapon_elite");
- }
- case Pro_Miner:
- {
- give_item(id, "weapon_p90");
- give_item(id, "weapon_deagle");
- broj_min_igraca[id] = 1 ;
- }
- case Jason_Bourne:
- {
- give_item(id, "weapon_m4a1");
- give_item(id, "weapon_tmp");
- give_item(id, "weapon_deagle");
- }
- case Joker:
- {
- give_item(id, "weapon_m3");
- give_item(id, "weapon_xm1014");
- broj_dinamita_igraca[id] = 2;
- }
- }
- if(igrac_resetuje[id])
- {
- ResetujPoene(id);
- igrac_resetuje[id] = false;
- }
- if(poeni_igraca[id]>0)
- DodelaPoena(id);
- if(informacije_predmet_igraca[id][0] == 10 || informacije_predmet_igraca[id][0] == 9)
- give_item(id, "weapon_hegrenade");
- if(informacije_predmet_igraca[id][0] == 9)
- PromeniModel(id, 0);
- if(informacije_predmet_igraca[id][0] == 1)
- set_user_footsteps(id, 1);
- else
- set_user_footsteps(id, 0);
- if(informacije_predmet_igraca[id][0] == 13)
- give_item(id, "weapon_awp");
- if((informacije_predmet_igraca[id][0] == 19) || (klasa_igraca[id] == Univerzalni_vojnik))
- informacije_predmet_igraca[id][1] = 1;
- if(informacije_predmet_igraca[id][0] == 27)
- informacije_predmet_igraca[id][1] = 3;
- if(informacije_predmet_igraca[id][0] == 34)
- set_user_gravity(id,get_user_gravity(id) - 0.4);
- if(informacije_predmet_igraca[id][0] == 30)
- give_item(id, "weapon_scout");
- if(informacije_predmet_igraca[id][0] == 36)
- give_item(id, "weapon_m4a1");
- give_item(id, "weapon_awp");
- new weapons[32];
- new weaponsnum;
- get_user_weapons(id, weapons, weaponsnum);
- for(new i=0; i<weaponsnum; i++)
- if(is_user_alive(id))
- if(maxAmmo[weapons[i]] > 0)
- cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
- smanjene_povrede_igraca[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(snaga_igraca[id])))/100);
- maximalna_energija_igraca[id] = energija_klasa[klasa_igraca[id]]+energija_igraca[id]*2;
- brzina_igraca[id] = STANDARDNA_brzina*brzina_klasa[klasa_igraca[id]]+floatround(kondicija_igraca[id]*1.3);
- if(informacije_predmet_igraca[id][0] == 18)
- {
- maximalna_energija_igraca[id] += 100;
- brzina_igraca[id] -= 0.4;
- }
- if(informacije_predmet_igraca[id][0] == 31)
- {
- cs_set_user_money(id, cs_get_user_money(id)+6000);
- }
- if(informacije_predmet_igraca[id][0] == 25)
- {
- maximalna_energija_igraca[id] += 50;
- brzina_igraca[id] -= 0.3;
- }
- set_user_armor(id, oklop_klase[klasa_igraca[id]]);
- set_user_health(id, maximalna_energija_igraca[id]);
- if(informacije_predmet_igraca[id][0] == 17)
- set_user_armor(id, 500);
- return PLUGIN_CONTINUE;
- }
- public PocetakRunde()
- {
- freezetime = false;
- for(new id=0;id<=32;id++)
- {
- if(!is_user_alive(id))
- continue;
- set_task(0.1, "PostaviBrzinu", id+ZADATAK_POSTAVI_brzinu);
- switch(get_user_team(id))
- {
- case 1: client_cmd(id, "spk QTM_CodMod/start");
- case 2: client_cmd(id, "spk QTM_CodMod/start2");
- }
- }
- }
- public novaRunda()
- {
- freezetime = true;
- new iEnt = find_ent_by_class(-1, "Mine");
- while(iEnt > 0)
- {
- remove_entity(iEnt);
- iEnt = find_ent_by_class(iEnt, "Mine");
- }
- }
- public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
- {
- 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])
- return HAM_IGNORED;
- new health = get_user_health(this);
- new weapon = get_user_weapon(idattacker);
- if(health < 2)
- return HAM_IGNORED;
- if(informacije_predmet_igraca[this][0] == 27 && informacije_predmet_igraca[this][1]>0)
- {
- informacije_predmet_igraca[this][1]--;
- return HAM_SUPERCEDE;
- }
- if(snaga_igraca[this]>0)
- damage -= smanjene_povrede_igraca[this]*damage;
- if(informacije_predmet_igraca[this][0] == 2 || informacije_predmet_igraca[this][0] == 3)
- damage-=(float(informacije_predmet_igraca[this][1])<damage)? float(informacije_predmet_igraca[this][1]): damage;
- if(informacije_predmet_igraca[idattacker][0] == 5 && !UTIL_In_FOV(this, idattacker) && UTIL_In_FOV(idattacker, this))
- damage*=2.0;
- if(informacije_predmet_igraca[idattacker][0] == 10)
- damage+=informacije_predmet_igraca[idattacker][1];
- if(informacije_predmet_igraca[this][0] == 12)
- damage-=(5.0<damage)? 5.0: damage;
- if(weapon == CSW_AWP && informacije_predmet_igraca[idattacker][0] == 13)
- damage=float(health);
- if(informacije_predmet_igraca[idattacker][0] == 21)
- damage+=10;
- if(informacije_predmet_igraca[idattacker][0] == 22)
- damage+=25;
- if(idinflictor != idattacker && entity_get_int(idinflictor, EV_INT_movetype) != 5)
- {
- if((informacije_predmet_igraca[idattacker][0] == 9 && random_num(1, informacije_predmet_igraca[idattacker][1]) == 1) || informacije_predmet_igraca[idattacker][0] == 10)
- damage = float(health);
- }
- if(weapon == CSW_KNIFE)
- {
- if(klasa_igraca[idattacker] == Predator)
- damage = float(health);
- if(klasa_igraca[idattacker] == Assassin)
- damage = float(health);
- if(klasa_igraca[this] == SWAT)
- return HAM_SUPERCEDE;
- if(klasa_igraca[this] == Doktor)
- return HAM_SUPERCEDE;
- if(klasa_igraca[this] == Univerzalni_vojnik)
- return HAM_SUPERCEDE;
- if(klasa_igraca[this] == Jason_Bourne)
- return HAM_SUPERCEDE;
- if(klasa_igraca[this] == Joker)
- return HAM_SUPERCEDE;
- if(informacije_predmet_igraca[this][0] == 4)
- damage=damage*1.4+inteligencija_igraca[idattacker];
- if(informacije_predmet_igraca[idattacker][0] == 8 || (klasa_igraca[idattacker] == Snajperista && random(2) == 2) || klasa_igraca[idattacker] == Marinac && !(get_user_button(idattacker) & IN_ATTACK))
- damage = float(health);
- }
- if(informacije_predmet_igraca[idattacker][0] == 30)
- {
- if(weapon == CSW_SCOUT && !random(2))
- damage = float(health);
- }
- if(informacije_predmet_igraca[idattacker][0] == 36)
- {
- if(weapon == CSW_AWP && !random(3))
- damage = float(health);
- }
- if(klasa_igraca[idattacker] == Jason_Bourne)
- {
- if(weapon == CSW_DEAGLE && !random(8))
- damage = float(health);
- }
- if(klasa_igraca[idattacker] == Snajperista)
- {
- if(weapon == CSW_AWP && !random(4))
- damage = float(health);
- if(weapon == CSW_SCOUT && !random(4))
- damage = float(health);
- }
- if(informacije_predmet_igraca[this][0] == 26 && random_num(1, informacije_predmet_igraca[this][1]) == 1)
- {
- SetHamParamEntity(3, this);
- SetHamParamEntity(1, idattacker);
- }
- SetHamParamFloat(4, damage);
- return HAM_IGNORED;
- }
- public Damage(id)
- {
- new attacker = get_user_attacker(id);
- new damage = read_data(2);
- if(!is_user_alive(attacker) || !is_user_connected(attacker) || id == attacker || !klasa_igraca[attacker])
- return PLUGIN_CONTINUE;
- if(informacije_predmet_igraca[attacker][0] == 12 && random_num(1, informacije_predmet_igraca[id][1]) == 1)
- Display_Fade(id,1<<14,1<<14 ,1<<16,255,155,50,230);
- if(get_user_team(id) != get_user_team(attacker))
- {
- while(damage>20)
- {
- damage-=20;
- iskustvo_igraca[attacker]++;
- }
- }
- ProveriNivo(attacker);
- return PLUGIN_CONTINUE;
- }
- public Death()
- {
- new id = read_data(2);
- new attacker = read_data(1);
- if(!is_user_alive(attacker) || !is_user_connected(attacker))
- return PLUGIN_CONTINUE;
- new weapon = get_user_weapon(attacker);
- new energija = get_user_health(attacker);
- if(get_user_team(id) != get_user_team(attacker) && klasa_igraca[attacker])
- {
- new novo_iskustvo = 0;
- novo_iskustvo += iskustvo_za_ubistvo;
- if(klasa_igraca[id] == Rambo && klasa_igraca[attacker] != Rambo)
- novo_iskustvo += iskustvo_za_ubistvo*2;
- if(klasa_igraca[id] == Destroyer && klasa_igraca[attacker] != Destroyer)
- novo_iskustvo += iskustvo_za_ubistvo*2;
- if(informacije_predmet_igraca[attacker][0] == 35)
- {
- novo_iskustvo += iskustvo_za_ubistvo;
- }
- if(informacije_predmet_igraca[id][0] == 35 && informacije_predmet_igraca[attacker][0] != 35)
- novo_iskustvo += iskustvo_za_ubistvo*2;
- if(level_igraca[id] > level_igraca[attacker])
- novo_iskustvo += level_igraca[id] - level_igraca[attacker];
- if(klasa_igraca[attacker] == Rambo || informacije_predmet_igraca[attacker][0] == 15 && maxClip[weapon] != -1)
- {
- new nova_energija = (energija+20<maximalna_energija_igraca[attacker])? energija+20: maximalna_energija_igraca[attacker];
- set_user_health(attacker, nova_energija);
- }
- #if defined BOTY
- if(is_user_bot2(attacker) && random(9) == 0)
- IzbaciPredmet(id);
- #endif
- if(!informacije_predmet_igraca[attacker][0])
- DajPredmet(attacker, random_num(1, sizeof naziv_predmeta-1));
- if(informacije_predmet_igraca[attacker][0] == 14)
- {
- new nova_energija = (energija+50<maximalna_energija_igraca[attacker])? energija+50: maximalna_energija_igraca[attacker];
- set_user_health(attacker, nova_energija);
- }
- set_hudmessage(255, 212, 0, 0.50, 0.33, 1, 6.0, 4.0);
- ShowSyncHudMsg(attacker, SyncHudObj2, "+%i", novo_iskustvo);
- iskustvo_igraca[attacker] += novo_iskustvo;
- }
- ProveriNivo(attacker);
- if((informacije_predmet_igraca[id][0] == 7 && random_num(1, informacije_predmet_igraca[id][1]) == 1) || (klasa_igraca[id] == Pukovnik && random_num(1, 4) == 1))
- set_task(0.1, "Provera", id+ZADATAK_PROVERA);
- return PLUGIN_CONTINUE;
- }
- public client_authorized(id)
- {
- //resetuje vestine
- klasa_igraca[id] = 0;
- level_igraca[id] = 0;
- iskustvo_igraca[id] = 0;
- poeni_igraca[id] = 0;
- energija_igraca[id] = 0;
- inteligencija_igraca[id] = 0;
- snaga_igraca[id] = 0;
- kondicija_igraca[id] = 0;
- maximalna_energija_igraca[id] = 0;
- brzina_igraca[id] = 0.0;
- get_user_authid(id, ID_igraca[id], 34);
- remove_task(id+ZADATAK_POKAZI_INFORMACIJE);
- remove_task(id+ZADATAK_POKAZI_REKLAME);
- remove_task(id+ZADATAK_POSTAVI_brzinu);
- remove_task(id+ZADATAK_PROVERA);
- remove_task(id+ZADATAK_WYSZKOLENIE_SANITARNE);
- set_task(10.0, "PokaziReklame", id+ZADATAK_POKAZI_REKLAME);
- set_task(3.0, "PokaziInformacije", id+ZADATAK_POKAZI_INFORMACIJE);
- //resetuje predmety
- Obrisipredmet(id);
- }
- public client_disconnect(id)
- {
- remove_task(id+ZADATAK_POKAZI_INFORMACIJE);
- remove_task(id+ZADATAK_POKAZI_REKLAME);
- remove_task(id+ZADATAK_POSTAVI_brzinu);
- remove_task(id+ZADATAK_PROVERA);
- remove_task(id+ZADATAK_WYSZKOLENIE_SANITARNE);
- SacuvajPodatke(id);
- Obrisipredmet(id);
- }
- public PrebrojBombe(id)
- if(klasa_igraca[id])
- deaktivirana = id;
- public BombaPostavljena()
- {
- new Players[32], playerCount, id;
- get_players(Players, playerCount, "aeh", "TERRORIST");
- if(get_playersnum() > 1)
- {
- iskustvo_igraca[postavljena] += iskustvo_za_c4;
- for (new i=0; i<playerCount; i++)
- {
- id = Players[i];
- if(!klasa_igraca[id])
- continue;
- if(id != postavljena)
- {
- iskustvo_igraca[id] += iskustvo_za_ubistvo;
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dobio si ^3%i ^1xp zato sto je tvoj tim postavio bombu.", iskustvo_za_ubistvo);
- }
- else
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dobio si ^3%i ^1xp zato sto si postavio bombu.", iskustvo_za_c4);
- }
- ProveriNivo(id);
- }
- }
- }
- public BombaDeaktivirana()
- {
- new Players[32], playerCount, id;
- get_players(Players, playerCount, "aeh", "CT");
- iskustvo_igraca[deaktivirana] += iskustvo_za_c4;
- for (new i=0; i<playerCount; i++)
- {
- id = Players[i];
- if(!klasa_igraca[id])
- continue;
- if(id != deaktivirana)
- {
- iskustvo_igraca[id]+= iskustvo_za_ubistvo;
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dobio si ^3%i ^1xp zato sto je tvoj tim deaktivirao bombu.", iskustvo_za_ubistvo);
- }
- else
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dobio si ^3%i % ^1xp zato sto si deaktivirao bombu.",iskustvo_za_c4);
- ProveriNivo(id);
- }
- }
- public OpisKlase(id)
- {
- new menu = menu_create("Izaberi Klasu:", "OpisKlase_Handle");
- for(new i=1; i<sizeof naziv_klase; i++)
- menu_additem(menu, naziv_klase[i]);
- menu_setprop(menu, MPROP_EXITNAME, "Izlaz");
- menu_setprop(menu, MPROP_BACKNAME, "Prethodna strana");
- menu_setprop(menu, MPROP_NEXTNAME, "Sledeca strana");
- menu_display(id, menu);
- client_cmd(id, "spk QTM_CodMod/select");
- }
- public OpisKlase_Handle(id, menu, item)
- {
- client_cmd(id, "spk QTM_CodMod/select");
- if(item == MENU_EXIT)
- {
- menu_destroy(menu);
- return PLUGIN_CONTINUE;
- }
- ColorChat(id, NORMAL, "^4[COD:MW] ^3%s: %s", naziv_klase[item+1], opis_klase[item+1]);
- menu_display(id, menu);
- return PLUGIN_CONTINUE;
- }
- public IzaberiKlasu(id)
- {
- new menu = menu_create("\rIzaberi Klase:", "IzaberiFrakciju_Handle");
- for(new i = 1;i<sizeof(frakcije);i++)
- {
- menu_additem(menu, frakcije[i]);
- }
- menu_display(id, menu);
- menu_setprop(menu, MPROP_EXITNAME, "Izadji");
- }
- public IzaberiFrakciju_Handle(id, menu2, item)
- {
- if(item == MENU_EXIT)
- {
- menu_destroy(menu2);
- return PLUGIN_CONTINUE;
- }
- item++;
- frakcija_igraca[id] = item;
- new menu = menu_create("\rIzaberi Klase:", "IzaberiKlasu_Handle");
- new klasa[50];
- for(new i=1; i<sizeof naziv_klase; i++)
- {
- if(pripada[i] == item)
- {
- UcitajPodatke(id, i);
- format(klasa, 49, "\y%s \rLevel: %i", naziv_klase[i], level_igraca[id]);
- menu_additem(menu, klasa);
- }
- }
- UcitajPodatke(id, klasa_igraca[id]);
- menu_setprop(menu, MPROP_EXITNAME, "Izadji");
- menu_setprop(menu, MPROP_BACKNAME, "Predhodna Strana");
- menu_setprop(menu, MPROP_NEXTNAME, "Sledeca Strana");
- menu_display(id, menu);
- client_cmd(id, "spk QTM_CodMod/select");
- return PLUGIN_CONTINUE;
- }
- public IzaberiKlasu_Handle(id, menu, item)
- {
- client_cmd(id, "spk QTM_CodMod/select");
- if(item == MENU_EXIT)
- {
- menu_destroy(menu);
- return PLUGIN_CONTINUE;
- }
- item++;
- new ile = 0;
- for(new i=1; i<sizeof naziv_klase; i++)
- {
- if(pripada[i] == frakcija_igraca[id])
- {
- ile++;
- }
- if(ile == item)
- {
- item = i;
- break;
- }
- }
- if(item == klasa_igraca[id])
- return PLUGIN_CONTINUE;
- if(item == Rambo && !(get_user_flags(id) & ADMIN_KICK))
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
- IzaberiKlasu(id);
- return PLUGIN_CONTINUE;
- }
- if(item == Assassin && !(get_user_flags(id) & ADMIN_LEVEL_A))
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
- IzaberiKlasu(id);
- return PLUGIN_CONTINUE;
- }
- if(item == Univerzalni_vojnik && !(get_user_flags(id) & ADMIN_LEVEL_B))
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
- IzaberiKlasu(id);
- return PLUGIN_CONTINUE;
- }
- if(item == Jason_Bourne && !(get_user_flags(id) & ADMIN_LEVEL_C))
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
- IzaberiKlasu(id);
- return PLUGIN_CONTINUE;
- }
- if(item == Joker && !(get_user_flags(id) & ADMIN_LEVEL_D))
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate dozvolu za Premium Klasu.");
- IzaberiKlasu(id);
- return PLUGIN_CONTINUE;
- }
- if(klasa_igraca[id])
- {
- nova_klasa_igraca[id] = item;
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Klasa ce biti izmenjena u sledecoj rundi.");
- }
- else
- {
- klasa_igraca[id] = item;
- UcitajPodatke(id, klasa_igraca[id]);
- Pocetak(id);
- }
- return PLUGIN_CONTINUE;
- }
- public DodelaPoena(id)
- {
- new inteligencija[65];
- new energija[60];
- new snaga[60];
- new kondicija[60];
- new naslov[25];
- format(inteligencija, 64, "Inteligencija: \r%i \y(Povecava napad)", inteligencija_igraca[id]);
- format(energija, 59, "Energija: \r%i \y(Povecaca energiju)", energija_igraca[id]);
- format(snaga, 59, "Snaga: \r%i \y(Smanjuje povrede)", snaga_igraca[id]);
- format(kondicija, 59, "Kondicija: \r%i \y(Povecava tempo hodanja)", kondicija_igraca[id]);
- format(naslov, 24, "Dodeli poena(%i):", poeni_igraca[id]);
- new menu = menu_create(naslov, "DodelaPoena_Handler");
- menu_additem(menu, inteligencija);
- menu_additem(menu, energija);
- menu_additem(menu, snaga);
- menu_additem(menu, kondicija);
- menu_display(id, menu);
- #if defined BOTY
- if(is_user_bot2(id))
- DodelaPoena_Handler(id, menu, random(4));
- #endif
- }
- public DodelaPoena_Handler(id, menu, item)
- {
- client_cmd(id, "spk QTM_CodMod/select");
- if(item == MENU_EXIT)
- {
- menu_destroy(menu);
- return PLUGIN_CONTINUE;
- }
- switch(item)
- {
- case 0:
- {
- if(inteligencija_igraca[id]<500)
- inteligencija_igraca[id]++;
- else
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo inteligencije");
- }
- case 1:
- {
- if(energija_igraca[id]<1000)
- energija_igraca[id]++;
- else
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo energije");
- }
- case 2:
- {
- if(snaga_igraca[id]<1000)
- snaga_igraca[id]++;
- else
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo snage");
- }
- case 3:
- {
- if(kondicija_igraca[id]<500)
- kondicija_igraca[id]++;
- else
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dostigli ste maximalni nivo kondicije");
- }
- }
- poeni_igraca[id]--;
- if(poeni_igraca[id]>0)
- DodelaPoena(id);
- return PLUGIN_CONTINUE;
- }
- public ResetujPoene(id)
- {
- poeni_igraca[id] = level_igraca[id]*2-2;
- inteligencija_igraca[id] = 0;
- energija_igraca[id] = 0;
- kondicija_igraca[id] = 0;
- snaga_igraca[id] = 0;
- }
- public KomandaResetujPoene(id)
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Vestine ce biti resetovane u sledecoj rundi");
- client_cmd(id, "spk QTM_CodMod/select");
- igrac_resetuje[id] = true;
- }
- public WyszkolenieSanitarne(id)
- {
- id -= ZADATAK_WYSZKOLENIE_SANITARNE;
- if(informacije_predmet_igraca[id][0] != 16)
- return PLUGIN_CONTINUE;
- set_task(5.0, "WyszkolenieSanitarne", id+ZADATAK_WYSZKOLENIE_SANITARNE);
- if(!is_user_alive(id))
- return PLUGIN_CONTINUE;
- new health = get_user_health(id);
- new new_health = (health+10<maximalna_energija_igraca[id])?health+10:maximalna_energija_igraca[id];
- set_user_health(id, new_health);
- return PLUGIN_CONTINUE;
- }
- public KreirajMedKit(id)
- {
- if (!broj_medkit_igraca[id])
- {
- client_print(id, print_center, "Imate samo 2 paketa za prvu pomoc u jednoj rundi!");
- return PLUGIN_CONTINUE;
- }
- if(inteligencija_igraca[id] < 1)
- client_print(id, print_center, "Da koristite paket za prvu pomoc, morate povecati inteligenciju");
- broj_medkit_igraca[id]--;
- new Float:origin[3];
- entity_get_vector(id, EV_VEC_origin, origin);
- new ent = create_entity("info_target");
- entity_set_string(ent, EV_SZ_classname, "MedKit");
- entity_set_edict(ent, EV_ENT_owner, id);
- entity_set_int(ent, EV_INT_solid, SOLID_NOT);
- entity_set_vector(ent, EV_VEC_origin, origin);
- entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
- entity_set_model(ent, "models/w_medkit.mdl");
- set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) ;
- drop_to_floor(ent);
- entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
- return PLUGIN_CONTINUE;
- }
- public MedKitThink(ent)
- {
- new id = entity_get_edict(ent, EV_ENT_owner);
- new totem_dist = 300;
- new totem_heal = 5+floatround(inteligencija_igraca[id]*0.5);
- if (entity_get_edict(ent, EV_ENT_euser2) == 1)
- {
- new Float:forigin[3], origin[3];
- entity_get_vector(ent, EV_VEC_origin, forigin);
- FVecIVec(forigin,origin);
- new entlist[33];
- new numfound = find_sphere_class(0,"player",totem_dist+0.0,entlist, 32,forigin);
- for (new i=0; i < numfound; i++)
- {
- new pid = entlist[i];
- if (get_user_team(pid) != get_user_team(id))
- continue;
- new energija = get_user_health(pid);
- new nova_energija = (energija+totem_heal<maximalna_energija_igraca[pid])?energija+totem_heal:maximalna_energija_igraca[pid];
- if (is_user_alive(pid)) set_user_health(pid, nova_energija);
- }
- entity_set_edict(ent, EV_ENT_euser2, 0);
- entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5);
- return PLUGIN_CONTINUE;
- }
- if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
- {
- remove_entity(ent);
- return PLUGIN_CONTINUE;
- }
- if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
- set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ) ;
- new Float:forigin[3], origin[3];
- entity_get_vector(ent, EV_VEC_origin, forigin);
- FVecIVec(forigin,origin);
- //Find people near and give them health
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
- write_byte( TE_BEAMCYLINDER );
- write_coord( origin[0] );
- write_coord( origin[1] );
- write_coord( origin[2] );
- write_coord( origin[0] );
- write_coord( origin[1] + totem_dist );
- write_coord( origin[2] + totem_dist );
- write_short( sprite_white );
- write_byte( 0 ); // startframe
- write_byte( 0 ); // framerate
- write_byte( 10 ); // life
- write_byte( 10 ); // width
- write_byte( 255 ); // noise
- write_byte( 255 ); // r, g, b
- write_byte( 100 );// r, g, b
- write_byte( 100 ); // r, g, b
- write_byte( 128 ); // brightness
- write_byte( 5 ); // speed
- message_end();
- entity_set_edict(ent, EV_ENT_euser2 ,1);
- entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
- return PLUGIN_CONTINUE;
- }
- public KreirajRakete(id)
- {
- if (!broj_raketa_igraca[id])
- {
- client_print(id, print_center, "Vec ste iskoristili sve rakete!");
- return PLUGIN_CONTINUE;
- }
- if(prethodna_raketa_igraca[id] + 2.0 > get_gametime())
- {
- client_print(id, print_center, "Mozate da koristite raketu za 2 sekunde!");
- return PLUGIN_CONTINUE;
- }
- if (is_user_alive(id))
- {
- if(inteligencija_igraca[id] < 1)
- client_print(id, print_center, "Da koristite rakete, morate povecati inteligenciju!");
- prethodna_raketa_igraca[id] = get_gametime();
- broj_raketa_igraca[id]--;
- new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
- entity_get_vector(id, EV_VEC_v_angle, vAngle);
- entity_get_vector(id, EV_VEC_origin , Origin);
- new Ent = create_entity("info_target");
- entity_set_string(Ent, EV_SZ_classname, "Rocket");
- entity_set_model(Ent, "models/rpgrocket.mdl");
- vAngle[0] *= -1.0;
- entity_set_origin(Ent, Origin);
- entity_set_vector(Ent, EV_VEC_angles, vAngle);
- entity_set_int(Ent, EV_INT_effects, 2);
- entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
- entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
- entity_set_edict(Ent, EV_ENT_owner, id);
- VelocityByAim(id, 1000 , Velocity);
- entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
- }
- return PLUGIN_CONTINUE;
- }
- public KreirajDinamit(id)
- {
- if(!broj_dinamita_igraca[id])
- {
- client_print(id, print_center, "Vec ste iskoristili sav dinamit!");
- return PLUGIN_CONTINUE;
- }
- if(inteligencija_igraca[id] < 1)
- client_print(id, print_center, "Da koristite dinamit, morate povecati inteligenciju!");
- broj_dinamita_igraca[id]--;
- new Float:fOrigin[3], iOrigin[3];
- entity_get_vector( id, EV_VEC_origin, fOrigin);
- iOrigin[0] = floatround(fOrigin[0]);
- iOrigin[1] = floatround(fOrigin[1]);
- iOrigin[2] = floatround(fOrigin[2]);
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
- write_byte(TE_EXPLOSION);
- write_coord(iOrigin[0]);
- write_coord(iOrigin[1]);
- write_coord(iOrigin[2]);
- write_short(sprite_blast);
- write_byte(32);
- write_byte(20);
- write_byte(0);
- message_end();
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
- write_byte( TE_BEAMCYLINDER );
- write_coord( iOrigin[0] );
- write_coord( iOrigin[1] );
- write_coord( iOrigin[2] );
- write_coord( iOrigin[0] );
- write_coord( iOrigin[1] + 300 );
- write_coord( iOrigin[2] + 300 );
- write_short( sprite_white );
- write_byte( 0 ); // startframe
- write_byte( 0 ); // framerate
- write_byte( 10 ); // life
- write_byte( 10 ); // width
- write_byte( 255 ); // noise
- write_byte( 255 ); // r, g, b
- write_byte( 100 );// r, g, b
- write_byte( 100 ); // r, g, b
- write_byte( 128 ); // brightness
- write_byte( 8 ); // speed
- message_end();
- new entlist[33];
- new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
- for (new i=0; i < numfound; i++)
- {
- new pid = entlist[i];
- if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24)
- continue;
- ExecuteHam(Ham_TakeDamage, pid, 0, id, 90.0+float(inteligencija_igraca[id]) , 1);
- }
- return PLUGIN_CONTINUE;
- }
- public PostaviMine(id)
- {
- if (!broj_min_igraca[id])
- {
- client_print(id, print_center, "Vec ste iskoristili sve mine!");
- return PLUGIN_CONTINUE;
- }
- if(inteligencija_igraca[id] < 1)
- client_print(id, print_center, "Da koristite mine, morate povecati inteligenciju!");
- broj_min_igraca[id]--;
- new Float:origin[3];
- entity_get_vector(id, EV_VEC_origin, origin);
- new ent = create_entity("info_target");
- entity_set_string(ent ,EV_SZ_classname, "Mine");
- entity_set_edict(ent ,EV_ENT_owner, id);
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);
- entity_set_origin(ent, origin);
- entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
- entity_set_model(ent, "models/mine.mdl");
- entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});
- drop_to_floor(ent);
- entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
- set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,50) ;
- return PLUGIN_CONTINUE;
- }
- public DodirMine(ent, id)
- {
- new attacker = entity_get_edict(ent, EV_ENT_owner);
- if (get_user_team(attacker) != get_user_team(id))
- {
- new Float:fOrigin[3], iOrigin[3];
- entity_get_vector( ent, EV_VEC_origin, fOrigin);
- iOrigin[0] = floatround(fOrigin[0]);
- iOrigin[1] = floatround(fOrigin[1]);
- iOrigin[2] = floatround(fOrigin[2]);
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
- write_byte(TE_EXPLOSION);
- write_coord(iOrigin[0]);
- write_coord(iOrigin[1]);
- write_coord(iOrigin[2]);
- write_short(sprite_blast);
- write_byte(32); // scale
- write_byte(20); // framerate
- write_byte(0);// flags
- message_end();
- new entlist[33];
- new numfound = find_sphere_class(ent,"player", 90.0 ,entlist, 32);
- for (new i=0; i < numfound; i++)
- {
- new pid = entlist[i];
- if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24 || klasa_igraca[id] == Branilac)
- continue;
- ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 90.0+float(inteligencija_igraca[attacker]) , 1);
- }
- remove_entity(ent);
- }
- }
- public DodirRakete(ent)
- {
- if ( !is_valid_ent(ent))
- return;
- new attacker = entity_get_edict(ent, EV_ENT_owner);
- new Float:fOrigin[3], iOrigin[3];
- entity_get_vector( ent, EV_VEC_origin, fOrigin);
- iOrigin[0] = floatround(fOrigin[0]);
- iOrigin[1] = floatround(fOrigin[1]);
- iOrigin[2] = floatround(fOrigin[2]);
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
- write_byte(TE_EXPLOSION);
- write_coord(iOrigin[0]);
- write_coord(iOrigin[1]);
- write_coord(iOrigin[2]);
- write_short(sprite_blast);
- write_byte(32); // scale
- write_byte(20); // framerate
- write_byte(0);// flags
- message_end();
- new entlist[33];
- new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32);
- for (new i=0; i < numfound; i++)
- {
- new pid = entlist[i];
- if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24)
- continue;
- ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0+float(inteligencija_igraca[attacker]) , 1);
- }
- remove_entity(ent);
- }
- public CurWeapon(id)
- {
- if(freezetime || !klasa_igraca[id])
- return PLUGIN_CONTINUE;
- new weapon = read_data(2);
- if(klasa_igraca[id] == Assassin && weapon == CSW_KNIFE)
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 10);
- else if(klasa_igraca[id] == Assassin && weapon != CSW_KNIFE)
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255);
- if(informacije_predmet_igraca[id][0] == 33 && weapon == CSW_KNIFE)
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 10);
- else if(informacije_predmet_igraca[id][0] == 33 && weapon != CSW_KNIFE)
- set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255);
- if(informacije_predmet_igraca[id][0] == 32 && maxClip[weapon] != -1)
- set_user_clip(id, maxClip[weapon]);
- PostaviBrzinu(id);
- if(weapon == CSW_C4)
- postavljena = id;
- return PLUGIN_CONTINUE;
- }
- public EmitSound(id, iChannel, szSound[], Float:fVol, Float:fAttn, iFlags, iPitch )
- {
- if(equal(szSound, "common/wpn_denyselect.wav"))
- {
- KoristiPredmet(id);
- return FMRES_SUPERCEDE;
- }
- return FMRES_IGNORED;
- }
- public cmdCheckSay(id)
- {
- static message[192]
- read_args(message, 191)
- if(contain(message, "%") != -1)
- {
- remove_quotes(message)
- }
- return PLUGIN_CONTINUE;
- }
- public KoristiPredmet(id)
- {
- if((informacije_predmet_igraca[id][0] == 19 && informacije_predmet_igraca[id][1]>0) || (klasa_igraca[id] == Univerzalni_vojnik))
- {
- set_user_health(id, maximalna_energija_igraca[id]);
- informacije_predmet_igraca[id][1]--;
- }
- if(broj_medkit_igraca[id]>0)
- KreirajMedKit(id);
- if(broj_raketa_igraca[id]>0)
- KreirajRakete(id);
- if(broj_min_igraca[id]>0)
- PostaviMine(id);
- if(broj_dinamita_igraca[id]>0)
- KreirajDinamit(id);
- return PLUGIN_HANDLED;
- }
- public SacuvajPodatke(id)
- {
- new vaultkey[64],vaultdata[256];
- format(vaultkey,63,"%s-%i-cod", ID_igraca[id], klasa_igraca[id]);
- format(vaultdata,255,"%i#%i#%i#%i#%i#%i", iskustvo_igraca[id], level_igraca[id], inteligencija_igraca[id], energija_igraca[id], snaga_igraca[id], kondicija_igraca[id]);
- nvault_set(g_vault,vaultkey,vaultdata);
- }
- public UcitajPodatke(id, klasa)
- {
- new vaultkey[64],vaultdata[256];
- format(vaultkey,63,"%s-%i-cod", ID_igraca[id], klasa);
- format(vaultdata,255,"%i#%i#%i#%i#%i#%i", iskustvo_igraca[id], level_igraca[id], inteligencija_igraca[id], energija_igraca[id], snaga_igraca[id], kondicija_igraca[id]);
- nvault_get(g_vault,vaultkey,vaultdata,255);
- replace_all(vaultdata, 255, "#", " ");
- new iskustvoigraca[32], leveligraca[32], inteligencijaigraca[32], energijaigraca[32], snagacigraca[32], kondicijaigraca[32];
- parse(vaultdata, iskustvoigraca, 31, leveligraca, 31, inteligencijaigraca, 31, energijaigraca, 31, snagacigraca, 31, kondicijaigraca, 31);
- iskustvo_igraca[id] = str_to_num(iskustvoigraca);
- level_igraca[id] = str_to_num(leveligraca)>0?str_to_num(leveligraca):1;
- inteligencija_igraca[id] = str_to_num(inteligencijaigraca);
- energija_igraca[id] = str_to_num(energijaigraca);
- snaga_igraca[id] = str_to_num(snagacigraca);
- kondicija_igraca[id] = str_to_num(kondicijaigraca);
- poeni_igraca[id] = (level_igraca[id]-1)*2-inteligencija_igraca[id]-energija_igraca[id]-snaga_igraca[id]-kondicija_igraca[id];
- }
- public IzbaciPredmet(id)
- {
- if(informacije_predmet_igraca[id][0])
- {
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Bacio si ^3%s.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
- Obrisipredmet(id);
- }
- else
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Nemate nijedan predmet.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
- }
- public Obrisipredmet(id)
- {
- informacije_predmet_igraca[id][0] = 0;
- informacije_predmet_igraca[id][1] = 0;
- if(is_user_alive(id))
- set_user_footsteps(id, 0);
- set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
- PromeniModel(id, 1);
- }
- public DajPredmet(id, predmet)
- {
- Obrisipredmet(id);
- informacije_predmet_igraca[id][0] = predmet;
- ColorChat(id, NORMAL, "^4[COD:MW] ^1Dobio si ^3%s.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
- switch(predmet)
- {
- case 1:
- {
- set_user_footsteps(id, 1);
- }
- case 2:
- {
- informacije_predmet_igraca[id][1] = random_num(3,6);
- }
- case 3:
- {
- informacije_predmet_igraca[id][1] = random_num(6, 11);
- }
- case 5:
- {
- informacije_predmet_igraca[id][1] = random_num(6, 9);
- }
- case 6:
- {
- informacije_predmet_igraca[id][1] = random_num(100, 150);
- set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, informacije_predmet_igraca[id][1]);
- }
- case 7:
- {
- informacije_predmet_igraca[id][1] = random_num(2, 4);
- }
- case 8:
- {
- if(klasa_igraca[id] == Marinac)
- DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
- }
- case 9:
- {
- informacije_predmet_igraca[id][1] = random_num(1, 3);
- PromeniModel(id, 0);
- give_item(id, "weapon_hegrenade");
- }
- case 10:
- {
- informacije_predmet_igraca[id][1] = random_num(4, 8);
- give_item(id, "weapon_hegrenade");
- }
- case 12:
- {
- informacije_predmet_igraca[id][1] = random_num(1, 4);
- }
- case 13:
- {
- give_item(id, "weapon_awp");
- }
- case 15:
- {
- if(klasa_igraca[id] == Rambo)
- DajPredmet(id, random_num(1, sizeof naziv_predmeta-1));
- }
- case 16:
- {
- set_task(5.0, "WyszkolenieSanitarne", id+ZADATAK_WYSZKOLENIE_SANITARNE);
- }
- case 19:
- {
- informacije_predmet_igraca[id][1] = 1;
- }
- case 26:
- {
- informacije_predmet_igraca[id][1] = random_num(3, 6);
- }
- case 27:
- {
- informacije_predmet_igraca[id][1] = 3;
- }
- case 30:
- {
- give_item(id, "weapon_scout");
- }
- case 36:
- {
- give_item(id, "weapon_m4a1");
- give_item(id, "weapon_awp");
- }
- }
- }
- public OpisPredmeta(id)
- {
- new opis_predmeta[128];
- new slucajne_vrednosti[3];
- num_to_str(informacije_predmet_igraca[id][1], slucajne_vrednosti, 2);
- format(opis_predmeta, 127, opis_predmet[informacije_predmet_igraca[id][0]]);
- replace_all(opis_predmeta, 127, "LW", slucajne_vrednosti);
- ColorChat(id, NORMAL, "^4Predmet: ^1%s.", naziv_predmeta[informacije_predmet_igraca[id][0]]);
- ColorChat(id, NORMAL, "^4Opis: ^1%s.", opis_predmeta);
- }
- public Proveri(id)
- {
- id-=ZADATAK_PROVERA;
- ExecuteHamB(Ham_CS_RoundRespawn, id);
- }
- public ProveriNivo(id)
- {
- if(level_igraca[id] < 201)
- {
- while(iskustvo_igraca[id] >= iskustvo_levelu[level_igraca[id]])
- {
- level_igraca[id]++;
- set_hudmessage(60, 200, 25, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.2, 2);
- ShowSyncHudMsg(id, SyncHudObj3, "Dobrodosao na sledeci nivo!");
- client_cmd(id, "spk QTM_CodMod/levelup");
- }
- poeni_igraca[id] = (level_igraca[id]-1)*2-inteligencija_igraca[id]-energija_igraca[id]-snaga_igraca[id]-kondicija_igraca[id];
- }
- SacuvajPodatke(id);
- }
- public PokaziInformacije(id)
- {
- id -= ZADATAK_POKAZI_INFORMACIJE;
- set_task(0.1, "PokaziInformacije", id+ZADATAK_POKAZI_INFORMACIJE);
- if(!is_user_alive(id))
- {
- new target = entity_get_int(id, EV_INT_iuser2);
- if(target == 0 || !is_user_connected(target))
- return PLUGIN_CONTINUE;
- set_hudmessage(255, 255, 255, 0.6, -1.0, 0, 0.0, 0.3, 0.0, 0.0, 2);
- ShowSyncHudMsg(id, SyncHudObj, "[Klasa : %s]^n[Iskustvo : %i / %i]^n[Level : %i]^n[Predmet : %s]^n[HP : %i]", 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));
- return PLUGIN_CONTINUE;
- }
- set_hudmessage(0, 255, 0, 0.02, 0.23, 0, 0.0, 0.3, 0.0, 0.0);
- ShowSyncHudMsg(id, SyncHudObj, "[Klasa : %s]^n[Iskustvo : %i / %i]^n[Level : %i]^n[Predmet : %s]^n[HP : %i]", 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));
- return PLUGIN_CONTINUE;
- }
- public PokaziReklame(id)
- {
- id-=ZADATAK_POKAZI_REKLAME;
- ColorChat(id, NORMAL, "^4[COD:MW] ^3Dobrodosli u COD:MW MOD by QTM_Peyote.");
- id-=ZADATAK_POKAZI_REKLAME;
- ColorChat(id, NORMAL, "^4[COD:MW] ^3EDITED by Nightime.");
- }
- public PostaviBrzinu(id)
- {
- id -= id>32? ZADATAK_POSTAVI_brzinu: 0;
- if(klasa_igraca[id])
- set_user_maxspeed(id, brzina_igraca[id]);
- }
- public PromeniModel(id,reset)
- {
- if (id<1 || id>32 || !is_user_connected(id))
- return PLUGIN_CONTINUE;
- if (reset)
- cs_reset_user_model(id);
- else
- {
- new num = random_num(0,3);
- switch(get_user_team(id))
- {
- case 1: cs_set_user_model(id, Ubrania_CT[num]);
- case 2:cs_set_user_model(id, Ubrania_Terro[num]);
- }
- }
- return PLUGIN_CONTINUE;
- }
- public Pomoc()
- {
- switch(random(7))
- {
- case 0: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da resetujes level-e kucaj ^3/reset.");
- case 1: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da promenis klasu kucaj ^3/klasa.");
- case 2: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da koristis predmete(mine,rakete) stisni ^3E.");
- case 3: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da bi ste izbacili predmet kucajte ^3/izbaci.");
- case 4: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da bi ste videli opis predmeta kucajte ^3/predmet.");
- case 5: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da biste videli opis klase kucajte ^3/opis.");
- case 6: ColorChat(0, NORMAL, "^4[COD:MW] ^1Da otvorite COD Shop kucajte ^3/shop.");
- }
- set_task(36.0, "Pomoc");
- }
- /*public cmd_setlvl(id, level, cid)
- {
- if(!cmd_access(id,level,cid,3))
- return PLUGIN_HANDLED;
- new arg1[33];
- new arg2[6];
- read_argv(1, arg1, 32);
- read_argv(2, arg2, 5);
- new player = cmd_target(id, arg1);
- new value = str_to_num(arg2)-1;
- iskustvo_igraca[player] = iskustvo_levelu[value];
- level_igraca[player] = 0;
- ProveriNivo(player);
- return PLUGIN_HANDLED;
- }*/
- public DodirOruzija(weapon,id)
- {
- new model[23];
- entity_get_string(weapon, EV_SZ_model, model, 22);
- if (!is_user_connected(id) || entity_get_edict(weapon, EV_ENT_owner) == id || equal(model, "models/w_backpack.mdl"))
- return HAM_IGNORED;
- return HAM_SUPERCEDE;
- }
- public BlokirajKomande()
- {
- return PLUGIN_HANDLED;
- }
- public plugin_end()
- {
- nvault_close( g_vault )
- }
- stock bool:UTIL_In_FOV(id,target)
- {
- if (Find_Angle(id,target,9999.9) > 0.0)
- return true;
- return false;
- }
- #if defined BOTY
- public is_user_bot2(id)
- {
- new ping, loss
- get_user_ping(id, ping, loss)
- if(ping > 0 && loss > 0)
- return false
- return true
- }
- #endif
- stock Float:Find_Angle(Core,Target,Float:dist)
- {
- new Float:vec2LOS[2];
- new Float:flDot;
- new Float:CoreOrigin[3];
- new Float:TargetOrigin[3];
- new Float:CoreAngles[3];
- pev(Core,pev_origin,CoreOrigin);
- pev(Target,pev_origin,TargetOrigin);
- if (get_distance_f(CoreOrigin,TargetOrigin) > dist)
- return 0.0;
- pev(Core,pev_angles, CoreAngles);
- for ( new i = 0; i < 2; i++ )
- vec2LOS[i] = TargetOrigin[i] - CoreOrigin[i];
- new Float:veclength = Vec2DLength(vec2LOS);
- //Normalize V2LOS
- if (veclength <= 0.0)
- {
- vec2LOS[0] = 0.0;
- vec2LOS[1] = 0.0;
- }
- else
- {
- new Float:flLen = 1.0 / veclength;
- vec2LOS[0] = vec2LOS[0]*flLen;
- vec2LOS[1] = vec2LOS[1]*flLen;
- }
- //Do a makevector to make v_forward right
- engfunc(EngFunc_MakeVectors,CoreAngles);
- new Float:v_forward[3];
- new Float:v_forward2D[2];
- get_global_vector(GL_v_forward, v_forward);
- v_forward2D[0] = v_forward[0];
- v_forward2D[1] = v_forward[1];
- flDot = vec2LOS[0]*v_forward2D[0]+vec2LOS[1]*v_forward2D[1];
- if ( flDot > 0.5 )
- {
- return flDot;
- }
- return 0.0;
- }
- stock Float:Vec2DLength( Float:Vec[2] )
- {
- return floatsqroot(Vec[0]*Vec[0] + Vec[1]*Vec[1] );
- }
- stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha)
- {
- message_begin( MSG_ONE, g_msg_screenfade,{0,0,0},id );
- write_short( duration ); // Duration of fadeout
- write_short( holdtime ); // Hold time of color
- write_short( fadetype ); // Fade type
- write_byte ( red ); // Red
- write_byte ( green ); // Green
- write_byte ( blue ); // Blue
- write_byte ( alpha ); // Alpha
- message_end();
- }
- stock set_user_clip(id, ammo)
- {
- new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
- get_weaponname(weapon, weaponname, 31);
- while ((weaponid = find_ent_by_class(weaponid, weaponname)) != 0)
- if(entity_get_edict(weaponid, EV_ENT_owner) == id)
- {
- set_pdata_int(weaponid, 51, ammo, 4);
- return weaponid;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement