SHARE
TWEET

Untitled

a guest Jul 18th, 2017 136 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <fakemeta>
  6. #include <engine>
  7. #include <hamsandwich>
  8. #include <nvault>
  9.  
  10.  
  11. #define PLUGIN "Call of Duty: MW Mod"
  12. #define VERSION "1.0"
  13. #define AUTHOR "QTM_Peyote,johnC,GranTorino"
  14.  
  15. #define STANDARD_FAST 250.0
  16.  
  17. #define TASK_SHOW_INFORMATION 672
  18. #define TASK_RAISE 704
  19. #define TASK_TRAINING_SANITARY 736
  20. #define TASK_SHOW_ADVERTISEMENT 768
  21. #define TASK_SET_FAST 832
  22.  
  23.  
  24. //#define BOT 1
  25.  
  26. new SyncHudObj;
  27. new SyncHudObj2;
  28. new SyncHudObj3;
  29. new g_msg_screenfade;
  30.  
  31. new sprite_white;
  32. new sprite_blast;
  33.  
  34. new g_vault;
  35.  
  36. new podkladajacy;
  37. new disarming;
  38.  
  39. new experience_for_murder;
  40. new experience_for_bomb;
  41.  
  42. new Clothing_CT[4][]={"sas","gsg9","urban","gign"};
  43. new Clothing_Terro[4][]={"arctic","leet","guerilla","terror"};
  44.  
  45. 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};
  46. new const maxClip[31] = { -1, 13, -1, 10,  1,  7,  1,  30, 30,  1,  30,  20,  25, 30, 35, 25,  12,  20,
  47. 10,  30, 100,  8, 30,  30, 20,  2,  7, 30, 30, -1,  50 };
  48.  
  49. new information_item_player[33][2];
  50. new const names_objects[][] =
  51. {
  52.     "None",
  53.     "Assault Boots", //1
  54.     "Double Vest", //2
  55.     "Reinforced Vest", //3
  56.     "Veteran Knife", //4
  57.     "Surprise Enemy", //5
  58.     "Ninja Cloak", //6
  59.     "Morphine", //7
  60.     "Commando Knife", //8
  61.     "Spy Glasses",
  62.     "Mystery Grenade",
  63.     "Ninja Feet", //11
  64.     "Secret Military", //12
  65.     "AWP Sniper",//13
  66.     "Adrenaline",//14
  67.     "Mystery Rambo",//15
  68.     "Training Sanitary",//16
  69.     "NASA Vest",//17
  70.     "Trained Veteran",//18
  71.     "First Aid Kit",//19
  72.     "Recoil Eliminator",//20
  73.     "Titanium Cartridges",//21
  74.     "Colonel Cartridges",//22
  75.     "Recoil Limiter",//23
  76.     "SWAT Shield",//24
  77.     "Trained Recruit",//25
  78.     "Relective Armour",//26
  79.     "Captain's Notes",//27
  80.     "Jet Module"
  81.    
  82. };
  83.  
  84. new const descriptions_objects[][] = {"Kill someone to get an item",
  85.     "Run silently",
  86.     "Reduces damage taken",
  87.     "Reduces damage taken",
  88.     "Knife hit are stronger",
  89.     "When you hit someone from behind, injuries are 2x stronger",
  90.     "Makes you partly invisible",
  91.     "1/3 chance to respawn when killed",
  92.     "Instant kill with a knife",
  93.     "You got 1/3 chance to instant kill with HE. You look like enemy",
  94.     "Instant kill people with HE grenades",
  95.     "You can do a double jump in the air",
  96.     "Your injuries are reduced by 1/3. You have a 1/3 chance of blinding an enemy",
  97.     "Instant kill with AWP",
  98.     "For every frag, you'll get +50 HP",
  99.     "For every frag, you'll get full clip and +20 HP",
  100.     "Recieve 10hp every 3 seconds",
  101.     "+500 Armour",
  102.     "You get 100 HP every round,run slower",
  103.     "Press E to gain HP",
  104.     "No recoil",
  105.     "+15 Damage",
  106.     "+25 Damage",
  107.     "Your recoil is lower",
  108.     "No items work against you.",
  109.     "You'll get +50 HP every round and you're running slower",
  110.     "1/3 chance to reflex your damage",
  111.     "You are resistant to three shots in each round",
  112.     "Press CTRL and SPACE to use the module, the module loads every 4 seconds"
  113. };
  114.  
  115. new g_szAuthID[33][34];
  116. new class_player[33];
  117. new level_player[33] = 1;
  118. new experience_player[33];
  119.  
  120. new nowa_class_player[33];
  121.  
  122. new const experience_level[] =
  123. {
  124.     0,35,140,315,560,875,1260,1715,2240,2835,3500,4235,5040,5915,6860,7875,8960,10115,11340,12635,14000,15435,16940,18515,20160,21875,23660,25515,27440,29435,31500,33635,35840,38115,40460,42875,45360,47915,50540,53235,56000,58835,61740,64715,67760,70875,
  125.     74060,77315,80640,84035,87500,91035,94640,98315,102060,105875,109760,113715,117740,121835,126000,130235,134540,138915,143360,147875,152460,157115,161840,166635,171500,176435,181440,186515,191660,196875,202160,207515,212940,218435,224000,229635,235340,241115,246960,252875,258860,
  126.     264915,271040,277235,283500,289835,296240,302715,309260,315875,322560,329315,336140,343035,350000,357035,364140
  127. };
  128.  
  129. new punkty_player[33];
  130. new zdrowie_player[33];
  131. new inteligencja_player[33];
  132. new wytrzymalosc_player[33];
  133. new Float:redukcja_obrazen_player[33];
  134. new kondycja_player[33];
  135. new maksymalne_zdrowie_player[33];
  136. new Float:fast_player[33];
  137.  
  138. new bool:gracz_resetuje[33];
  139.  
  140. enum { NONE = 0, Sniper, Commando, Sharpshooter, Protector, Medic, FireSupport, Sapper, Demolitions, Rusher, Rambo };
  141. new const zdrowie_klasy[] = { 0, 120, 130, 110, 250, 150, 100, 100, 130, 100, 130};
  142. new const Float:fast_klasy[] = {0.0, 1.2, 1.35, 0.8, 0.8, 1.0, 1.0, 1.0, 1.0, 1.45 , 1.15};
  143. new const pancerz_klasy[] = { 0, 100, 100, 100, 200, 100, 0, 100, 100, 0, 150};
  144. new const names_klas[][] = {"None",
  145.     "Sniper",
  146.     "Commando",
  147.     "Sharpshooter",
  148.     "Protector",
  149.     "Medic",
  150.     "Fire Support",
  151.     "Sapper",
  152.     "Demolitions",
  153.     "Rusher",
  154.     "Rambo"
  155. };
  156.  
  157. new const descriptions_klas[][] = {"None",
  158.     "Recieves AWP, Deagle & Scout, 120hp. 1/3 chance of instant knife kill. 110 Speed, 100 Amour.",
  159.     "Recieves Deagle, 130hp. Instand knife kills (right click only), 135 Speed, 100 Armour",
  160.     "Recieves AK47, M4A1 & 110hp. 80 Speed, 100 Armour",
  161.     "Recieves M249, 250hp & All grenades, Immune to mines, 200 Armour",
  162.     "Recieves UMP45, 150hp. First Aid Kit, 100 Armour",
  163.     "Recieves MP5, 100 hp, Two rockets, Extra hit points per hit",
  164.     "Recieves P90, 100hp, Gets 3 mines, 100 Armour",
  165.     "Recieves AUG, 130 hp, All grenades, Gets dynamite which does spreaded damage, 100 Armour",
  166.     "Recieves M3, 100 hp, 145 Speed",
  167.     "Recieves Famas, 130 hp, 120 Speed, 20 HP per kill, Double jump, 100 Armour"
  168. };
  169.  
  170. new ilosc_apteczek_player[33];
  171. new ilosc_rakiet_player[33];
  172. new Float:poprzednia_rakieta_player[33];
  173. new ilosc_min_player[33];
  174. new ilosc_dynamitow_player[33];
  175. new ilosc_skokow_player[33];
  176.  
  177. new bool:freezetime = true;
  178.  
  179. public plugin_init()
  180. {
  181.     register_plugin(PLUGIN, VERSION, AUTHOR);
  182.    
  183.     g_vault = nvault_open("CodMod");
  184.    
  185.     register_think("FirstAidKit","FirstAidKitThink");
  186.    
  187.     RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
  188.     RegisterHam(Ham_Spawn, "player", "Odrodzenie", 1);
  189.  
  190.    
  191.     register_forward(FM_CmdStart, "CmdStart");
  192.     register_forward(FM_EmitSound, "EmitSound");
  193.    
  194.     register_logevent("PoczatekRundy", 2, "1=Round_Start");
  195.     register_logevent("BombaPodlozona", 3, "2=Planted_The_Bomb");
  196.    
  197.     register_event("SendAudio", "BombaRozbrojona", "a", "2&%!MRAD_BOMBDEF");
  198.     register_event("BarTime", "RozbrajaBomb", "be", "1=10", "1=5");
  199.     register_event("DeathMsg", "Death", "ade");
  200.     register_event("Damage", "Damage", "b", "2!=0");
  201.     register_event("CurWeapon","CurWeapon","be", "1=1");
  202.     register_event("HLTV", "NowaRunda", "a", "1=0", "2=0");
  203.    
  204.     register_touch("Rocket", "*" , "DotykRakiety");
  205.     register_touch("Mine", "player",  "DotykMiny");
  206.    
  207.     register_cvar("cod_killxp", "50");
  208.     register_cvar("cod_bombxp", "100");
  209.    
  210.     register_clcmd("say /class", "WybierzKlase");
  211.     register_clcmd("say /classinfo", "DescriptionKlasy");
  212.     register_clcmd("say /item", "DescriptionItem");
  213.     register_clcmd("say /drop", "WyrzucPrzedmiot");
  214.     register_clcmd("say /reset", "KomendaResetujPunkty");
  215.     register_clcmd("say /help", "userhelp", 0, " - Help Motd ");
  216.     register_clcmd("say /save","ZapiszDane")
  217.     register_clcmd("fullupdate", "CommandBlock");
  218.     register_clcmd("cl_autobuy", "CommandBlock");
  219.     register_clcmd("cl_rebuy", "CommandBlock");
  220.     register_clcmd("cl_setautobuy","CommandBlock");
  221.     register_clcmd("rebuy", "CommandBlock");
  222.     register_clcmd("autobuy", "CommandBlock");
  223.     register_clcmd("glock", "CommandBlock");
  224.     register_clcmd("usp", "CommandBlock");
  225.     register_clcmd("p228", "CommandBlock");
  226.     register_clcmd("deagle", "CommandBlock");
  227.     register_clcmd("elites", "CommandBlock");
  228.     register_clcmd("fn57", "CommandBlock");
  229.     register_clcmd("m3", "CommandBlock");
  230.     register_clcmd("autoshotgun", "CommandBlock");
  231.     register_clcmd("mac10", "CommandBlock");
  232.     register_clcmd("tmp", "CommandBlock");
  233.     register_clcmd("mp5", "CommandBlock");
  234.     register_clcmd("ump45", "CommandBlock");
  235.     register_clcmd("p90", "CommandBlock");
  236.     register_clcmd("galil", "CommandBlock");
  237.     register_clcmd("ak47", "CommandBlock");
  238.     register_clcmd("scout", "CommandBlock");
  239.     register_clcmd("sg552", "CommandBlock");
  240.     register_clcmd("awp", "CommandBlock");
  241.     register_clcmd("g3sg1", "CommandBlock");
  242.     register_clcmd("famas", "CommandBlock");
  243.     register_clcmd("m4a1", "CommandBlock");
  244.     register_clcmd("bullpup", "CommandBlock");
  245.     register_clcmd("sg550", "CommandBlock");
  246.     register_clcmd("m249", "CommandBlock");
  247.     register_clcmd("shield", "CommandBlock");
  248.     register_clcmd("hegren", "CommandBlock");
  249.     register_clcmd("sgren", "CommandBlock");
  250.     register_clcmd("flash", "CommandBlock");
  251.     register_concmd("cod_setlvl", "cmd_setlvl", ADMIN_KICK, "<name> <level>");
  252.  
  253.     g_msg_screenfade = get_user_msgid("ScreenFade");
  254.     SyncHudObj = CreateHudSyncObj();
  255.     SyncHudObj2 = CreateHudSyncObj();
  256.     SyncHudObj3 = CreateHudSyncObj();
  257.     experience_for_murder = get_cvar_num("cod_killxp");
  258.     experience_for_bomb = get_cvar_num("cod_bombxp");
  259.    
  260.     set_task(60.0, "Pomoc");
  261. }
  262.  
  263. public plugin_cfg()
  264. {    
  265.     server_cmd("sv_maxspeed 1600");
  266. }
  267.  
  268. public plugin_precache()
  269. {
  270.     sprite_white = precache_model("sprites/white.spr") ;
  271.     sprite_blast = precache_model("sprites/dexplo.spr");
  272.    
  273.     precache_sound("MW/select.wav");
  274.     precache_sound("MW/start.wav");
  275.     precache_sound("MW/start2.wav");
  276.     precache_sound("MW/levelup.wav");
  277.    
  278.     precache_model("models/w_medkit.mdl");
  279.     precache_model("models/rpgrocket.mdl");
  280.     precache_model("models/mine.mdl");
  281. }
  282.  
  283. public CmdStart(id, uc_handle)
  284. {
  285.     if(!is_user_alive(id))
  286.         return FMRES_IGNORED;
  287.        
  288.     new button = get_uc(uc_handle, UC_Buttons);
  289.     new oldbutton = get_user_oldbutton(id);
  290.     new flags = get_entity_flags(id);
  291.    
  292.     if(information_item_player[id][0] == 11 || class_player[id] == Rambo)
  293.     {
  294.         if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && ilosc_skokow_player[id] > 0)
  295.         {
  296.             ilosc_skokow_player[id]--;
  297.             new Float:velocity[3];
  298.             entity_get_vector(id,EV_VEC_velocity,velocity);
  299.             velocity[2] = random_float(265.0,285.0);
  300.             entity_set_vector(id,EV_VEC_velocity,velocity);
  301.         }
  302.         else if(flags & FL_ONGROUND)
  303.         {    
  304.             ilosc_skokow_player[id] = 0;
  305.             if(information_item_player[id][0] == 11)
  306.                 ilosc_skokow_player[id]++;
  307.             if(class_player[id] == Rambo)
  308.                 ilosc_skokow_player[id]++;
  309.         }
  310.     }
  311.    
  312.     if(button & IN_ATTACK)
  313.     {
  314.         new Float:punchangle[3];
  315.        
  316.         if(information_item_player[id][0] == 20)
  317.             entity_set_vector(id, EV_VEC_punchangle, punchangle);
  318.         if(information_item_player[id][0] == 23)
  319.         {
  320.             entity_get_vector(id, EV_VEC_punchangle, punchangle);
  321.             for(new i=0; i<3;i++)
  322.                 punchangle[i]*=0.9;
  323.             entity_set_vector(id, EV_VEC_punchangle, punchangle);
  324.         }
  325.     }
  326.    
  327.     if(information_item_player[id][0] == 28 && button & IN_JUMP && button & IN_DUCK && flags & FL_ONGROUND && get_gametime() > information_item_player[id][1]+4.0)
  328.     {
  329.         information_item_player[id][1] = floatround(get_gametime());
  330.         new Float:velocity[3];
  331.         VelocityByAim(id, 700, velocity);
  332.         velocity[2] = random_float(265.0,285.0);
  333.         entity_set_vector(id, EV_VEC_velocity, velocity);
  334.     }
  335.    
  336.    
  337.     return FMRES_IGNORED;
  338. }
  339.  
  340. public Odrodzenie(id)
  341. {
  342.     if(!is_user_alive(id) || !is_user_connected(id))
  343.         return PLUGIN_CONTINUE;
  344.    
  345.     if(nowa_class_player[id])
  346.     {
  347.         class_player[id] = nowa_class_player[id];
  348.         nowa_class_player[id] = 0;
  349.         strip_user_weapons(id);
  350.         give_item(id, "weapon_knife");
  351.         switch(get_user_team(id))
  352.         {
  353.             case 1: give_item(id, "weapon_glock18");
  354.             case 2: give_item(id, "weapon_usp");
  355.         }
  356.         WczytajDane(id, class_player[id]);
  357.     }
  358.        
  359.     if(!class_player[id])
  360.     {
  361.         WybierzKlase(id);
  362.         return PLUGIN_CONTINUE;
  363.     }
  364.        
  365.     switch(class_player[id])
  366.     {
  367.         case Sniper:
  368.         {
  369.             give_item(id, "weapon_awp");
  370.             give_item(id, "weapon_scout");
  371.             give_item(id, "weapon_deagle");
  372.         }
  373.         case Commando:
  374.         {
  375.             give_item(id, "weapon_deagle");
  376.         }
  377.         case Sharpshooter:
  378.         {
  379.             give_item(id, "weapon_m4a1");
  380.             give_item(id, "weapon_ak47");
  381.         }
  382.         case Protector:
  383.         {
  384.             give_item(id, "weapon_m249");
  385.             give_item(id, "weapon_hegrenade");
  386.             give_item(id, "weapon_flashbang");                
  387.             give_item(id, "weapon_smokegrenade");
  388.         }
  389.         case Medic:
  390.         {
  391.             give_item(id, "weapon_ump45");
  392.             ilosc_apteczek_player[id] = 2;
  393.         }    
  394.         case FireSupport:
  395.         {
  396.             give_item(id, "weapon_mp5navy");
  397.             ilosc_rakiet_player[id] = 2;
  398.         }
  399.         case Sapper:
  400.         {
  401.             give_item(id, "weapon_p90");
  402.             ilosc_min_player[id] = 3;
  403.         }
  404.         case Demolitions:
  405.         {
  406.             give_item(id, "weapon_aug");
  407.             give_item(id, "weapon_hegrenade");
  408.             give_item(id, "weapon_flashbang");
  409.             give_item(id, "weapon_smokegrenade");
  410.             ilosc_dynamitow_player[id] = 1;
  411.         }
  412.         case Rusher:
  413.         {
  414.             give_item(id, "weapon_m3");
  415.         }
  416.         case Rambo:
  417.         {
  418.             give_item(id, "weapon_famas");
  419.         }
  420.     }
  421.        
  422.     if(gracz_resetuje[id])
  423.     {
  424.         ResetujPunkty(id);
  425.         gracz_resetuje[id] = false;
  426.     }
  427.    
  428.     if(punkty_player[id]>0)
  429.         PrzydzielPunkty(id);
  430.            
  431.     if(information_item_player[id][0] == 10 || information_item_player[id][0] == 9)
  432.         give_item(id, "weapon_hegrenade");
  433.            
  434.     if(information_item_player[id][0] == 9)
  435.         ZmienUbranie(id, 0);
  436.            
  437.     if(information_item_player[id][0] == 1)
  438.         set_user_footsteps(id, 1);
  439.     else
  440.         set_user_footsteps(id, 0);
  441.        
  442.     if(information_item_player[id][0] == 13)
  443.         give_item(id, "weapon_awp");
  444.        
  445.     if(information_item_player[id][0] == 19)
  446.         information_item_player[id][1] = 1;
  447.    
  448.     if(information_item_player[id][0] == 27)
  449.         information_item_player[id][1] = 3;
  450.            
  451.     new weapons[32];
  452.     new weaponsnum;
  453.     get_user_weapons(id, weapons, weaponsnum);
  454.     for(new i=0; i<weaponsnum; i++)
  455.         if(is_user_alive(id))
  456.             if(maxAmmo[weapons[i]] > 0)
  457.                 cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
  458.        
  459.     redukcja_obrazen_player[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(wytrzymalosc_player[id])))/100);
  460.     maksymalne_zdrowie_player[id] = zdrowie_klasy[class_player[id]]+zdrowie_player[id]*2;
  461.     fast_player[id] = STANDARD_FAST*fast_klasy[class_player[id]]+floatround(kondycja_player[id]*1.3);
  462.    
  463.     if(information_item_player[id][0] == 18)
  464.     {
  465.         maksymalne_zdrowie_player[id] += 100;
  466.         fast_player[id] -= 0.4;
  467.     }
  468.        
  469.     if(information_item_player[id][0] == 25)
  470.     {
  471.         maksymalne_zdrowie_player[id] += 50;
  472.         fast_player[id] -= 0.3;
  473.     }
  474.    
  475.     set_user_armor(id, pancerz_klasy[class_player[id]]);
  476.     set_user_health(id, maksymalne_zdrowie_player[id]);
  477.     if(information_item_player[id][0] == 17)
  478.         set_user_armor(id, 500);
  479.        
  480.     return PLUGIN_CONTINUE;
  481. }
  482.  
  483. public PoczatekRundy()    
  484. {
  485.     freezetime = false;
  486.     for(new id=0;id<=32;id++)
  487.     {
  488.         if(!is_user_alive(id))
  489.             continue;
  490.        
  491.         set_task(0.1, "SetFast", id+TASK_SET_FAST);
  492.        
  493.         switch(get_user_team(id))
  494.         {
  495.             case 1: client_cmd(id, "spk MW/start");
  496.             case 2: client_cmd(id, "spk MW/start2");
  497.         }
  498.     }
  499. }
  500.  
  501. public NowaRunda()
  502. {
  503.     freezetime = true;
  504.     new iEnt = find_ent_by_class(-1, "Mine");
  505.     while(iEnt > 0)
  506.     {
  507.         remove_entity(iEnt);
  508.         iEnt = find_ent_by_class(iEnt, "Mine");    
  509.     }
  510. }
  511.  
  512. public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
  513. {
  514.     if(!is_user_alive(this) || !is_user_connected(this) || information_item_player[this][0] == 24 || !is_user_connected(idattacker) || get_user_team(this) == get_user_team(idattacker) || !class_player[idattacker])
  515.         return HAM_IGNORED;
  516.        
  517.     new health = get_user_health(this);
  518.     new weapon = get_user_weapon(idattacker);
  519.    
  520.     if(health < 2)
  521.         return HAM_IGNORED;
  522.    
  523.     if(information_item_player[this][0] == 27 && information_item_player[this][1]>0)
  524.     {
  525.         information_item_player[this][1]--;
  526.         return HAM_SUPERCEDE;
  527.     }
  528.  
  529.     if(wytrzymalosc_player[this]>0)
  530.         damage -= redukcja_obrazen_player[this]*damage;
  531.        
  532.     if(information_item_player[this][0] == 2 || information_item_player[this][0] == 3)
  533.         damage-=(float(information_item_player[this][1])<damage)? float(information_item_player[this][1]): damage;
  534.            
  535.     if(information_item_player[idattacker][0] == 5 && !UTIL_In_FOV(this, idattacker) && UTIL_In_FOV(idattacker, this))
  536.         damage*=2.0;
  537.        
  538.     if(information_item_player[idattacker][0] == 10)
  539.         damage+=information_item_player[idattacker][1];
  540.        
  541.     if(information_item_player[this][0] == 12)
  542.         damage-=(5.0<damage)? 5.0: damage;
  543.    
  544.     if(weapon == CSW_AWP && information_item_player[idattacker][0] == 13)
  545.         damage=float(health);
  546.        
  547.     if(information_item_player[idattacker][0] == 21)
  548.         damage+=15;
  549.        
  550.     if(information_item_player[idattacker][0] == 22)
  551.         damage+=25;
  552.        
  553.     if(idinflictor != idattacker && entity_get_int(idinflictor, EV_INT_movetype) != 5)
  554.     {
  555.         if((information_item_player[idattacker][0] == 9 && random_num(1, information_item_player[idattacker][1]) == 1) || information_item_player[idattacker][0] == 10)
  556.             damage = float(health);    
  557.     }
  558.  
  559.     if(weapon == CSW_KNIFE)
  560.     {
  561.         if(information_item_player[this][0] == 4)
  562.             damage=damage*1.4+inteligencja_player[idattacker];
  563.         if(information_item_player[idattacker][0] == 8 || (class_player[idattacker] == Sniper && random(2) == 2) || class_player[idattacker] == Commando && !(get_user_button(idattacker) & IN_ATTACK))
  564.             damage = float(health);
  565.     }
  566.    
  567.     if(information_item_player[this][0] == 26 && random_num(1, information_item_player[this][1]) == 1)
  568.     {
  569.         SetHamParamEntity(3, this);
  570.         SetHamParamEntity(1, idattacker);
  571.     }
  572.        
  573.        
  574.     SetHamParamFloat(4, damage);
  575.     return HAM_IGNORED;
  576. }
  577.  
  578. public Damage(id)
  579. {
  580.     new attacker = get_user_attacker(id);
  581.     new damage = read_data(2);
  582.     if(!is_user_alive(attacker) || !is_user_connected(attacker) || id == attacker || !class_player[attacker])
  583.         return PLUGIN_CONTINUE;
  584.        
  585.     if(information_item_player[attacker][0] == 12 && random_num(1, information_item_player[id][1]) == 1)
  586.         Display_Fade(id,1<<14,1<<14 ,1<<16,255,155,50,230);
  587.    
  588.     if(get_user_team(id) != get_user_team(attacker))
  589.     {
  590.         while(damage>20)
  591.         {
  592.             damage-=20;
  593.             experience_player[attacker]++;
  594.         }
  595.     }
  596.     SprawdzLevel(attacker);
  597.     return PLUGIN_CONTINUE;
  598. }
  599.  
  600. public Death()
  601. {
  602.     new id = read_data(2);
  603.     new attacker = read_data(1);
  604.    
  605.     if(!is_user_alive(attacker) || !is_user_connected(attacker))
  606.         return PLUGIN_CONTINUE;
  607.    
  608.     new weapon = get_user_weapon(attacker);
  609.     new zdrowie = get_user_health(attacker);
  610.    
  611.     if(get_user_team(id) != get_user_team(attacker) && class_player[attacker])
  612.     {
  613.         new nowe_experience = 0;
  614.        
  615.         nowe_experience += experience_for_murder;
  616.        
  617.         if(class_player[id] == Rambo && class_player[attacker] != Rambo)
  618.             nowe_experience += experience_for_murder*2;
  619.        
  620.         if(level_player[id] > level_player[attacker])
  621.             nowe_experience += level_player[id] - level_player[attacker];
  622.        
  623.         if(class_player[attacker] == Rambo || information_item_player[attacker][0] == 15 && maxClip[weapon] != -1)
  624.         {
  625.    
  626.             new nowe_zdrowie = (zdrowie+20<maksymalne_zdrowie_player[attacker])? zdrowie+20: maksymalne_zdrowie_player[attacker];
  627.             set_user_clip(attacker, maxClip[weapon]);
  628.             set_user_health(attacker, nowe_zdrowie);
  629.         }
  630. #if defined BOT
  631.         if(is_user_bot2(attacker) && random(9) == 0)
  632.             WyrzucPrzedmiot(id);
  633. #endif
  634.         if(!information_item_player[attacker][0])
  635.             DajPrzedmiot(attacker, random_num(1, sizeof names_objects-1));
  636.    
  637.         if(information_item_player[attacker][0] == 14)
  638.         {
  639.             new nowe_zdrowie = (zdrowie+50<maksymalne_zdrowie_player[attacker])? zdrowie+50: maksymalne_zdrowie_player[attacker];
  640.             set_user_health(attacker, nowe_zdrowie);
  641.         }
  642.        
  643.         set_hudmessage(255, 212, 0, 0.50, 0.33, 1, 6.0, 4.0);
  644.         ShowSyncHudMsg(attacker, SyncHudObj2, "+%i", nowe_experience);
  645.        
  646.         experience_player[attacker] += nowe_experience;
  647.     }
  648.    
  649.     SprawdzLevel(attacker);
  650.    
  651.     if(information_item_player[id][0] == 7 && random_num(1, information_item_player[id][1]) == 1)
  652.         set_task(0.1, "Raise", id+TASK_RAISE);
  653.    
  654.     return PLUGIN_CONTINUE;
  655. }
  656.  
  657. public client_connect(id)
  658. {
  659.     //resetuje umiejetnosci
  660.     class_player[id] = 0;
  661.     level_player[id] = 0;
  662.     experience_player[id] = 0;
  663.     punkty_player[id] = 0;
  664.     zdrowie_player[id] = 0;
  665.     inteligencja_player[id] = 0;
  666.     wytrzymalosc_player[id] = 0;
  667.     kondycja_player[id] = 0;
  668.     maksymalne_zdrowie_player[id] = 0;
  669.     fast_player[id] = 0.0;
  670.    
  671.          get_user_authid(id, g_szAuthID[id], charsmax(g_szAuthID[] ));
  672.    
  673.     remove_task(id+TASK_SHOW_INFORMATION);
  674.     remove_task(id+TASK_SHOW_ADVERTISEMENT);    
  675.     remove_task(id+TASK_SET_FAST);
  676.     remove_task(id+TASK_RAISE);
  677.     remove_task(id+TASK_TRAINING_SANITARY);
  678.    
  679.     set_task(10.0, "ShowAdvertisement", id+TASK_SHOW_ADVERTISEMENT);
  680.     set_task(3.0, "ShowInformation", id+TASK_SHOW_INFORMATION);
  681.    
  682.     //resetuje przedmioty
  683.     UsunPrzedmiot(id);
  684. }
  685.  
  686. public client_disconnect(id)
  687. {
  688.     remove_task(id+TASK_SHOW_INFORMATION);
  689.     remove_task(id+TASK_SHOW_ADVERTISEMENT);    
  690.     remove_task(id+TASK_SET_FAST);
  691.     remove_task(id+TASK_RAISE);
  692.     remove_task(id+TASK_TRAINING_SANITARY);
  693.        
  694.     ZapiszDane(id);
  695.     UsunPrzedmiot(id);
  696. }
  697.    
  698. public RozbrajaBomb(id)
  699.     if(class_player[id])
  700.         disarming = id;
  701.    
  702. public BombaPodlozona()
  703. {
  704.     new Players[32], playerCount, id;
  705.     get_players(Players, playerCount, "aeh", "TERRORIST");
  706.    
  707.     if(get_playersnum() > 1)
  708.     {
  709.         experience_player[podkladajacy] += experience_for_bomb;
  710.         for (new i=0; i<playerCount; i++)
  711.         {
  712.             id = Players[i];
  713.             if(!class_player[id])
  714.                 continue;
  715.                
  716.             if(id != podkladajacy)
  717.             {
  718.                 experience_player[id] += experience_for_murder;
  719.                 client_print(id, print_chat, "[COD:MW] Recieved **%i** EXP for bomb planting.", experience_for_murder);
  720.             }
  721.             else
  722.             {
  723.                 client_print(id, print_chat, "[COD:MW] Recieved **%i** EXP for bomb planting.", experience_for_bomb);
  724.             }
  725.             SprawdzLevel(id);
  726.         }
  727.     }
  728. }
  729.  
  730. public BombaRozbrojona()
  731. {
  732.     new Players[32], playerCount, id;
  733.     get_players(Players, playerCount, "aeh", "CT");
  734.    
  735.     experience_player[disarming] += experience_for_bomb;
  736.     for (new i=0; i<playerCount; i++)
  737.     {
  738.         id = Players[i];
  739.         if(!class_player[id])
  740.             continue;
  741.         if(id != disarming)
  742.         {
  743.             experience_player[id]+= experience_for_murder;
  744.             client_print(id, print_chat, "[COD:MW] Recieved **%i** EXP for defusing the bomb.", experience_for_murder);
  745.         }
  746.         else
  747.             client_print(id, print_chat, "[COD:MW] Recieved **%i** EXP for defusing the bomb.",experience_for_bomb);
  748.         SprawdzLevel(id);
  749.     }
  750. }
  751.  
  752. public DescriptionKlasy(id)
  753. {
  754.     new menu = menu_create("Select Class:", "DescriptionKlasy_Handle");
  755.     for(new i=1; i<sizeof names_klas; i++)
  756.         menu_additem(menu, names_klas[i]);
  757.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  758.     menu_setprop(menu, MPROP_BACKNAME, "Previous Page");
  759.     menu_setprop(menu, MPROP_NEXTNAME, "Next Page");
  760.     menu_display(id, menu);
  761.    
  762.     client_cmd(id, "spk MW/select");
  763. }
  764.  
  765. public DescriptionKlasy_Handle(id, menu, item)
  766. {
  767.     client_cmd(id, "spk MW/select");
  768.    
  769.     if(item == MENU_EXIT)
  770.     {
  771.         menu_destroy(menu);
  772.         return PLUGIN_CONTINUE;
  773.     }
  774.     client_print(id, print_chat, "[COD:MW] %s: %s", names_klas[item+1], descriptions_klas[item+1]);
  775.     menu_display(id, menu);
  776.    
  777.     return PLUGIN_CONTINUE;
  778. }
  779.  
  780. public WybierzKlase(id)
  781. {
  782.     new menu = menu_create("Select Class:", "WybierzKlase_Handle");
  783.     new class[50];
  784.     for(new i=1; i<sizeof names_klas; i++)
  785.     {
  786.         WczytajDane(id, i);
  787.         format(class, 49, "%s \yLevel: %i", names_klas[i], level_player[id]);
  788.         menu_additem(menu, class);
  789.     }
  790.    
  791.     WczytajDane(id, class_player[id]);
  792.    
  793.     menu_setprop(menu, MPROP_EXITNAME, "Exit");
  794.     menu_setprop(menu, MPROP_BACKNAME, "Previous Page");
  795.     menu_setprop(menu, MPROP_NEXTNAME, "Next Page");
  796.     menu_display(id, menu);
  797.        
  798.     client_cmd(id, "spk MW/select");
  799. #if defined BOT
  800.     if(is_user_bot2(id))
  801.         WybierzKlase_Handle(id, menu, random(sizeof names_klas-1));
  802. #endif
  803. }
  804.  
  805. public WybierzKlase_Handle(id, menu, item)
  806. {
  807.     client_cmd(id, "spk MW/select");
  808.    
  809.     if(item == MENU_EXIT)
  810.     {
  811.         menu_destroy(menu);
  812.         return PLUGIN_CONTINUE;
  813.     }    
  814.        
  815.     item++;
  816.    
  817.     if(item == class_player[id])
  818.         return PLUGIN_CONTINUE;
  819.    
  820.     if(class_player[id])
  821.     {
  822.         nowa_class_player[id] = item;
  823.         client_print(id, print_chat, "[COD:MW] Class will change next round.");
  824.     }
  825.     else
  826.     {
  827.         class_player[id] = item;
  828.         WczytajDane(id, class_player[id]);
  829.         Odrodzenie(id);
  830.     }
  831.     return PLUGIN_CONTINUE;
  832. }
  833.  
  834. public PrzydzielPunkty(id)
  835. {
  836.     new inteligencja[65];
  837.     new zdrowie[60];
  838.     new wytrzymalosc[60];
  839.     new kondycja[60];
  840.     new tytul[25];
  841.     format(inteligencja, 64, "Intelligence: \r%i \y(Increases Items Damage)", inteligencja_player[id]);
  842.     format(zdrowie, 59, "Life: \r%i \y(Increases Health)", zdrowie_player[id]);
  843.     format(wytrzymalosc, 59, "Strength: \r%i \y(Reduces Damage on you)", wytrzymalosc_player[id]);
  844.     format(kondycja, 59, "Condition: \r%i \y(Increases Speed)", kondycja_player[id]);
  845.     format(tytul, 24, "Assign Points(%i):", punkty_player[id]);
  846.     new menu = menu_create(tytul, "PrzydzielPunkty_Handler");
  847.     menu_additem(menu, inteligencja);
  848.     menu_additem(menu, zdrowie);
  849.     menu_additem(menu, wytrzymalosc);
  850.     menu_additem(menu, kondycja);
  851.     menu_display(id, menu);
  852. #if defined BOT
  853.     if(is_user_bot2(id))
  854.         PrzydzielPunkty_Handler(id, menu, random(4));
  855. #endif
  856. }
  857.  
  858. public PrzydzielPunkty_Handler(id, menu, item)
  859. {
  860.     client_cmd(id, "spk MW/select");
  861.    
  862.     if(item == MENU_EXIT)
  863.     {
  864.         menu_destroy(menu);
  865.         return PLUGIN_CONTINUE;
  866.     }
  867.    
  868.     switch(item)
  869.     {
  870.         case 0:
  871.         {    
  872.             if(inteligencja_player[id]<100)
  873.                 inteligencja_player[id]++;
  874.             else
  875.                 client_print(id, print_chat, "[COD:MW] Maximum Intelligence Level");
  876.            
  877.         }
  878.         case 1:
  879.         {    
  880.             if(zdrowie_player[id]<100)
  881.                 zdrowie_player[id]++;
  882.             else
  883.                 client_print(id, print_chat, "[COD:MW] Maximum Strength Level");
  884.         }
  885.         case 2:
  886.         {    
  887.             if(wytrzymalosc_player[id]<100)
  888.                 wytrzymalosc_player[id]++;
  889.             else
  890.                 client_print(id, print_chat, "[COD:MW] Maximum Dexterity Level");
  891.            
  892.         }
  893.         case 3:
  894.         {    
  895.             if(kondycja_player[id]<100)
  896.                 kondycja_player[id]++;
  897.             else
  898.                 client_print(id, print_chat, "[COD:MW] Maximum Agility Level");
  899.         }
  900.     }
  901.    
  902.     punkty_player[id]--;
  903.    
  904.     if(punkty_player[id]>0)
  905.         PrzydzielPunkty(id);
  906.        
  907.     return PLUGIN_CONTINUE;
  908. }
  909.  
  910. public ResetujPunkty(id)
  911. {    
  912.     punkty_player[id] = level_player[id]*2-2;
  913.     inteligencja_player[id] = 0;
  914.     zdrowie_player[id] = 0;
  915.     kondycja_player[id] = 0;
  916.     wytrzymalosc_player[id] = 0;
  917. }
  918.  
  919. public KomendaResetujPunkty(id)
  920. {    
  921.     client_print(id, print_chat, "[COD:MW] Skills will be reset next round.");
  922.     client_cmd(id, "spk MW/select");
  923.     gracz_resetuje[id] = true;
  924. }
  925.  
  926. public TrainingSanitary(id)
  927. {
  928.     id -= TASK_TRAINING_SANITARY;
  929.     if(information_item_player[id][0] != 16)
  930.         return PLUGIN_CONTINUE;
  931.     set_task(3.0, "TrainingSanitary", id+TASK_TRAINING_SANITARY);
  932.     if(!is_user_alive(id))
  933.         return PLUGIN_CONTINUE;
  934.     new health = get_user_health(id);
  935.     new new_health = (health+10<maksymalne_zdrowie_player[id])?health+10:maksymalne_zdrowie_player[id];
  936.     set_user_health(id, new_health);
  937.     return PLUGIN_CONTINUE;
  938. }
  939.  
  940. public StworzApteczke(id)
  941. {
  942.     if (!ilosc_apteczek_player[id])
  943.     {
  944.         client_print(id, print_center, "You only get 2 kits per round!");
  945.         return PLUGIN_CONTINUE;
  946.     }
  947.    
  948.     if(inteligencja_player[id] < 1)
  949.         client_print(id, print_center, "To strengthen the First Aid Kit, upgrade Intelligence!");
  950.        
  951.     ilosc_apteczek_player[id]--;
  952.    
  953.     new Float:origin[3];
  954.     entity_get_vector(id, EV_VEC_origin, origin);
  955.    
  956.     new ent = create_entity("info_target");
  957.     entity_set_string(ent, EV_SZ_classname, "FirstAidKit");
  958.     entity_set_edict(ent, EV_ENT_owner, id);
  959.     entity_set_int(ent, EV_INT_solid, SOLID_NOT);
  960.     entity_set_vector(ent, EV_VEC_origin, origin);
  961.     entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
  962.    
  963.    
  964.     entity_set_model(ent, "models/w_medkit.mdl");
  965.     set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 )     ;
  966.     drop_to_floor(ent);
  967.    
  968.     entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
  969.    
  970.     return PLUGIN_CONTINUE;
  971. }
  972.  
  973. public FirstAirKitThink(ent)
  974. {
  975.     new id = entity_get_edict(ent, EV_ENT_owner);
  976.     new totem_dist = 300;
  977.     new totem_heal = 5+floatround(inteligencja_player[id]*0.5);
  978.     if (entity_get_edict(ent, EV_ENT_euser2) == 1)
  979.     {        
  980.         new Float:forigin[3], origin[3];
  981.         entity_get_vector(ent, EV_VEC_origin, forigin);
  982.         FVecIVec(forigin,origin);
  983.        
  984.         new entlist[33];
  985.         new numfound = find_sphere_class(0,"player",totem_dist+0.0,entlist, 32,forigin);
  986.        
  987.         for (new i=0; i < numfound; i++)
  988.         {        
  989.             new pid = entlist[i];
  990.            
  991.             if (get_user_team(pid) != get_user_team(id))
  992.                 continue;
  993.                                
  994.             new zdrowie = get_user_health(pid);
  995.             new nowe_zdrowie = (zdrowie+totem_heal<maksymalne_zdrowie_player[pid])?zdrowie+totem_heal:maksymalne_zdrowie_player[pid];
  996.             if (is_user_alive(pid)) set_user_health(pid, nowe_zdrowie);        
  997.         }
  998.        
  999.         entity_set_edict(ent, EV_ENT_euser2, 0);
  1000.         entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5);
  1001.        
  1002.         return PLUGIN_CONTINUE;
  1003.     }
  1004.    
  1005.     if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
  1006.     {
  1007.         remove_entity(ent);
  1008.         return PLUGIN_CONTINUE;
  1009.     }
  1010.    
  1011.     if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
  1012.         set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ) ;
  1013.        
  1014.     new Float:forigin[3], origin[3];
  1015.     entity_get_vector(ent, EV_VEC_origin, forigin);
  1016.     FVecIVec(forigin,origin);
  1017.                    
  1018.     //Find people near and give them health
  1019.     message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
  1020.     write_byte( TE_BEAMCYLINDER );
  1021.     write_coord( origin[0] );
  1022.     write_coord( origin[1] );
  1023.     write_coord( origin[2] );
  1024.     write_coord( origin[0] );
  1025.     write_coord( origin[1] + totem_dist );
  1026.     write_coord( origin[2] + totem_dist );
  1027.     write_short( sprite_white );
  1028.     write_byte( 0 ); // startframe
  1029.     write_byte( 0 ); // framerate
  1030.     write_byte( 10 ); // life
  1031.     write_byte( 10 ); // width
  1032.     write_byte( 255 ); // noise
  1033.     write_byte( 255 ); // r, g, b
  1034.     write_byte( 100 );// r, g, b
  1035.     write_byte( 100 ); // r, g, b
  1036.     write_byte( 128 ); // brightness
  1037.     write_byte( 5 ); // speed
  1038.     message_end();
  1039.        
  1040.     entity_set_edict(ent, EV_ENT_euser2 ,1);
  1041.     entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
  1042.    
  1043.        
  1044.     return PLUGIN_CONTINUE;
  1045.  
  1046. }
  1047.  
  1048. public StworzRakiete(id)
  1049. {
  1050.     if (!ilosc_rakiet_player[id])
  1051.     {
  1052.         client_print(id, print_center, "You have used all your rockets!");
  1053.         return PLUGIN_CONTINUE;
  1054.     }
  1055.    
  1056.     if(poprzednia_rakieta_player[id] + 2.0 > get_gametime())
  1057.     {
  1058.         client_print(id, print_center, "You can use the rocket every 2 seconds!");
  1059.         return PLUGIN_CONTINUE;
  1060.     }
  1061.    
  1062.     if (is_user_alive(id))
  1063.     {    
  1064.         if(inteligencja_player[id] < 1)
  1065.             client_print(id, print_center, "To strengthen the Rockets, upgrade Intelligence!");
  1066.            
  1067.         poprzednia_rakieta_player[id] = get_gametime();
  1068.         ilosc_rakiet_player[id]--;
  1069.  
  1070.         new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
  1071.        
  1072.         entity_get_vector(id, EV_VEC_v_angle, vAngle);
  1073.         entity_get_vector(id, EV_VEC_origin , Origin);
  1074.    
  1075.         new Ent = create_entity("info_target");
  1076.    
  1077.         entity_set_string(Ent, EV_SZ_classname, "Rocket");
  1078.         entity_set_model(Ent, "models/rpgrocket.mdl");
  1079.    
  1080.         vAngle[0] *= -1.0;
  1081.    
  1082.         entity_set_origin(Ent, Origin);
  1083.         entity_set_vector(Ent, EV_VEC_angles, vAngle);
  1084.    
  1085.         entity_set_int(Ent, EV_INT_effects, 2);
  1086.         entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
  1087.         entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
  1088.         entity_set_edict(Ent, EV_ENT_owner, id);
  1089.    
  1090.         VelocityByAim(id, 1000 , Velocity);
  1091.         entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
  1092.     }    
  1093.     return PLUGIN_CONTINUE;
  1094. }
  1095.  
  1096. public PolozDynamit(id)
  1097. {
  1098.     if(!ilosc_dynamitow_player[id])
  1099.     {
  1100.         client_print(id, print_center, "You have already used your dynamite!");
  1101.         return PLUGIN_CONTINUE;
  1102.     }
  1103.    
  1104.     if(inteligencja_player[id] < 1)
  1105.         client_print(id, print_center, "To strengthen your dynamite, upgrade your intelligence!");
  1106.    
  1107.     ilosc_dynamitow_player[id]--;
  1108.     new Float:fOrigin[3], iOrigin[3];
  1109.     entity_get_vector( id, EV_VEC_origin, fOrigin);
  1110.     iOrigin[0] = floatround(fOrigin[0]);
  1111.     iOrigin[1] = floatround(fOrigin[1]);
  1112.     iOrigin[2] = floatround(fOrigin[2]);
  1113.  
  1114.     message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  1115.     write_byte(TE_EXPLOSION);
  1116.     write_coord(iOrigin[0]);
  1117.     write_coord(iOrigin[1]);
  1118.     write_coord(iOrigin[2]);
  1119.     write_short(sprite_blast);
  1120.     write_byte(32);
  1121.     write_byte(20);
  1122.     write_byte(0);
  1123.     message_end();
  1124.    
  1125.     message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
  1126.     write_byte( TE_BEAMCYLINDER );
  1127.     write_coord( iOrigin[0] );
  1128.     write_coord( iOrigin[1] );
  1129.     write_coord( iOrigin[2] );
  1130.     write_coord( iOrigin[0] );
  1131.     write_coord( iOrigin[1] + 300 );
  1132.     write_coord( iOrigin[2] + 300 );
  1133.     write_short( sprite_white );
  1134.     write_byte( 0 ); // startframe
  1135.     write_byte( 0 ); // framerate
  1136.     write_byte( 10 ); // life
  1137.     write_byte( 10 ); // width
  1138.     write_byte( 255 ); // noise
  1139.     write_byte( 255 ); // r, g, b
  1140.     write_byte( 100 );// r, g, b
  1141.     write_byte( 100 ); // r, g, b
  1142.     write_byte( 128 ); // brightness
  1143.     write_byte( 8 ); // speed
  1144.     message_end();
  1145.  
  1146.     new entlist[33];
  1147.     new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
  1148.    
  1149.     for (new i=0; i < numfound; i++)
  1150.     {        
  1151.         new pid = entlist[i];
  1152.        
  1153.         if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid) || information_item_player[pid][0] == 24)
  1154.             continue;
  1155.         ExecuteHam(Ham_TakeDamage, pid, 0, id, 90.0+float(inteligencja_player[id]) , 1);
  1156.     }
  1157.     return PLUGIN_CONTINUE;
  1158. }
  1159.  
  1160. public PostawMine(id)
  1161. {
  1162.     if (!ilosc_min_player[id])
  1163.     {
  1164.         client_print(id, print_center, "You have used all your mines!");
  1165.         return PLUGIN_CONTINUE;
  1166.     }
  1167.    
  1168.     if(inteligencja_player[id] < 1)
  1169.         client_print(id, print_center, "To strengthen your mines, upgrade your intelligence!");
  1170.    
  1171.     ilosc_min_player[id]--;
  1172.    
  1173.     new Float:origin[3];
  1174.     entity_get_vector(id, EV_VEC_origin, origin);
  1175.        
  1176.     new ent = create_entity("info_target");
  1177.     entity_set_string(ent ,EV_SZ_classname, "Mine");
  1178.     entity_set_edict(ent ,EV_ENT_owner, id);
  1179.     entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);
  1180.     entity_set_origin(ent, origin);
  1181.     entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
  1182.    
  1183.     entity_set_model(ent, "models/mine.mdl");
  1184.     entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});
  1185.    
  1186.     drop_to_floor(ent);
  1187.  
  1188.     entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
  1189.    
  1190.     set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,20)    ;
  1191.    
  1192.    
  1193.     return PLUGIN_CONTINUE;
  1194. }
  1195.  
  1196. public DotykMiny(ent, id)
  1197. {
  1198.     new attacker = entity_get_edict(ent, EV_ENT_owner);
  1199.     if (get_user_team(attacker) != get_user_team(id))
  1200.     {
  1201.         new Float:fOrigin[3], iOrigin[3];
  1202.         entity_get_vector( ent, EV_VEC_origin, fOrigin);
  1203.         iOrigin[0] = floatround(fOrigin[0]);
  1204.         iOrigin[1] = floatround(fOrigin[1]);
  1205.         iOrigin[2] = floatround(fOrigin[2]);
  1206.        
  1207.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  1208.         write_byte(TE_EXPLOSION);
  1209.         write_coord(iOrigin[0]);
  1210.         write_coord(iOrigin[1]);
  1211.         write_coord(iOrigin[2]);
  1212.         write_short(sprite_blast);
  1213.         write_byte(32); // scale
  1214.         write_byte(20); // framerate
  1215.         write_byte(0);// flags
  1216.         message_end();
  1217.         new entlist[33];
  1218.         new numfound = find_sphere_class(ent,"player", 90.0 ,entlist, 32);
  1219.        
  1220.         for (new i=0; i < numfound; i++)
  1221.         {        
  1222.             new pid = entlist[i];
  1223.            
  1224.             if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || information_item_player[pid][0] == 24 || class_player[id] == Protector)
  1225.                 continue;
  1226.                
  1227.             ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 90.0+float(inteligencja_player[attacker]) , 1);
  1228.         }
  1229.         remove_entity(ent);
  1230.     }
  1231. }
  1232.  
  1233. public DotykRakiety(ent)
  1234. {
  1235.     if ( !is_valid_ent(ent))
  1236.         return;
  1237.  
  1238.     new attacker = entity_get_edict(ent, EV_ENT_owner);
  1239.  
  1240.     new Float:fOrigin[3], iOrigin[3];
  1241.     entity_get_vector( ent, EV_VEC_origin, fOrigin);    
  1242.     iOrigin[0] = floatround(fOrigin[0]);
  1243.     iOrigin[1] = floatround(fOrigin[1]);
  1244.     iOrigin[2] = floatround(fOrigin[2]);
  1245.  
  1246.     message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
  1247.     write_byte(TE_EXPLOSION);
  1248.     write_coord(iOrigin[0]);
  1249.     write_coord(iOrigin[1]);
  1250.     write_coord(iOrigin[2]);
  1251.     write_short(sprite_blast);
  1252.     write_byte(32); // scale
  1253.     write_byte(20); // framerate
  1254.     write_byte(0);// flags
  1255.     message_end();
  1256.  
  1257.     new entlist[33];
  1258.     new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32);
  1259.    
  1260.     for (new i=0; i < numfound; i++)
  1261.     {        
  1262.         new pid = entlist[i];
  1263.        
  1264.         if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || information_item_player[pid][0] == 24)
  1265.             continue;
  1266.         ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0+float(inteligencja_player[attacker]) , 1);
  1267.     }
  1268.     remove_entity(ent);
  1269. }    
  1270.  
  1271. public CurWeapon(id)
  1272. {
  1273.     if(freezetime || !class_player[id])
  1274.         return PLUGIN_CONTINUE;
  1275.        
  1276.     new weapon = read_data(2);
  1277.  
  1278.     SetFast(id);
  1279.    
  1280.     if(weapon == CSW_C4)
  1281.         podkladajacy = id;
  1282.     return PLUGIN_CONTINUE;
  1283. }
  1284.  
  1285. public EmitSound(id, iChannel, szSound[], Float:fVol, Float:fAttn, iFlags, iPitch )
  1286. {
  1287.     if(equal(szSound, "common/wpn_denyselect.wav"))
  1288.     {
  1289.         UzyjItem(id);
  1290.         return FMRES_SUPERCEDE;
  1291.     }
  1292.    
  1293.     return FMRES_IGNORED;
  1294. }
  1295.  
  1296. public UzyjItem(id)
  1297. {
  1298.     if(information_item_player[id][0] == 19 && information_item_player[id][1]>0)
  1299.     {
  1300.         set_user_health(id, maksymalne_zdrowie_player[id]);
  1301.         information_item_player[id][1]--;
  1302.     }
  1303.    
  1304.     if(ilosc_apteczek_player[id]>0)
  1305.         StworzApteczke(id);
  1306.     if(ilosc_rakiet_player[id]>0)
  1307.         StworzRakiete(id);
  1308.     if(ilosc_min_player[id]>0)
  1309.         PostawMine(id);
  1310.     if(ilosc_dynamitow_player[id]>0)
  1311.         PolozDynamit(id);
  1312.        
  1313.     return PLUGIN_HANDLED;
  1314. }
  1315.  
  1316. public ZapiszDane(id)
  1317. {
  1318.     new vaultkey[64],vaultdata[256];
  1319.     format(vaultkey,63,"%s-%i-cod", g_szAuthID[id], class_player[id]);
  1320.     format(vaultdata,255,"%i#%i#%i#%i#%i#%i", experience_player[id], level_player[id], inteligencja_player[id], zdrowie_player[id], wytrzymalosc_player[id], kondycja_player[id]);
  1321.     nvault_set(g_vault,vaultkey,vaultdata);
  1322. }
  1323.  
  1324. public WczytajDane(id, class)
  1325. {
  1326.     new vaultkey[64],vaultdata[256];
  1327.     format(vaultkey,63,"%s-%i-cod", g_szAuthID[id], class);
  1328.     format(vaultdata,255,"%i#%i#%i#%i#%i#%i", experience_player[id], level_player[id], inteligencja_player[id], zdrowie_player[id], wytrzymalosc_player[id], kondycja_player[id]);
  1329.     nvault_get(g_vault,vaultkey,vaultdata,255);
  1330.  
  1331.     replace_all(vaultdata, 255, "#", " ");
  1332.  
  1333.     new experienceplayer[32], levelplayer[32], inteligencjaplayer[32], silaplayer[32], zrecznoscplayer[32], zwinnoscplayer[32];
  1334.  
  1335.     parse(vaultdata, experienceplayer, 31, levelplayer, 31, inteligencjaplayer, 31, silaplayer, 31, zrecznoscplayer, 31, zwinnoscplayer, 31);
  1336.  
  1337.     experience_player[id] = str_to_num(experienceplayer);
  1338.     level_player[id] = str_to_num(levelplayer)>0?str_to_num(levelplayer):1;
  1339.     inteligencja_player[id] = str_to_num(inteligencjaplayer);
  1340.     zdrowie_player[id] = str_to_num(silaplayer);
  1341.     wytrzymalosc_player[id] = str_to_num(zrecznoscplayer);
  1342.     kondycja_player[id] = str_to_num(zwinnoscplayer);
  1343.     punkty_player[id] = (level_player[id]-1)*2-inteligencja_player[id]-zdrowie_player[id]-wytrzymalosc_player[id]-kondycja_player[id];
  1344. }
  1345.  
  1346. public WyrzucPrzedmiot(id)
  1347. {
  1348.     if(information_item_player[id][0])
  1349.     {
  1350.         client_print(id, print_chat, "[COD:MW] Dropped %s.", names_objects[information_item_player[id][0]]);
  1351.         UsunPrzedmiot(id);
  1352.     }
  1353.     else
  1354.         client_print(id, print_chat, "[COD:MW] You have no item to drop.", names_objects[information_item_player[id][0]]);
  1355. }
  1356.  
  1357. public UsunPrzedmiot(id)
  1358. {
  1359.     information_item_player[id][0] = 0;
  1360.     information_item_player[id][1] = 0;
  1361.     if(is_user_alive(id))
  1362.         set_user_footsteps(id, 0);
  1363.     set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
  1364.     ZmienUbranie(id, 1);
  1365. }
  1366.  
  1367. public DajPrzedmiot(id, przedmiot)
  1368. {
  1369.     UsunPrzedmiot(id);
  1370.     information_item_player[id][0] = przedmiot;
  1371.     client_print(id, print_chat, "[COD:MW] Recieved a %s.", names_objects[information_item_player[id][0]]);    
  1372.    
  1373.     switch(przedmiot)
  1374.     {
  1375.         case 1:
  1376.         {
  1377.             set_user_footsteps(id, 1);
  1378.         }
  1379.         case 2:
  1380.         {
  1381.             information_item_player[id][1] = random_num(3,6);
  1382.         }
  1383.         case 3:
  1384.         {
  1385.             information_item_player[id][1] = random_num(6, 11);
  1386.         }
  1387.         case 5:
  1388.         {
  1389.             information_item_player[id][1] = random_num(6, 9);
  1390.         }
  1391.         case 6:
  1392.         {
  1393.             information_item_player[id][1] = random_num(100, 150);
  1394.             set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 40);
  1395.         }
  1396.         case 7:
  1397.         {
  1398.             information_item_player[id][1] = random_num(2, 4);
  1399.         }
  1400.         case 8:
  1401.         {
  1402.             if(class_player[id] == Commando)
  1403.                 DajPrzedmiot(id, random_num(1, sizeof names_objects-1));
  1404.         }
  1405.         case 9:
  1406.         {
  1407.             information_item_player[id][1] = random_num(1, 3);
  1408.             ZmienUbranie(id, 0);
  1409.             give_item(id, "weapon_hegrenade");
  1410.         }
  1411.         case 10:
  1412.         {
  1413.             information_item_player[id][1] = random_num(4, 98);
  1414.             give_item(id, "weapon_hegrenade");
  1415.         }
  1416.         case 12:
  1417.         {
  1418.             information_item_player[id][1] = random_num(1, 99);
  1419.         }
  1420.         case 13:
  1421.         {
  1422.             give_item(id, "weapon_awp");
  1423.         }
  1424.         case 15:
  1425.         {
  1426.             if(class_player[id] == Rambo)
  1427.                 DajPrzedmiot(id, random_num(1, sizeof names_objects-1));
  1428.         }
  1429.         case 16:
  1430.         {
  1431.             set_task(5.0, "TrainingSanitary", id+TASK_TRAINING_SANITARY);
  1432.         }
  1433.         case 19:
  1434.         {
  1435.             information_item_player[id][1] = 1;
  1436.         }
  1437.         case 26:
  1438.         {
  1439.             information_item_player[id][1] = random_num(3, 6);
  1440.         }
  1441.         case 27:
  1442.         {
  1443.             information_item_player[id][1] = 3;
  1444.         }
  1445.     }
  1446. }
  1447.    
  1448. public DescriptionItem(id)
  1449. {
  1450.     new description_item[128];
  1451.     new losowa_wartosc[3];
  1452.     num_to_str(information_item_player[id][1], losowa_wartosc, 2);
  1453.     format(description_item, 127, descriptions_objects[information_item_player[id][0]]);
  1454.     replace_all(description_item, 127, "LW", losowa_wartosc);
  1455.    
  1456.     client_print(id, print_chat, "Item: %s.", names_objects[information_item_player[id][0]]);
  1457.     client_print(id, print_chat, "Description: %s.", description_item);
  1458. }
  1459.  
  1460. public Raise(id)
  1461. {
  1462.     id-=TASK_RAISE;
  1463.     ExecuteHamB(Ham_CS_RoundRespawn, id);
  1464. }
  1465.  
  1466. public SprawdzLevel(id)
  1467. {    
  1468.     if(level_player[id] < 201)
  1469.     {
  1470.         while(experience_player[id] >= experience_level[level_player[id]])
  1471.         {
  1472.             level_player[id]++;
  1473.             set_hudmessage(60, 200, 25, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.2, 2);
  1474.             ShowSyncHudMsg(id, SyncHudObj3, "Congratulations you have gained a level!");
  1475.             client_cmd(id, "spk MW/levelup");
  1476.         }
  1477.    
  1478.         punkty_player[id] = (level_player[id]-1)*2-inteligencja_player[id]-zdrowie_player[id]-wytrzymalosc_player[id]-kondycja_player[id];
  1479.     }
  1480.     ZapiszDane(id);
  1481. }
  1482.  
  1483. public ShowInformation(id)
  1484. {
  1485.     id -= TASK_SHOW_INFORMATION;
  1486.    
  1487.     set_task(0.1, "ShowInformation", id+TASK_SHOW_INFORMATION);
  1488.        
  1489.     if(!is_user_alive(id))
  1490.     {
  1491.         new target = entity_get_int(id, EV_INT_iuser2);
  1492.        
  1493.         if(target == 0)
  1494.             return PLUGIN_CONTINUE;
  1495.            
  1496.         set_hudmessage(255, 255, 255, 0.6, -1.0, 0, 0.0, 0.3, 0.0, 0.0, 2);
  1497.         ShowSyncHudMsg(id, SyncHudObj, "Class : %s^nExp : %i / %i^nLevel : %i^nItem : %s", names_klas[class_player[target]], experience_player[target], experience_level[level_player[target]], level_player[target], names_objects[information_item_player[target][0]]);
  1498.        
  1499.         return PLUGIN_CONTINUE;
  1500.     }
  1501.     set_hudmessage(255, 0, 0, 0.02, 0.23, 0, 0.0, 0.3, 0.0, 0.0);
  1502.     ShowSyncHudMsg(id, SyncHudObj, "[Class : %s]^n[EXP : %i / %i]^n[Level : %i]^n[Item : %s]", names_klas[class_player[id]], experience_player[id], experience_level[level_player[id]], level_player[id], names_objects[information_item_player[id][0]]);
  1503.     return PLUGIN_CONTINUE;
  1504. }  
  1505.  
  1506. public ShowAdvertisement(id)
  1507. {
  1508.     id-=TASK_SHOW_ADVERTISEMENT;
  1509.     client_print(id, print_chat, "[COD:MW] Welcome to the Call of Duty Mod.");
  1510. }
  1511.  
  1512. public SetFast(id)
  1513. {
  1514.     id -= id>32? TASK_SET_FAST: 0;
  1515.    
  1516.     if(class_player[id])
  1517.         set_user_maxspeed(id, fast_player[id]);
  1518. }
  1519.    
  1520. public ZmienUbranie(id,reset)
  1521. {
  1522.     if (id<1 || id>32 || !is_user_connected(id))
  1523.         return PLUGIN_CONTINUE;
  1524.    
  1525.     if (reset)
  1526.         cs_reset_user_model(id);
  1527.     else
  1528.     {
  1529.         new num = random_num(0,3);
  1530.         switch(get_user_team(id))
  1531.         {
  1532.             case 1: cs_set_user_model(id, Clothing_CT[num]);
  1533.             case 2:cs_set_user_model(id, Clothing_Terro[num]);
  1534.         }
  1535.     }
  1536.    
  1537.     return PLUGIN_CONTINUE;
  1538. }
  1539.  
  1540. public Pomoc()
  1541. {
  1542.     switch(random(3))
  1543.     {
  1544.         case 0: ColorChat( id, "!g[COD:MW] !nType /help for help menu");
  1545.         case 1: ColorChat( id, "!g[COD:MW] !nType /binds for bind menu");
  1546.         case 2: ColorChat( id, "!g[COD:MW] !nExcessive spawn killing will result in punishment");
  1547.     }
  1548.     set_task(60.0, "Pomoc");
  1549. }
  1550.  
  1551. public cmd_setlvl(id, level, cid)
  1552. {
  1553.     if(!cmd_access(id,level,cid,3))
  1554.         return PLUGIN_HANDLED;
  1555.     new arg1[33];
  1556.     new arg2[6];
  1557.     read_argv(1, arg1, 32);
  1558.     read_argv(2, arg2, 5);
  1559.     new player = cmd_target(id, arg1);
  1560.     new value = str_to_num(arg2)-1;
  1561.    
  1562.     experience_player[player] = experience_level[value];
  1563.     level_player[player] = 0;
  1564.     SprawdzLevel(player);
  1565.     return PLUGIN_HANDLED;
  1566. }
  1567.  
  1568. public CommandBlock()
  1569.     return PLUGIN_HANDLED;
  1570.    
  1571. stock bool:UTIL_In_FOV(id,target)
  1572. {
  1573.     if (Find_Angle(id,target,9999.9) > 0.0)
  1574.         return true;
  1575.    
  1576.     return false;
  1577. }
  1578. #if defined BOT
  1579. public is_user_bot2(id)
  1580. {
  1581.     new ping, loss
  1582.     get_user_ping(id, ping, loss)
  1583.     if(ping > 0 && loss > 0)
  1584.         return false
  1585.     return true
  1586. }
  1587. #endif
  1588.  
  1589. stock Float:Find_Angle(Core,Target,Float:dist)
  1590. {
  1591.     new Float:vec2LOS[2];
  1592.     new Float:flDot;
  1593.     new Float:CoreOrigin[3];
  1594.     new Float:TargetOrigin[3];
  1595.     new Float:CoreAngles[3];
  1596.    
  1597.     pev(Core,pev_origin,CoreOrigin);
  1598.     pev(Target,pev_origin,TargetOrigin);
  1599.    
  1600.     if (get_distance_f(CoreOrigin,TargetOrigin) > dist)
  1601.         return 0.0;
  1602.    
  1603.     pev(Core,pev_angles, CoreAngles);
  1604.    
  1605.     for ( new i = 0; i < 2; i++ )
  1606.         vec2LOS[i] = TargetOrigin[i] - CoreOrigin[i];
  1607.    
  1608.     new Float:veclength = Vec2DLength(vec2LOS);
  1609.    
  1610.     //Normalize V2LOS
  1611.     if (veclength <= 0.0)
  1612.     {
  1613.         vec2LOS[0] = 0.0;
  1614.         vec2LOS[1] = 0.0;
  1615.     }
  1616.     else
  1617.     {
  1618.         new Float:flLen = 1.0 / veclength;
  1619.         vec2LOS[0] = vec2LOS[0]*flLen;
  1620.         vec2LOS[1] = vec2LOS[1]*flLen;
  1621.     }
  1622.    
  1623.     //Do a makevector to make v_forward right
  1624.     engfunc(EngFunc_MakeVectors,CoreAngles);
  1625.    
  1626.     new Float:v_forward[3];
  1627.     new Float:v_forward2D[2];
  1628.     get_global_vector(GL_v_forward, v_forward);
  1629.    
  1630.     v_forward2D[0] = v_forward[0];
  1631.     v_forward2D[1] = v_forward[1];
  1632.    
  1633.     flDot = vec2LOS[0]*v_forward2D[0]+vec2LOS[1]*v_forward2D[1];
  1634.    
  1635.     if ( flDot > 0.5 )
  1636.     {
  1637.         return flDot;
  1638.     }
  1639.    
  1640.     return 0.0;
  1641. }
  1642.  
  1643. stock Float:Vec2DLength( Float:Vec[2] )  
  1644. {
  1645.     return floatsqroot(Vec[0]*Vec[0] + Vec[1]*Vec[1] );
  1646. }
  1647.  
  1648. stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha)
  1649. {
  1650.     message_begin( MSG_ONE, g_msg_screenfade,{0,0,0},id );
  1651.     write_short( duration );    // Duration of fadeout
  1652.     write_short( holdtime );    // Hold time of color
  1653.     write_short( fadetype );    // Fade type
  1654.     write_byte ( red );        // Red
  1655.     write_byte ( green );        // Green
  1656.     write_byte ( blue );        // Blue
  1657.     write_byte ( alpha );    // Alpha
  1658.     message_end();
  1659. }
  1660.  
  1661. stock set_user_clip(id, ammo)
  1662. {
  1663.     new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
  1664.     get_weaponname(weapon, weaponname, 31);
  1665.     while ((weaponid = find_ent_by_class(weaponid, weaponname)) != 0)
  1666.         if(entity_get_edict(weaponid, EV_ENT_owner) == id)
  1667.         {
  1668.             set_pdata_int(weaponid, 51, ammo, 4);
  1669.             return weaponid;
  1670.         }
  1671.     return 0;
  1672. }
  1673. public userhelp(id)
  1674. {
  1675.     //create info/help.txt in your mod folder and put your info there as you add in motd  
  1676.     show_motd(id, "help.txt", "Help Motd")
  1677. }
  1678.  
  1679. stock ColorChat(const id, const input[], any:...)
  1680. {
  1681. new count = 1, players[32];
  1682. static msg[591];
  1683. vformat(msg, 590, input, 3);
  1684.  
  1685. replace_all(msg, 590, "!g", "^x04"); // Green Colour
  1686. replace_all(msg, 590, "!n", "^x01"); // Default Colour
  1687. replace_all(msg, 590, "!t", "^x03"); // Team Colour
  1688.    
  1689. if (id) players[0] = id; else get_players(players, count, "ch");
  1690. {
  1691. for (new i = 0; i < count; i++)
  1692. {
  1693. if (is_user_connected(players[i]))
  1694. {
  1695. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  1696. write_byte(players[i]);
  1697. write_string(msg);
  1698. message_end();
  1699.                }
  1700.          }
  1701.      }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top