hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.25. 14:13



Jelenlévő felhasználók

Jelenleg 166 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 165 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 10 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Lézer
HozzászólásElküldve: 2012.04.28. 09:54 
Offline
Őstag
Avatar

Csatlakozott: 2011.11.15. 16:29
Hozzászólások: 1142
Megköszönt másnak: 8 alkalommal
Megköszönték neki: 24 alkalommal
Valaki tudna nekem olyan linket küldeni,(lézer plugint) melyben azis benne van ,hogy raj módban nem tesz le lézert?!

_________________
[url=http://www.gametracker.com/server_info/188.227.227.114:27286/][img]http://cache.www.gametracker.com/server_info/188.227.227.114:27286/b_350_20_323957_202743_F19A15_111111.png[/img][/url]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.04.28. 15:18 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2011.09.18. 13:01
Hozzászólások: 4271
Megköszönt másnak: 55 alkalommal
Megköszönték neki: 514 alkalommal
KIKK!

_________________
Idk. Csak ugy funbooo.
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.04.28. 15:22 
Offline
Minden6ó
Avatar

Csatlakozott: 2011.01.19. 12:14
Hozzászólások: 4292
Megköszönt másnak: 219 alkalommal
Megköszönték neki: 287 alkalommal
DeteCT0R írta:

annyit mondok hogy ebbe van! vagyis ha át írod akkor nem lesz de jelenleg van raj módba lézer.

_________________
<<eb@>>Team Website - Közösség
17Buddies - Általam készített pályák.
GameBanana - Általam készített pályák/vágott hangok.

Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.04.28. 20:38 
Offline
Őstag
Avatar

Csatlakozott: 2011.11.15. 16:29
Hozzászólások: 1142
Megköszönt másnak: 8 alkalommal
Megköszönték neki: 24 alkalommal
Hogy irjam át?! Norbi csatolnád létszi,ha neked megvan .... Ty!

_________________
[url=http://www.gametracker.com/server_info/188.227.227.114:27286/][img]http://cache.www.gametracker.com/server_info/188.227.227.114:27286/b_350_20_323957_202743_F19A15_111111.png[/img][/url]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.04.29. 00:13 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2011.09.18. 13:01
Hozzászólások: 4271
Megköszönt másnak: 55 alkalommal
Megköszönték neki: 514 alkalommal
Nemar 1 cvart nemtudsz atalitani!Ott a cfg- fileban minden!

_________________
Idk. Csak ugy funbooo.
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.04.29. 13:00 
Offline
Minden6ó
Avatar

Csatlakozott: 2011.01.19. 12:14
Hozzászólások: 4292
Megköszönt másnak: 219 alkalommal
Megköszönték neki: 287 alkalommal
DeteCT0R írta:
Nemar 1 cvart nemtudsz atalitani!Ott a cfg- fileban minden!
chasper.cfg írta:
Hogy irjam át?! Norbi csatolnád létszi,ha neked megvan .... Ty!

DeteCTOR abba csak a túlélő módba meg nemesis módba lehet a cvart át álitani azt az sma-ba kell!
SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2. ?????? ???????????? Shidla [SGC] ?????????? ??? ???, ???? ??????? ??, ??? ?????? ????)))
  3. ICQ: 312-298-513
  4.  
  5. Shidla [SGC] | 2010 ???
  6.  
  7. 2.8.1 [Final Version] | 09.09.2010
  8. */
  9.  
  10. #include <amxmodx>
  11. #include <fakemeta>
  12. #include <hamsandwich>
  13. #include <xs>
  14. #include <zombieplague>
  15.  
  16. #if AMXX_VERSION_NUM < 180
  17. #assert AMX Mod X v1.8.0 or greater library required!
  18. #endif
  19.  
  20. #define PLUGIN "[ZP] LaserMine"
  21. #define VERSION "2.8.1"
  22. #define AUTHOR "SandStriker / Shidla / QuZ/DJ_WEST"
  23.  
  24. #define RemoveEntity(%1) engfunc(EngFunc_RemoveEntity,%1)
  25. #define TASK_PLANT 15100
  26. #define TASK_RESET 15500
  27. #define TASK_RELEASE 15900
  28.  
  29. #define LASERMINE_TEAM pev_iuser1 //EV_INT_iuser1
  30. #define LASERMINE_OWNER pev_iuser2 //EV_INT_iuser3
  31. #define LASERMINE_STEP pev_iuser3
  32. #define LASERMINE_HITING pev_iuser4
  33. #define LASERMINE_COUNT pev_fuser1
  34.  
  35. #define LASERMINE_POWERUP pev_fuser2
  36. #define LASERMINE_BEAMTHINK pev_fuser3
  37.  
  38. #define LASERMINE_BEAMENDPOINT pev_vuser1
  39. #define MAX_MINES 10
  40. #define MODE_LASERMINE 0
  41. #define OFFSET_TEAM 114
  42. #define OFFSET_MONEY 115
  43. #define OFFSET_DEATH 444
  44.  
  45. #define cs_get_user_team(%1) CsTeams:get_offset_value(%1,OFFSET_TEAM)
  46. #define cs_get_user_deaths(%1) get_offset_value(%1,OFFSET_DEATH)
  47.  
  48. // ???? ?? ???? ???????????? ? ????. ???????? ???? ???????? ??????!
  49. new const LMCost = 10
  50.  
  51.  
  52. /*########### ????? ??? ? ???????? ????? ###########*/
  53. // ???? ???? ? ?????? ?????
  54. new const
  55. Red_Hum = 0,
  56. Green_Hum = 0,
  57. Blue_Hum = 255;
  58.  
  59. // ???? ???? ? ?????? ?????
  60. new const
  61. Red_Zomb = 255,
  62. Green_Zomb = 128,
  63. Blue_Zomb = 64;
  64. /*####### ????? ??? ? ???????? ????? (?????) #######*/
  65.  
  66. enum CsTeams {
  67. CS_TEAM_UNASSIGNED = 0,
  68. CS_TEAM_T = 1,
  69. CS_TEAM_CT = 2,
  70. CS_TEAM_SPECTATOR = 3
  71. };
  72.  
  73. enum tripmine_e {
  74. TRIPMINE_IDLE1 = 0,
  75. TRIPMINE_IDLE2,
  76. TRIPMINE_ARM1,
  77. TRIPMINE_ARM2,
  78. TRIPMINE_FIDGET,
  79. TRIPMINE_HOLSTER,
  80. TRIPMINE_DRAW,
  81. TRIPMINE_WORLD,
  82. TRIPMINE_GROUND,
  83. };
  84.  
  85. enum
  86. {
  87. POWERUP_THINK,
  88. BEAMBREAK_THINK,
  89. EXPLOSE_THINK
  90. };
  91.  
  92. enum
  93. {
  94. POWERUP_SOUND,
  95. ACTIVATE_SOUND,
  96. STOP_SOUND
  97. };
  98.  
  99. new const
  100. ENT_MODELS[] = "models/zombie_plague/LaserMines/v_laser_mine.mdl",
  101. ENT_SOUND1[] = "weapons/mine_deploy.wav",
  102. ENT_SOUND2[] = "weapons/mine_charge.wav",
  103. ENT_SOUND3[] = "weapons/mine_activate.wav",
  104. ENT_SOUND4[] = "items/suitchargeok1.wav",
  105. ENT_SOUND5[] = "items/gunpickup2.wav",
  106. ENT_SOUND6[] = "debris/bustglass1.wav",
  107. ENT_SOUND7[] = "debris/bustglass2.wav",
  108. ENT_SPRITE1[] = "sprites/laserbeam.spr",
  109. ENT_SPRITE2[] = "sprites/lm_explode.spr";
  110.  
  111. new const
  112. ENT_CLASS_NAME[] = "lasermine",
  113. ENT_CLASS_NAME3[] = "func_breakable",
  114. gSnarkClassName[] = "wpn_snark", // ??? ????????????? ? ???????? "Snark"
  115. barnacle_class[] = "barnacle", // ??? ????????????? ? ???????? "Barnacle"
  116. weapon_box[] = "weaponbox";
  117.  
  118. new g_EntMine, beam, boom
  119. new g_LENABLE, g_LFMONEY, g_LAMMO, g_LDMG, g_LBEO, g_LTMAX, g_LCOST, g_LHEALTH, g_LMODE, g_LRADIUS, g_NOROUND, g_NEMROUND, g_SURVROUND
  120. new g_LRDMG,g_LFF,g_LCBT, g_LDELAY, g_LVISIBLE, g_LSTAMMO, g_LACCESS, g_LGLOW, g_LDMGMODE, g_LCLMODE
  121. new g_LCBRIGHT, g_LDSEC, g_LCMDMODE, g_LBUYMODE, g_LME;
  122. new g_msgDeathMsg,g_msgScoreInfo,g_msgDamage,g_msgStatusText;
  123. new g_dcount[33],g_nowtime,g_MaxPL
  124. new bool:g_settinglaser[33]
  125. new Float:plspeed[33], plsetting[33], g_havemine[33], g_deployed[33];
  126. //new CVAR_LMCost
  127.  
  128. public plugin_init()
  129. {
  130. register_plugin(PLUGIN, VERSION, AUTHOR);
  131.  
  132. // ???????????? ExtraItem
  133.  
  134. g_LME = zp_register_extra_item("Laser Mine", LMCost, ZP_TEAM_ANY)
  135.  
  136. // ???????? ??????? Laser_TakeDamage ??? ????????? ????? ???????? ENT_CLASS_NAME3 (func_breakable)
  137. RegisterHam(Ham_TakeDamage, ENT_CLASS_NAME3, "Laser_TakeDamage")
  138. // Add your code here...
  139. register_clcmd("+setlaser","CreateLaserMine_Progress_b");
  140. register_clcmd("-setlaser","StopCreateLaserMine");
  141. register_clcmd("+dellaser","ReturnLaserMine_Progress");
  142. register_clcmd("-dellaser","StopReturnLaserMine");
  143. register_clcmd("say","say_lasermine");
  144. register_clcmd("buy_lasermine","BuyLasermine");
  145.  
  146. g_LENABLE = register_cvar("zp_ltm","1")
  147. g_LACCESS = register_cvar("zp_ltm_acs","0") //0 all, 1 admin
  148. g_LMODE = register_cvar("zp_ltm_mode","0") //0 lasermine, 1 tripmine
  149. g_LAMMO = register_cvar("zp_ltm_ammo","3")
  150. g_LDMG = register_cvar("zp_ltm_dmg","1") //laser hit dmg
  151. g_LCOST = register_cvar("zp_ltm_cost","10")
  152. g_LFMONEY = register_cvar("zp_ltm_fragmoney","1")
  153. g_LHEALTH = register_cvar("zp_ltm_health","5")
  154. g_LTMAX = register_cvar("zp_ltm_teammax","100")
  155. g_LRADIUS = register_cvar("zp_ltm_radius","320.0")
  156. g_LRDMG = register_cvar("zp_ltm_rdmg","100") //radius damage
  157. g_LFF = register_cvar("zp_ltm_ff","0")
  158. g_LCBT = register_cvar("zp_ltm_cbt","ALL")
  159. g_LDELAY = register_cvar("zp_ltm_delay","0.1")
  160. g_LVISIBLE = register_cvar("zp_ltm_line","1")
  161. g_LGLOW = register_cvar("zp_ltm_glow","0")
  162. g_LCBRIGHT = register_cvar("zp_ltm_bright","255")//laser line brightness.
  163. g_LCLMODE = register_cvar("zp_ltm_color","0") //0 is team color,1 is green
  164. g_LDMGMODE = register_cvar("zp_ltm_ldmgmode","0") //0 - frame dmg, 1 - once dmg, 2 - 1 second dmg
  165. g_LDSEC = register_cvar("zp_ltm_ldmgseconds","1") //mode 2 only, damage / seconds. default 1 (sec)
  166. g_LSTAMMO = register_cvar("zp_ltm_startammo","1")
  167. g_LBUYMODE = register_cvar("zp_ltm_buymode","1");
  168. g_LCMDMODE = register_cvar("zp_ltm_cmdmode","0"); //0 is +USE key, 1 is bind, 2 is each.
  169. g_LBEO = register_cvar("zp_ltm_brokeenemy","1");
  170. g_NOROUND = register_cvar("zp_ltm_noround","1");
  171. g_NEMROUND = register_cvar("zp_ltm_nemround","1");
  172. g_SURVROUND = register_cvar("zp_ltm_survround","1");
  173.  
  174. register_event("DeathMsg", "DeathEvent", "a");
  175. register_event("CurWeapon", "standing", "be", "1=1");
  176. register_event("ResetHUD", "delaycount", "a");
  177. register_event("ResetHUD", "newround", "b");
  178. register_logevent("endround", 2, "0=World triggered", "1=Round_End"); // ???????????? ????? ??????
  179. register_event("Damage","CutDeploy_onDamage","b");
  180. g_msgDeathMsg = get_user_msgid("DeathMsg");
  181. g_msgScoreInfo = get_user_msgid("ScoreInfo");
  182. g_msgDamage = get_user_msgid("Damage");
  183. g_msgStatusText = get_user_msgid("StatusText");
  184.  
  185. // Forward.
  186. register_forward(FM_Think, "ltm_Think");
  187. register_forward(FM_PlayerPostThink, "ltm_PostThink");
  188. register_forward(FM_PlayerPreThink, "ltm_PreThink");
  189.  
  190. // ??????????? ???? ??????
  191. register_dictionary("LaserMines.txt")
  192. register_cvar("Shidla", "[ZP] LaserMines v.2.8.1 Final", FCVAR_SERVER|FCVAR_SPONLY)
  193. }
  194.  
  195. public plugin_precache()
  196. {
  197. precache_sound(ENT_SOUND1);
  198. precache_sound(ENT_SOUND2);
  199. precache_sound(ENT_SOUND3);
  200. precache_sound(ENT_SOUND4);
  201. precache_sound(ENT_SOUND5);
  202. precache_sound(ENT_SOUND6);
  203. precache_sound(ENT_SOUND7);
  204. precache_model(ENT_MODELS);
  205. beam = precache_model(ENT_SPRITE1);
  206. boom = precache_model(ENT_SPRITE2);
  207. return PLUGIN_CONTINUE;
  208. }
  209.  
  210. public plugin_modules()
  211. {
  212. require_module("fakemeta");
  213. require_module("cstrike");
  214. }
  215.  
  216. public plugin_cfg()
  217. {
  218. g_EntMine = engfunc(EngFunc_AllocString,ENT_CLASS_NAME3);
  219. arrayset(g_havemine,0,sizeof(g_havemine));
  220. arrayset(g_deployed,0,sizeof(g_deployed));
  221. g_MaxPL = get_maxplayers();
  222.  
  223. new file[64]; get_localinfo("amxx_configsdir",file,63);
  224. format(file, 63, "%s/zp_ltm_cvars_ap.cfg", file);
  225. if(file_exists(file)) server_cmd("exec %s", file), server_exec();
  226. }
  227.  
  228. public Laser_TakeDamage(victim, inflictor, attacker, Float:f_Damage, bit_Damage)
  229. {
  230. if(get_pcvar_num(g_LBEO))
  231. {
  232. new i_Owner
  233.  
  234. // ???????? ID ??????, ??????? ???????? ????
  235. i_Owner = pev(victim, LASERMINE_OWNER)
  236.  
  237. // ???? ??????? ????, ??? ???????? ???? ? ????, ??? ???????? ?????????
  238. if(CsTeams:pev(victim, LASERMINE_TEAM) == cs_get_user_team(attacker))
  239. // ???? ??? ??? ???????? ????, ?? ????????? ? ???, ??? ?? ????????, ?? ?????????? ??????????
  240. if(i_Owner != attacker)
  241. return HAM_SUPERCEDE
  242. return PLUGIN_CONTINUE
  243. }
  244. return PLUGIN_CONTINUE
  245. }
  246.  
  247. public delaycount(id)
  248. {
  249. g_dcount[id] = floatround(get_gametime());
  250. }
  251.  
  252. bool:CheckTime(id)
  253. {
  254. g_nowtime = floatround(get_gametime()) - g_dcount[id];
  255. if(g_nowtime >= get_pcvar_num(g_LDELAY))
  256. return true;
  257. return false;
  258. }
  259.  
  260. public CreateLaserMine_Progress_b(id)
  261. {
  262. if(get_pcvar_num(g_LCMDMODE) != 0)
  263. CreateLaserMine_Progress(id);
  264. return PLUGIN_HANDLED;
  265. }
  266.  
  267. public CreateLaserMine_Progress(id)
  268. {
  269.  
  270. if(!CreateCheck(id))
  271. return PLUGIN_HANDLED;
  272. g_settinglaser[id] = true;
  273.  
  274. message_begin(MSG_ONE, 108, {0,0,0}, id);
  275. write_byte(1);
  276. write_byte(0);
  277. message_end();
  278.  
  279. set_task(1.2, "Spawn", (TASK_PLANT + id));
  280.  
  281. return PLUGIN_HANDLED;
  282. }
  283.  
  284. public ReturnLaserMine_Progress(id)
  285. {
  286.  
  287. if(!ReturnCheck(id))
  288. return PLUGIN_HANDLED;
  289. g_settinglaser[id] = true;
  290.  
  291. message_begin(MSG_ONE, 108, {0,0,0}, id);
  292. write_byte(1);
  293. write_byte(0);
  294. message_end();
  295.  
  296. set_task(1.2, "ReturnMine", (TASK_RELEASE + id));
  297.  
  298. return PLUGIN_HANDLED;
  299. }
  300.  
  301. public StopCreateLaserMine(id)
  302. {
  303.  
  304. DeleteTask(id);
  305. message_begin(MSG_ONE, 108, {0,0,0}, id);
  306. write_byte(0);
  307. write_byte(0);
  308. message_end();
  309.  
  310. return PLUGIN_HANDLED;
  311. }
  312.  
  313. public StopReturnLaserMine(id)
  314. {
  315.  
  316. DeleteTask(id);
  317. message_begin(MSG_ONE, 108, {0,0,0}, id);
  318. write_byte(0);
  319. write_byte(0);
  320. message_end();
  321.  
  322. return PLUGIN_HANDLED;
  323. }
  324.  
  325. public ReturnMine(id)
  326. {
  327. id -= TASK_RELEASE;
  328. new tgt,body,Float:vo[3],Float:to[3];
  329. get_user_aiming(id,tgt,body);
  330. if(!pev_valid(tgt)) return;
  331. pev(id,pev_origin,vo);
  332. pev(tgt,pev_origin,to);
  333. if(get_distance_f(vo,to) > 70.0) return;
  334. new EntityName[32];
  335. pev(tgt, pev_classname, EntityName, 31);
  336. if(!equal(EntityName, ENT_CLASS_NAME)) return;
  337. if(pev(tgt,LASERMINE_OWNER) != id) return;
  338. RemoveEntity(tgt);
  339.  
  340. g_havemine[id] ++;
  341. g_deployed[id] --;
  342. emit_sound(id, CHAN_ITEM, ENT_SOUND5, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  343. ShowAmmo(id)
  344.  
  345. return;
  346. }
  347.  
  348. public Spawn(id)
  349. {
  350. id -= TASK_PLANT
  351. // motor
  352. new i_Ent = engfunc(EngFunc_CreateNamedEntity,g_EntMine);
  353. if(!i_Ent)
  354. {
  355. client_print(id, print_chat,"[Laesrmine Debug] Can't Create Entity");
  356. return PLUGIN_HANDLED_MAIN;
  357. }
  358. set_pev(i_Ent,pev_classname,ENT_CLASS_NAME);
  359.  
  360. engfunc(EngFunc_SetModel,i_Ent,ENT_MODELS);
  361.  
  362. set_pev(i_Ent,pev_solid,SOLID_NOT);
  363. set_pev(i_Ent,pev_movetype,MOVETYPE_FLY);
  364.  
  365. set_pev(i_Ent,pev_frame,0);
  366. set_pev(i_Ent,pev_body,3);
  367. set_pev(i_Ent,pev_sequence,TRIPMINE_WORLD);
  368. set_pev(i_Ent,pev_framerate,0);
  369. set_pev(i_Ent,pev_takedamage,DAMAGE_YES);
  370. set_pev(i_Ent,pev_dmg,100.0);
  371. set_user_health(i_Ent,get_pcvar_num(g_LHEALTH));
  372. new Float:vOrigin[3];
  373. new Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
  374. Float:vTraceEnd[3],Float:vEntAngles[3];
  375. pev(id, pev_origin, vOrigin);
  376. velocity_by_aim(id, 128, vTraceDirection);
  377. xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
  378. engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
  379. new Float:fFraction;
  380. get_tr2(0, TR_flFraction, fFraction);
  381.  
  382. // -- We hit something!
  383. if(fFraction < 1.0)
  384. {
  385. // -- Save results to be used later.
  386. get_tr2(0, TR_vecEndPos, vTraceEnd);
  387. get_tr2(0, TR_vecPlaneNormal, vNormal);
  388. }
  389.  
  390.  
  391. xs_vec_mul_scalar(vNormal, 8.0, vNormal);
  392. xs_vec_add(vTraceEnd, vNormal, vNewOrigin);
  393.  
  394. engfunc(EngFunc_SetSize, i_Ent, Float:{ -4.0, -4.0, -4.0 }, Float:{ 4.0, 4.0, 4.0 });
  395. engfunc(EngFunc_SetOrigin, i_Ent, vNewOrigin);
  396.  
  397. // -- Rotate tripmine.
  398. vector_to_angle(vNormal,vEntAngles);
  399. set_pev(i_Ent,pev_angles,vEntAngles);
  400.  
  401. // -- Calculate laser end origin.
  402. new Float:vBeamEnd[3], Float:vTracedBeamEnd[3];
  403.  
  404. xs_vec_mul_scalar(vNormal, 8192.0, vNormal);
  405. xs_vec_add(vNewOrigin, vNormal, vBeamEnd);
  406.  
  407. engfunc(EngFunc_TraceLine, vNewOrigin, vBeamEnd, IGNORE_MONSTERS, -1, 0);
  408.  
  409. get_tr2(0, TR_vecPlaneNormal, vNormal);
  410. get_tr2(0, TR_vecEndPos, vTracedBeamEnd);
  411.  
  412. // -- Save results to be used later.
  413. set_pev(i_Ent, LASERMINE_OWNER, id);
  414. set_pev(i_Ent,LASERMINE_BEAMENDPOINT,vTracedBeamEnd);
  415. set_pev(i_Ent,LASERMINE_TEAM,int:cs_get_user_team(id));
  416. new Float:fCurrTime = get_gametime();
  417.  
  418. set_pev(i_Ent,LASERMINE_POWERUP, fCurrTime + 2.5);
  419. set_pev(i_Ent,LASERMINE_STEP,POWERUP_THINK);
  420. set_pev(i_Ent,pev_nextthink, fCurrTime + 0.2);
  421.  
  422. PlaySound(i_Ent,POWERUP_SOUND);
  423. g_deployed[id]++;
  424. g_havemine[id]--;
  425. DeleteTask(id);
  426. ShowAmmo(id);
  427. return 1;
  428. }
  429.  
  430. stock TeamDeployedCount(id)
  431. {
  432. static i;
  433. static CsTeams:t;t = cs_get_user_team(id);
  434. static cnt;cnt=0;
  435.  
  436. for(i = 1;i <= g_MaxPL;i++)
  437. {
  438. if(is_user_connected(i))
  439. if(t == cs_get_user_team(i))
  440. cnt += g_deployed[i];
  441. }
  442.  
  443. return cnt;
  444. }
  445.  
  446. bool:CheckCanTeam(id)
  447. {
  448. new arg[5],CsTeam:num;
  449. get_pcvar_string(g_LCBT,arg,3);
  450. if(equali(arg,"Z"))
  451. {
  452. num = CsTeam:CS_TEAM_T;
  453. }
  454. else if(equali(arg,"H"))
  455. {
  456. num = CsTeam:CS_TEAM_CT;
  457. }
  458. else if(equali(arg,"ALL") || equali(arg,"HZ") || equali(arg,"ZH"))
  459. {
  460. num = CsTeam:CS_TEAM_UNASSIGNED;
  461. }
  462. else
  463. {
  464. num = CsTeam:CS_TEAM_UNASSIGNED;
  465. }
  466. if(num != CsTeam:CS_TEAM_UNASSIGNED && num != CsTeam:cs_get_user_team(id))
  467. return false;
  468. return true;
  469. }
  470.  
  471. bool:CanCheck(id,mode) // ????????: ????? ????? ??????? ????
  472. {
  473. if(!get_pcvar_num(g_LENABLE))
  474. {
  475. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NOTACTIVE")
  476.  
  477. return false;
  478. }
  479. if(get_pcvar_num(g_LACCESS) != 0)
  480. if(!(get_user_flags(id) & ADMIN_IMMUNITY))
  481. {
  482. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NOACCESS")
  483. return false;
  484. }
  485. if(!pev_user_alive(id)) return false;
  486. if(!CheckCanTeam(id))
  487. {
  488. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_CBT")
  489. return false;
  490. }
  491. if(mode == 0)
  492. {
  493. if(g_havemine[id] <= 0)
  494. {
  495. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_DONTHAVEMINE")
  496. return false;
  497. }
  498. }
  499. if(mode == 1)
  500. {
  501. if(get_pcvar_num(g_LBUYMODE) == 0)
  502. {
  503. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_CANTBUY")
  504. return false;
  505. }
  506. if(g_havemine[id] >= get_pcvar_num(g_LAMMO))
  507. {
  508. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_HAVEMAX")
  509. return false;
  510. }
  511. if(zp_get_user_ammo_packs(id) < get_pcvar_num(g_LCOST))
  512. {
  513. client_print(id, print_chat, "%L %L%d %L", id, "CHATTAG",id, "STR_NOMONEY",get_pcvar_num(g_LCOST),id, "STR_NEEDED")
  514. return false;
  515. }
  516. }
  517. if(!CheckTime(id))
  518. {
  519. client_print(id, print_chat, "%L %L %d %L", id, "CHATTAG",id, "STR_DELAY",get_pcvar_num(g_LDELAY)-g_nowtime,id, "STR_SECONDS")
  520. return false;
  521. }
  522.  
  523. return true;
  524. }
  525.  
  526. bool:ReturnCheck(id)
  527. {
  528. if(!CanCheck(id,-1)) return false;
  529. if(g_havemine[id] + 1 > get_pcvar_num(g_LAMMO)) return false;
  530. new tgt,body,Float:vo[3],Float:to[3];
  531. get_user_aiming(id,tgt,body);
  532. if(!pev_valid(tgt)) return false;
  533. pev(id,pev_origin,vo);
  534. pev(tgt,pev_origin,to);
  535. if(get_distance_f(vo,to) > 70.0) return false;
  536. new EntityName[32];
  537. pev(tgt, pev_classname, EntityName, 31);
  538. if(!equal(EntityName, ENT_CLASS_NAME)) return false;
  539. if(pev(tgt,LASERMINE_OWNER) != id) return false;
  540. return true;
  541. }
  542.  
  543. bool:CreateCheck(id)
  544. {
  545. if(!CanCheck(id,0)) return false;
  546.  
  547. // ???????? ?? ??????????
  548. if(!zp_has_round_started() && get_pcvar_num(g_NOROUND))
  549. {
  550. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NOROUND")
  551. return false;
  552. }
  553.  
  554. if(zp_is_nemesis_round() && get_pcvar_num(g_NEMROUND))
  555. {
  556. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NEMROUND")
  557. return false;
  558. }
  559.  
  560. if(zp_is_swarm_round())
  561. {
  562. client_print(id, print_chat, "[ZP][LM] Raj modban nem lehet lezert rakni!")
  563. return false;
  564. }
  565.  
  566. if(zp_is_survivor_round() && get_pcvar_num(g_SURVROUND))
  567. {
  568. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_SURVROUND")
  569. return false;
  570. }
  571.  
  572. if(g_deployed[id] >= get_pcvar_num(g_LAMMO))
  573. {
  574. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_MAXDEPLOY")
  575. return false;
  576. }
  577.  
  578. if(TeamDeployedCount(id) >= get_pcvar_num(g_LTMAX))
  579. {
  580. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_MANYPPL")
  581. return false;
  582. }
  583. new Float:vTraceDirection[3], Float:vTraceEnd[3],Float:vOrigin[3];
  584. pev(id, pev_origin, vOrigin);
  585. velocity_by_aim(id, 128, vTraceDirection);
  586. xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
  587. engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
  588. new Float:fFraction,Float:vTraceNormal[3];
  589. get_tr2(0, TR_flFraction, fFraction);
  590. // -- We hit something!
  591. if(fFraction < 1.0)
  592. {
  593. // -- Save results to be used later.
  594. get_tr2(0, TR_vecEndPos, vTraceEnd);
  595. get_tr2(0, TR_vecPlaneNormal, vTraceNormal);
  596.  
  597. return true;
  598. }
  599.  
  600. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_PLANTWALL")
  601. DeleteTask(id);
  602. // -- Did not touched something. (not solid)
  603. return false;
  604. }
  605.  
  606. public ltm_Think(i_Ent)
  607. {
  608. if(!pev_valid(i_Ent))
  609. return FMRES_IGNORED;
  610. new EntityName[32];
  611. pev(i_Ent, pev_classname, EntityName, 31);
  612. if(!get_pcvar_num(g_LENABLE)) return FMRES_IGNORED;
  613. // -- Entity is not a tripmine, ignoring the next...
  614. if(!equal(EntityName, ENT_CLASS_NAME))
  615. return FMRES_IGNORED;
  616.  
  617. static Float:fCurrTime;
  618. fCurrTime = get_gametime();
  619.  
  620. switch(pev(i_Ent, LASERMINE_STEP))
  621. {
  622. case POWERUP_THINK :
  623. {
  624. new Float:fPowerupTime;
  625. pev(i_Ent, LASERMINE_POWERUP, fPowerupTime);
  626.  
  627. if(fCurrTime > fPowerupTime)
  628. {
  629. set_pev(i_Ent, pev_solid, SOLID_BBOX);
  630. set_pev(i_Ent, LASERMINE_STEP, BEAMBREAK_THINK);
  631.  
  632. PlaySound(i_Ent, ACTIVATE_SOUND);
  633. }
  634. if(get_pcvar_num(g_LGLOW)!=0)
  635. {
  636. if(get_pcvar_num(g_LCLMODE)==0)
  637. {
  638. switch (pev(i_Ent,LASERMINE_TEAM))
  639. {
  640. // ???? ?????? ?????
  641. case CS_TEAM_T: set_rendering(i_Ent,kRenderFxGlowShell,Red_Zomb,Green_Zomb,Blue_Zomb,kRenderNormal,5);
  642. // ???? ?????? ????????
  643. case CS_TEAM_CT:set_rendering(i_Ent,kRenderFxGlowShell,Red_Hum,Green_Hum,Blue_Hum,kRenderNormal,5);
  644. }
  645. }else
  646. {
  647. // ???? ??????, ???? ????? "?????????? ??? ????" ????
  648. set_rendering(i_Ent,kRenderFxGlowShell,random_num(50 , 200),random_num(50 , 200),random_num(50 , 200),kRenderNormal,5);
  649. }
  650. }
  651. set_pev(i_Ent, pev_nextthink, fCurrTime + 0.1);
  652. }
  653. case BEAMBREAK_THINK :
  654. {
  655. static Float:vEnd[3],Float:vOrigin[3];
  656. pev(i_Ent, pev_origin, vOrigin);
  657. pev(i_Ent, LASERMINE_BEAMENDPOINT, vEnd);
  658.  
  659. static iHit, Float:fFraction;
  660. engfunc(EngFunc_TraceLine, vOrigin, vEnd, DONT_IGNORE_MONSTERS, i_Ent, 0);
  661.  
  662. get_tr2(0, TR_flFraction, fFraction);
  663. iHit = get_tr2(0, TR_pHit);
  664.  
  665. // -- Something has passed the laser.
  666. if(fFraction < 1.0)
  667. {
  668. // -- Ignoring others tripmines entity.
  669. if(pev_valid(iHit))
  670. {
  671. pev(iHit, pev_classname, EntityName, 31);
  672. // ??????? ?????? ?????
  673. if(!equal(EntityName, ENT_CLASS_NAME) && !equal(EntityName, gSnarkClassName) && !equal(EntityName, barnacle_class) && !equal(EntityName, weapon_box))
  674. {
  675. set_pev(i_Ent, pev_enemy, iHit);
  676.  
  677. if(get_pcvar_num(g_LMODE) == MODE_LASERMINE)
  678. CreateLaserDamage(i_Ent,iHit);
  679. else
  680. if(get_pcvar_num(g_LFF) || CsTeams:pev(i_Ent,LASERMINE_TEAM) != cs_get_user_team(iHit))
  681. set_pev(i_Ent, LASERMINE_STEP, EXPLOSE_THINK);
  682.  
  683. if (!pev_valid(i_Ent)) // ???? ?? ?????? ?????? - ?????? ?? ??????. ??????? DJ_WEST
  684. return FMRES_IGNORED;
  685.  
  686. set_pev(i_Ent, pev_nextthink, fCurrTime + random_float(0.1, 0.3));
  687. }
  688. }
  689. }
  690. if(get_pcvar_num(g_LDMGMODE)!=0)
  691. if(pev(i_Ent,LASERMINE_HITING) != iHit)
  692. set_pev(i_Ent,LASERMINE_HITING,iHit);
  693.  
  694. // -- Tripmine is still there.
  695. if(pev_valid(i_Ent))
  696. {
  697. static Float:fHealth;
  698. pev(i_Ent, pev_health, fHealth);
  699.  
  700. if(fHealth <= 0.0 || (pev(i_Ent,pev_flags) & FL_KILLME))
  701. {
  702. set_pev(i_Ent, LASERMINE_STEP, EXPLOSE_THINK);
  703. set_pev(i_Ent, pev_nextthink, fCurrTime + random_float(0.1, 0.3));
  704. }
  705.  
  706. static Float:fBeamthink;
  707. pev(i_Ent, LASERMINE_BEAMTHINK, fBeamthink);
  708.  
  709. if(fBeamthink < fCurrTime && get_pcvar_num(g_LVISIBLE))
  710. {
  711. DrawLaser(i_Ent, vOrigin, vEnd);
  712. set_pev(i_Ent, LASERMINE_BEAMTHINK, fCurrTime + 0.1);
  713. }
  714. set_pev(i_Ent, pev_nextthink, fCurrTime + 0.01);
  715. }
  716. }
  717. case EXPLOSE_THINK :
  718. {
  719. // -- Stopping entity to think
  720. set_pev(i_Ent, pev_nextthink, 0.0);
  721. PlaySound(i_Ent, STOP_SOUND);
  722. g_deployed[pev(i_Ent,LASERMINE_OWNER)]--;
  723. CreateExplosion(i_Ent);
  724. CreateDamage(i_Ent,get_pcvar_float(g_LRDMG),get_pcvar_float(g_LRADIUS))
  725. RemoveEntity (i_Ent);
  726. }
  727. }
  728.  
  729. return FMRES_IGNORED;
  730. }
  731.  
  732. PlaySound(i_Ent, i_SoundType)
  733. {
  734. switch (i_SoundType)
  735. {
  736. case POWERUP_SOUND :
  737. {
  738. emit_sound(i_Ent, CHAN_VOICE, ENT_SOUND1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  739. emit_sound(i_Ent, CHAN_BODY , ENT_SOUND2, 0.2, ATTN_NORM, 0, PITCH_NORM);
  740. }
  741. case ACTIVATE_SOUND :
  742. {
  743. emit_sound(i_Ent, CHAN_VOICE, ENT_SOUND3, 0.5, ATTN_NORM, 1, 75);
  744. }
  745. case STOP_SOUND :
  746. {
  747. emit_sound(i_Ent, CHAN_BODY , ENT_SOUND2, 0.2, ATTN_NORM, SND_STOP, PITCH_NORM);
  748. emit_sound(i_Ent, CHAN_VOICE, ENT_SOUND3, 0.5, ATTN_NORM, SND_STOP, 75);
  749. }
  750. }
  751. }
  752.  
  753. DrawLaser(i_Ent, const Float:v_Origin[3], const Float:v_EndOrigin[3])
  754. {
  755. new tcolor[3];
  756. new teamid = pev(i_Ent, LASERMINE_TEAM);
  757. if(get_pcvar_num(g_LCLMODE) == 0)
  758. {
  759. switch(teamid){
  760. case 1:{
  761. // ???? ???? ??? ?????
  762. tcolor[0] = Red_Zomb;
  763. tcolor[1] = Green_Zomb;
  764. tcolor[2] = Blue_Zomb;
  765. }
  766. case 2:{
  767. // ???? ???? ??? ????????
  768. tcolor[0] = Red_Hum;
  769. tcolor[1] = Green_Hum;
  770. tcolor[2] = Blue_Hum;
  771. }
  772. }
  773. }else
  774. {
  775. // ???? ???? ??? ???? ??? ?????? 1-? ??? ??? ????
  776. tcolor[0] = random_num(50 , 200);
  777. tcolor[1] = random_num(50 , 200);
  778. tcolor[2] = random_num(50 , 200);
  779. }
  780. message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  781. write_byte(TE_BEAMPOINTS);
  782. engfunc(EngFunc_WriteCoord,v_Origin[0]);
  783. engfunc(EngFunc_WriteCoord,v_Origin[1]);
  784. engfunc(EngFunc_WriteCoord,v_Origin[2]);
  785. engfunc(EngFunc_WriteCoord,v_EndOrigin[0]); //Random
  786. engfunc(EngFunc_WriteCoord,v_EndOrigin[1]); //Random
  787. engfunc(EngFunc_WriteCoord,v_EndOrigin[2]); //Random
  788. write_short(beam);
  789. write_byte(0);
  790. write_byte(0);
  791. write_byte(1); //Life
  792. write_byte(5); //Width
  793. write_byte(0); //wave
  794. write_byte(tcolor[0]); // r
  795. write_byte(tcolor[1]); // g
  796. write_byte(tcolor[2]); // b
  797. write_byte(get_pcvar_num(g_LCBRIGHT));
  798. write_byte(255);
  799. message_end();
  800. }
  801.  
  802. CreateDamage(iCurrent,Float:DmgMAX,Float:Radius)
  803. {
  804. // Get given parameters
  805. new Float:vecSrc[3];
  806. pev(iCurrent, pev_origin, vecSrc);
  807.  
  808. new AtkID =pev(iCurrent,LASERMINE_OWNER);
  809. new TeamID=pev(iCurrent,LASERMINE_TEAM);
  810.  
  811. new ent = -1;
  812. new Float:tmpdmg = DmgMAX;
  813.  
  814. new Float:kickback = 0.0;
  815. // Needed for doing some nice calculations
  816. new Float:Tabsmin[3], Float:Tabsmax[3];
  817. new Float:vecSpot[3];
  818. new Float:Aabsmin[3], Float:Aabsmax[3];
  819. new Float:vecSee[3];
  820. new trRes;
  821. new Float:flFraction;
  822. new Float:vecEndPos[3];
  823. new Float:distance;
  824. new Float:origin[3], Float:vecPush[3];
  825. new Float:invlen;
  826. new Float:velocity[3];
  827. new iHitHP,iHitTeam;
  828. // Calculate falloff
  829. new Float:falloff;
  830. if(Radius > 0.0)
  831. {
  832. falloff = DmgMAX / Radius;
  833. } else {
  834. falloff = 1.0;
  835. }
  836. // Find monsters and players inside a specifiec radius
  837. while((ent = engfunc(EngFunc_FindEntityInSphere, ent, vecSrc, Radius)) != 0)
  838. {
  839. if(!pev_valid(ent)) continue;
  840. if(!(pev(ent, pev_flags) & (FL_CLIENT | FL_FAKECLIENT | FL_MONSTER)))
  841. {
  842. // Entity is not a player or monster, ignore it
  843. continue;
  844. }
  845. if(!pev_user_alive(ent)) continue;
  846. // Reset data
  847. kickback = 1.0;
  848. tmpdmg = DmgMAX;
  849. // The following calculations are provided by Orangutanz, THANKS!
  850. // We use absmin and absmax for the most accurate information
  851. pev(ent, pev_absmin, Tabsmin);
  852. pev(ent, pev_absmax, Tabsmax);
  853. xs_vec_add(Tabsmin,Tabsmax,Tabsmin);
  854. xs_vec_mul_scalar(Tabsmin,0.5,vecSpot);
  855. pev(iCurrent, pev_absmin, Aabsmin);
  856. pev(iCurrent, pev_absmax, Aabsmax);
  857. xs_vec_add(Aabsmin,Aabsmax,Aabsmin);
  858. xs_vec_mul_scalar(Aabsmin,0.5,vecSee);
  859. engfunc(EngFunc_TraceLine, vecSee, vecSpot, 0, iCurrent, trRes);
  860. get_tr2(trRes, TR_flFraction, flFraction);
  861. // Explosion can 'see' this entity, so hurt them! (or impact through objects has been enabled xD)
  862. if(flFraction >= 0.9 || get_tr2(trRes, TR_pHit) == ent)
  863. {
  864. // Work out the distance between impact and entity
  865. get_tr2(trRes, TR_vecEndPos, vecEndPos);
  866. distance = get_distance_f(vecSrc, vecEndPos) * falloff;
  867. tmpdmg -= distance;
  868. if(tmpdmg < 0.0)
  869. tmpdmg = 0.0;
  870. // Kickback Effect
  871. if(kickback != 0.0)
  872. {
  873. xs_vec_sub(vecSpot,vecSee,origin);
  874. invlen = 1.0/get_distance_f(vecSpot, vecSee);
  875.  
  876. xs_vec_mul_scalar(origin,invlen,vecPush);
  877. pev(ent, pev_velocity, velocity)
  878. xs_vec_mul_scalar(vecPush,tmpdmg,vecPush);
  879. xs_vec_mul_scalar(vecPush,kickback,vecPush);
  880. xs_vec_add(velocity,vecPush,velocity);
  881. if(tmpdmg < 60.0)
  882. {
  883. xs_vec_mul_scalar(velocity,12.0,velocity);
  884. } else {
  885. xs_vec_mul_scalar(velocity,4.0,velocity);
  886. }
  887. if(velocity[0] != 0.0 || velocity[1] != 0.0 || velocity[2] != 0.0)
  888. {
  889. // There's some movement todo
  890. set_pev(ent, pev_velocity, velocity)
  891. }
  892. }
  893.  
  894. iHitHP = pev_user_health(ent) - floatround(tmpdmg)
  895. iHitTeam = int:cs_get_user_team(ent)
  896. if(iHitHP <= 0)
  897. {
  898. if(iHitTeam != TeamID)
  899. {
  900. zp_set_user_ammo_packs(AtkID,zp_get_user_ammo_packs(AtkID) + get_pcvar_num(g_LFMONEY))
  901. set_score(AtkID,ent,1,iHitHP)
  902. }else
  903. {
  904. if(get_pcvar_num(g_LFF))
  905. {
  906. zp_set_user_ammo_packs(AtkID,zp_get_user_ammo_packs(AtkID) - get_pcvar_num(g_LFMONEY))
  907. set_score(AtkID,ent,-1,iHitHP)
  908. }
  909. }
  910. }else
  911. {
  912. if(iHitTeam != TeamID || get_pcvar_num(g_LFF))
  913. {
  914. //set_pev(Player,pev_health,iHitHP)
  915. set_user_health(ent, iHitHP)
  916. engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},ent);
  917. write_byte(floatround(tmpdmg))
  918. write_byte(floatround(tmpdmg))
  919. write_long(DMG_BULLET)
  920. engfunc(EngFunc_WriteCoord,vecSrc[0])
  921. engfunc(EngFunc_WriteCoord,vecSrc[1])
  922. engfunc(EngFunc_WriteCoord,vecSrc[2])
  923. message_end()
  924. }
  925. }
  926. }
  927. }
  928. return
  929. }
  930.  
  931. bool:pev_user_alive(ent)
  932. {
  933. new deadflag = pev(ent,pev_deadflag);
  934. if(deadflag != DEAD_NO)
  935. return false;
  936. return true;
  937. }
  938.  
  939. CreateExplosion(iCurrent)
  940. {
  941. new Float:vOrigin[3];
  942. pev(iCurrent,pev_origin,vOrigin);
  943.  
  944. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  945. write_byte(99); //99 = KillBeam
  946. write_short(iCurrent);
  947. message_end();
  948.  
  949. engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vOrigin, 0);
  950. write_byte(TE_EXPLOSION);
  951. engfunc(EngFunc_WriteCoord,vOrigin[0]);
  952. engfunc(EngFunc_WriteCoord,vOrigin[1]);
  953. engfunc(EngFunc_WriteCoord,vOrigin[2]);
  954. write_short(boom);
  955. write_byte(30);
  956. write_byte(15);
  957. write_byte(0);
  958. message_end();
  959. }
  960.  
  961. CreateLaserDamage(iCurrent,isHit)
  962. {
  963. if(isHit < 0) return PLUGIN_CONTINUE
  964. switch(get_pcvar_num(g_LDMGMODE))
  965. {
  966. case 1:
  967. {
  968. if(pev(iCurrent,LASERMINE_HITING) == isHit)
  969. return PLUGIN_CONTINUE
  970. }
  971. case 2:
  972. {
  973. if(pev(iCurrent,LASERMINE_HITING) == isHit)
  974. {
  975. static Float:cnt
  976. static now,htime;now = floatround(get_gametime())
  977.  
  978. pev(iCurrent,LASERMINE_COUNT,cnt)
  979. htime = floatround(cnt)
  980. if(now - htime < get_pcvar_num(g_LDSEC))
  981. {
  982. return PLUGIN_CONTINUE;
  983. }else{
  984. set_pev(iCurrent,LASERMINE_COUNT,get_gametime())
  985. }
  986. }else
  987. {
  988. set_pev(iCurrent,LASERMINE_COUNT,get_gametime())
  989. }
  990. }
  991. }
  992.  
  993. new Float:vOrigin[3],Float:vEnd[3]
  994. pev(iCurrent,pev_origin,vOrigin)
  995. pev(iCurrent,pev_vuser1,vEnd)
  996.  
  997. new teamid = pev(iCurrent, LASERMINE_TEAM)
  998.  
  999. new szClassName[32]
  1000. new Alive,God
  1001. new iHitTeam,iHitHP,id
  1002. new hitscore
  1003.  
  1004. szClassName[0] = '^0'
  1005. pev(isHit,pev_classname,szClassName,32)
  1006. if((pev(isHit, pev_flags) & (FL_CLIENT | FL_FAKECLIENT | FL_MONSTER)))
  1007. {
  1008. Alive = pev_user_alive(isHit)
  1009. God = get_user_godmode(isHit)
  1010. if(!Alive || God) return PLUGIN_CONTINUE
  1011. iHitTeam = int:cs_get_user_team(isHit)
  1012. iHitHP = pev_user_health(isHit) - get_pcvar_num(g_LDMG)
  1013. id = pev(iCurrent,LASERMINE_OWNER)//, szNetName[32]
  1014. if(iHitHP <= 0)
  1015. {
  1016. if(iHitTeam != teamid)
  1017. {
  1018. emit_sound(isHit, CHAN_WEAPON, ENT_SOUND4, 1.0, ATTN_NORM, 0, PITCH_NORM)
  1019. hitscore = 1
  1020. zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id) + get_pcvar_num(g_LFMONEY))
  1021. set_score(id,isHit,hitscore,iHitHP)
  1022. }else
  1023. {
  1024. if(get_pcvar_num(g_LFF))
  1025. {
  1026. emit_sound(isHit, CHAN_WEAPON, ENT_SOUND4, 1.0, ATTN_NORM, 0, PITCH_NORM)
  1027. hitscore = -1
  1028. zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id) - get_pcvar_num(g_LFMONEY))
  1029. set_score(id,isHit,hitscore,iHitHP)
  1030. }
  1031. }
  1032. }else if(iHitTeam != teamid || get_pcvar_num(g_LFF))
  1033. {
  1034. emit_sound(isHit, CHAN_WEAPON, ENT_SOUND4, 1.0, ATTN_NORM, 0, PITCH_NORM)
  1035. set_user_health(isHit,iHitHP)
  1036. set_pev(iCurrent,LASERMINE_HITING,isHit);
  1037. engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},isHit);
  1038. write_byte(get_pcvar_num(g_LDMG))
  1039. write_byte(get_pcvar_num(g_LDMG))
  1040. write_long(DMG_BULLET)
  1041. engfunc(EngFunc_WriteCoord,vOrigin[0])
  1042. engfunc(EngFunc_WriteCoord,vOrigin[1])
  1043. engfunc(EngFunc_WriteCoord,vOrigin[2])
  1044. message_end()
  1045. }
  1046. }else if(equal(szClassName, ENT_CLASS_NAME3))
  1047. {
  1048. new hl;
  1049. hl = pev_user_health(isHit);
  1050. set_user_health(isHit,hl-get_pcvar_num(g_LDMG));
  1051. }
  1052. return PLUGIN_CONTINUE
  1053. }
  1054.  
  1055. stock pev_user_health(id)
  1056. {
  1057. new Float:health
  1058. pev(id,pev_health,health)
  1059. return floatround(health)
  1060. }
  1061.  
  1062. stock set_user_health(id,health)
  1063. {
  1064. health > 0 ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
  1065. }
  1066.  
  1067. stock get_user_godmode(index) {
  1068. new Float:val
  1069. pev(index, pev_takedamage, val)
  1070.  
  1071. return (val == DAMAGE_NO)
  1072. }
  1073.  
  1074. stock set_user_frags(index, frags)
  1075. {
  1076. set_pev(index, pev_frags, float(frags))
  1077.  
  1078. return 1
  1079. }
  1080.  
  1081. stock pev_user_frags(index)
  1082. {
  1083. new Float:frags;
  1084. pev(index,pev_frags,frags);
  1085. return floatround(frags);
  1086. }
  1087.  
  1088. set_score(id,target,hitscore,HP){
  1089.  
  1090. new idfrags = pev_user_frags(id) + hitscore// get_user_frags(id) + hitscore
  1091. set_user_frags(id,idfrags)
  1092. new tarfrags = pev_user_frags(target) + 1 //get_user_frags(target) + 1
  1093. set_user_frags(target,tarfrags)
  1094. new idteam = int:cs_get_user_team(id)
  1095. new iddeaths = cs_get_user_deaths(id)
  1096.  
  1097.  
  1098. message_begin(MSG_ALL, g_msgDeathMsg, {0, 0, 0} ,0)
  1099. write_byte(id)
  1100. write_byte(target)
  1101. write_byte(0)
  1102. write_string(ENT_CLASS_NAME)
  1103. message_end()
  1104.  
  1105. message_begin(MSG_ALL, g_msgScoreInfo)
  1106. write_byte(id)
  1107. write_short(idfrags)
  1108. write_short(iddeaths)
  1109. write_short(0)
  1110. write_short(idteam)
  1111. message_end()
  1112.  
  1113. set_msg_block(g_msgDeathMsg, BLOCK_ONCE)
  1114.  
  1115. set_user_health(target, HP)
  1116.  
  1117. }
  1118.  
  1119. public BuyLasermine(id)
  1120. {
  1121. if(!CanCheck(id,1)) return PLUGIN_CONTINUE
  1122.  
  1123. zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id) - get_pcvar_num(g_LCOST))
  1124. g_havemine[id]++;
  1125.  
  1126. client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_BOUGHT")
  1127.  
  1128. emit_sound(id, CHAN_ITEM, ENT_SOUND5, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  1129. ShowAmmo(id)
  1130. return PLUGIN_HANDLED
  1131. }
  1132.  
  1133. public zp_extra_item_selected(id, itemid)
  1134. {
  1135. if(itemid == g_LME)
  1136. {
  1137. zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + LMCost)
  1138. BuyLasermine(id)
  1139. }
  1140. return PLUGIN_CONTINUE
  1141. }
  1142.  
  1143. ShowAmmo(id)
  1144. {
  1145. new ammo[51]
  1146. new PlugStat[ 555 char ];
  1147. formatex(PlugStat, charsmax(PlugStat), "%L", LANG_PLAYER, "STR_STATE")
  1148. formatex(ammo, 50, "%s %i/%i",PlugStat, g_havemine[id],get_pcvar_num(g_LAMMO))
  1149.  
  1150. message_begin(MSG_ONE, g_msgStatusText, {0,0,0}, id)
  1151. write_byte(0)
  1152. write_string(ammo)
  1153. message_end()
  1154. }
  1155.  
  1156. public showInfo(id)
  1157. {
  1158. client_print(id, print_chat, "%L", id, "STR_REF")
  1159. }
  1160.  
  1161. public say_lasermine(id){
  1162. new said[32]
  1163. read_argv(1,said,31);
  1164. if(!get_pcvar_num(g_LENABLE))
  1165. {
  1166. return PLUGIN_CONTINUE
  1167. }
  1168. if(equali(said,"/buy lasermine")||equali(said,"/lm")||equali(said,"buy_lasermine")){
  1169. BuyLasermine(id)
  1170. }else if(equali(said, "lasermine") || equali(said, "/lasermine")){
  1171. const SIZE = 1024
  1172. new msg[SIZE+1],len = 0;
  1173. len += formatex(msg[len], SIZE - len, "<html><body>")
  1174. len += formatex(msg[len], SIZE - len, "<p><b>Lezer</b></p><br/><br/>")
  1175. len += formatex(msg[len], SIZE - len, "<p>Lezert levegobe nem rakhatod.</p><br/>")
  1176. len += formatex(msg[len], SIZE - len, "<p>Ha valaki belemgya a lezeredbe azonnal meghal.</p><br/><br/>")
  1177. len += formatex(msg[len], SIZE - len, "<p><b>Lezer parancsok</b></p><br/><br/>")
  1178. len += formatex(msg[len], SIZE - len, "<p><b>Say /buy lasermine</b> vagy <b>Say /lm</b> //lezer vasarlas<br/>")
  1179. len += formatex(msg[len], SIZE - len, "<b>buy_lasermine</b> //bind ^"F2^" buy_lasermine : f2 vel vehetsz lezert<br/>")
  1180. len += formatex(msg[len], SIZE - len, "<b>bind v +setlaser</b> lezer lerakas <b>bind c +dellaser</b> lezer felveves.<br/>")
  1181. len += formatex(msg[len], SIZE - len, "</body></html>")
  1182. show_motd(id, msg, "Lasermine Entity help")
  1183. return PLUGIN_CONTINUE
  1184. }
  1185. else if(containi(said, "laser") != -1) {
  1186. showInfo(id)
  1187. return PLUGIN_CONTINUE
  1188. }
  1189. return PLUGIN_CONTINUE
  1190. }
  1191.  
  1192. public standing(id)
  1193. {
  1194. if(!g_settinglaser[id])
  1195. return PLUGIN_CONTINUE
  1196.  
  1197. set_pev(id, pev_maxspeed, 1.0)
  1198.  
  1199. return PLUGIN_CONTINUE
  1200. }
  1201.  
  1202. public ltm_PostThink(id)
  1203. {
  1204. if(!g_settinglaser[id] && plsetting[id]){
  1205. resetspeed(id)
  1206. }
  1207. else if(g_settinglaser[id] && !plsetting[id]) {
  1208. pev(id, pev_maxspeed,plspeed[id])
  1209. set_pev(id, pev_maxspeed, 1.0)
  1210. }
  1211. plsetting[id] = g_settinglaser[id]
  1212. return FMRES_IGNORED
  1213. }
  1214.  
  1215. public ltm_PreThink(id)
  1216. {
  1217. if(!pev_user_alive(id) || g_settinglaser[id] == true || is_user_bot(id) || get_pcvar_num(g_LCMDMODE) == 1)
  1218. return FMRES_IGNORED;
  1219.  
  1220. if(pev(id, pev_button) & IN_USE && !(pev(id, pev_oldbuttons) & IN_USE))
  1221. CreateLaserMine_Progress(id)
  1222. return FMRES_IGNORED;
  1223. }
  1224.  
  1225. resetspeed(id)
  1226. {
  1227. set_pev(id, pev_maxspeed, plspeed[id])
  1228. }
  1229.  
  1230. public client_putinserver(id){
  1231. g_deployed[id] = 0;
  1232. g_havemine[id] = 0;
  1233. DeleteTask(id);
  1234. return PLUGIN_CONTINUE
  1235. }
  1236.  
  1237. public client_disconnect(id){
  1238. if(!get_pcvar_num(g_LENABLE))
  1239. return PLUGIN_CONTINUE
  1240. DeleteTask(id);
  1241. RemoveAllTripmines(id);
  1242. return PLUGIN_CONTINUE
  1243. }
  1244.  
  1245.  
  1246. public newround(id){
  1247. if(!get_pcvar_num(g_LENABLE))
  1248. return PLUGIN_CONTINUE
  1249. pev(id, pev_maxspeed,plspeed[id])
  1250. DeleteTask(id);
  1251. RemoveAllTripmines(id);
  1252. //client_print(id, print_chat, "[ZP][LM][DeBug] All Mines removied!");
  1253. delaycount(id);
  1254. SetStartAmmo(id);
  1255. return PLUGIN_CONTINUE
  1256. }
  1257.  
  1258. public endround(id)
  1259. {
  1260. if(!get_pcvar_num(g_LENABLE))
  1261. return PLUGIN_CONTINUE
  1262.  
  1263. // ???????? ??? ????? ????? ??????
  1264. DeleteTask(id);
  1265. RemoveAllTripmines(id);
  1266.  
  1267. return PLUGIN_CONTINUE
  1268. }
  1269.  
  1270. public DeathEvent(){
  1271. if(!get_pcvar_num(g_LENABLE))
  1272. return PLUGIN_CONTINUE
  1273.  
  1274. new id = read_data(2)
  1275. if(is_user_connected(id)) DeleteTask(id);
  1276. return PLUGIN_CONTINUE
  1277. }
  1278.  
  1279. public RemoveAllTripmines(i_Owner)
  1280. {
  1281. new iEnt = g_MaxPL + 1;
  1282. new clsname[32];
  1283. while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", ENT_CLASS_NAME)))
  1284. {
  1285. if(i_Owner)
  1286. {
  1287. if(pev(iEnt, LASERMINE_OWNER) != i_Owner)
  1288. continue;
  1289. clsname[0] = '^0'
  1290. pev(iEnt, pev_classname, clsname, sizeof(clsname)-1);
  1291. if(equali(clsname, ENT_CLASS_NAME))
  1292. {
  1293. PlaySound(iEnt, STOP_SOUND);
  1294. RemoveEntity(iEnt);
  1295. }
  1296. }
  1297. else
  1298. set_pev(iEnt, pev_flags, FL_KILLME);
  1299. }
  1300. g_deployed[i_Owner]=0;
  1301. }
  1302.  
  1303. SetStartAmmo(id)
  1304. {
  1305. new stammo = get_pcvar_num(g_LSTAMMO);
  1306. if(stammo <= 0) return PLUGIN_CONTINUE;
  1307. g_havemine[id] = (g_havemine[id] <= stammo) ? stammo : g_havemine[id];
  1308. return PLUGIN_CONTINUE;
  1309. }
  1310.  
  1311. public CutDeploy_onDamage(id)
  1312. {
  1313. if(get_user_health(id) < 1)
  1314. DeleteTask(id);
  1315. }
  1316.  
  1317. DeleteTask(id)
  1318. {
  1319. if(task_exists((TASK_PLANT + id)))
  1320. {
  1321. remove_task((TASK_PLANT + id))
  1322. }
  1323. if(task_exists((TASK_RELEASE + id)))
  1324. {
  1325. remove_task((TASK_RELEASE + id))
  1326. }
  1327. g_settinglaser[id] = false
  1328. return PLUGIN_CONTINUE;
  1329. }
  1330.  
  1331. stock set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  1332. {
  1333. static Float:RenderColor[3];
  1334. RenderColor[0] = float(r);
  1335. RenderColor[1] = float(g);
  1336. RenderColor[2] = float(b);
  1337.  
  1338. set_pev(entity, pev_renderfx, fx);
  1339. set_pev(entity, pev_rendercolor, RenderColor);
  1340. set_pev(entity, pev_rendermode, render);
  1341. set_pev(entity, pev_renderamt, float(amount));
  1342.  
  1343. return 1
  1344. }
  1345.  
  1346. // Gets offset data
  1347. get_offset_value(id, type)
  1348. {
  1349. new key = -1;
  1350. switch(type)
  1351. {
  1352. case OFFSET_TEAM: key = OFFSET_TEAM;
  1353. case OFFSET_MONEY:
  1354. key = OFFSET_MONEY;
  1355. case OFFSET_DEATH: key = OFFSET_DEATH;
  1356. }
  1357. if(key != -1)
  1358. {
  1359. if(is_amd64_server()) key += 25;
  1360. return get_pdata_int(id, key);
  1361. }
  1362. return -1;
  1363. }
itt van magyar meg nicsen lézer túlélő módba nemesis módba raj módba!

_________________
<<eb@>>Team Website - Közösség
17Buddies - Általam készített pályák.
GameBanana - Általam készített pályák/vágott hangok.

Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.05.11. 20:05 
Offline
Őstag
Avatar

Csatlakozott: 2011.11.15. 16:29
Hozzászólások: 1142
Megköszönt másnak: 8 alkalommal
Megköszönték neki: 24 alkalommal
Átalakítod és csatolnád létszi,mert nekem nemsikerül.:/

_________________
[url=http://www.gametracker.com/server_info/188.227.227.114:27286/][img]http://cache.www.gametracker.com/server_info/188.227.227.114:27286/b_350_20_323957_202743_F19A15_111111.png[/img][/url]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.05.14. 11:13 
Offline
Imperátor
Avatar

Csatlakozott: 2009.04.21. 09:33
Hozzászólások: 3991
Megköszönt másnak: 5 alkalommal
Megköszönték neki: 135 alkalommal
amxxet nem csatolunk.
Ha "nekem nem sikerült" ( :o :o :o ) hozzászólásod olyan bő s információdús adatokat tartalmazna a nálad felmerült fordítási problémádról a pluginnal kapcsolatban mint ez, a felesleges információtartalommal, s rizsázással tarkított általam írt hozzászólás, akkor nagyonnagy valószínűséggel tudnánk segíteni az általad vétett hibák megoldásával is... :!: :!: :!:

Lényeg: mi nem sikerült?

(u.i.: De most komolyan... az ilyen üzeneteket elvből töröljem? :twisted: )

_________________
Kód:
I'm back

Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.06.25. 14:23 
Offline
Tag
Avatar

Csatlakozott: 2012.04.24. 15:25
Hozzászólások: 47
Megköszönt másnak: 5 alkalommal
Megköszönték neki: 3 alkalommal
Ezt konvertáld át amxx-é és ez a modellt: models/zombie_plague/laser_new.mdl és ezt a spritet: sprites/lm_explode.spr -t. Töltsd le innen: http://zombie-mod.ru/zombie_plague/extr ... e-281.html és tedd fel. Ha nem teszed fel és nem irod át, kifagy a szerver.

Kód:
  1. #include <amxmodx>

  2. #include <fakemeta>

  3. #include <hamsandwich>

  4. #include <xs>

  5. #include <zombieplague>

  6.  

  7. #if AMXX_VERSION_NUM < 180

  8.         #assert AMX Mod X v1.8.0 or greater library required!

  9. #endif

  10.  

  11. #define PLUGIN "[ZP] LaserMine"

  12. #define VERSION "2.8"

  13. #define AUTHOR "SandStriker/Shidla/QuZ/DJ_WEST"

  14.  

  15. #define RemoveEntity(%1)        engfunc(EngFunc_RemoveEntity,%1)

  16. #define TASK_PLANT              15100

  17. #define TASK_RESET              15500

  18. #define TASK_RELEASE            15900

  19.  

  20. #define LASERMINE_TEAM          pev_iuser1 //EV_INT_iuser1

  21. #define LASERMINE_OWNER         pev_iuser2 //EV_INT_iuser3

  22. #define LASERMINE_STEP          pev_iuser3

  23. #define LASERMINE_HITING        pev_iuser4

  24. #define LASERMINE_COUNT         pev_fuser1

  25.  

  26. #define LASERMINE_POWERUP       pev_fuser2

  27. #define LASERMINE_BEAMTHINK     pev_fuser3

  28.  

  29. #define LASERMINE_BEAMENDPOINT  pev_vuser1

  30. #define MAX_MINES                       10

  31. #define MODE_LASERMINE          0

  32. #define OFFSET_TEAM                     114

  33. #define OFFSET_MONEY            115

  34. #define OFFSET_DEATH            444

  35.  

  36. #define cs_get_user_team(%1)    CsTeams:get_offset_value(%1,OFFSET_TEAM)

  37. #define cs_get_user_deaths(%1)  get_offset_value(%1,OFFSET_DEATH)

  38.  

  39. // Цена за мину ОТОБРАЖАЕМОЕ в Меню. Реальная цена задаётся КВАРом!

  40. new const LMCost = 2

  41.  

  42.  

  43. /*########### Цвета Мин и лазерных лучей ###########*/

  44. // Цвет мины и лазера людей

  45. new const

  46.         Red_Hum = 135,

  47.         Green_Hum       = 206,

  48.         Blue_Hum        = 255;

  49.  

  50. // Цвет мины и лазера зомби

  51. new const

  52.         Red_Zomb        = 255,

  53.         Green_Zomb      = 127,

  54.         Blue_Zomb       = 0;

  55.  

  56. // Цвет мины и лазера при режиме "zp_ltm_color 1"

  57. new const

  58.         Red_All = 255,

  59.         Green_All       = 255,

  60.         Blue_All        = 255;

  61. /*####### Цвета Мин и лазерных лучей (конец) #######*/

  62.  

  63. enum CsTeams {

  64. CS_TEAM_UNASSIGNED = 0,

  65. CS_TEAM_T = 1,

  66. CS_TEAM_CT = 2,

  67. CS_TEAM_SPECTATOR = 3

  68. };

  69.  

  70. enum tripmine_e {

  71.         TRIPMINE_IDLE1 = 0,

  72.         TRIPMINE_IDLE2,

  73.         TRIPMINE_ARM1,

  74.         TRIPMINE_ARM2,

  75.         TRIPMINE_FIDGET,

  76.         TRIPMINE_HOLSTER,

  77.         TRIPMINE_DRAW,

  78.         TRIPMINE_WORLD,

  79.         TRIPMINE_GROUND,

  80. };

  81.  

  82. enum

  83. {

  84.         POWERUP_THINK,

  85.         BEAMBREAK_THINK,

  86.         EXPLOSE_THINK

  87. };

  88.  

  89. enum

  90. {

  91.         POWERUP_SOUND,

  92.         ACTIVATE_SOUND,

  93.         STOP_SOUND

  94. };

  95.  

  96. new const

  97.         ENT_MODELS[]    = "models/zombie_plague/laser_new.mdl",

  98.         ENT_SOUND1[]    = "weapons/mine_deploy.wav",

  99.         ENT_SOUND2[]    = "weapons/mine_charge.wav",

  100.         ENT_SOUND3[]    = "weapons/mine_activate.wav",

  101.         ENT_SOUND4[]    = "items/suitchargeok1.wav",

  102.         ENT_SOUND5[]    = "items/gunpickup2.wav",

  103.         ENT_SOUND6[]    = "debris/bustglass1.wav",

  104.         ENT_SOUND7[]    = "debris/bustglass2.wav",

  105.         ENT_SPRITE1[]   = "sprites/laserbeam.spr",

  106.         ENT_SPRITE2[]   = "sprites/lm_explode.spr";

  107.  

  108. new const

  109.         ENT_CLASS_NAME[]        =       "lasermine",

  110.         ENT_CLASS_NAME3[]       =       "func_breakable",

  111.         gSnarkClassName[]       =       "wpn_snark",    // Для совместимости с плагином "Snark"

  112.         barnacle_class[]        =       "barnacle",             // Для совместимости с плагином "Barnacle"

  113.         weapon_box[]            =       "weaponbox",

  114.         item_thing[]            =       "item_thighpack",

  115.         shield[]                        =       "weapon_shield";

  116.  

  117. new g_EntMine, beam, boom

  118. new g_LENABLE, g_LFMONEY, g_LAMMO, g_LDMG, g_LBEO, g_LTMAX, g_LCOST, g_LHEALTH, g_LMODE, g_LRADIUS, g_NOROUND, g_NEMROUND, g_SURVROUND, g_SWARMROUND

  119. new g_LRDMG,g_LFF,g_LCBT, g_LDELAY, g_LVISIBLE, g_LSTAMMO, g_LACCESS, g_LGLOW, g_LDMGMODE, g_LCLMODE

  120. new g_LCBRIGHT, g_LDSEC, g_LCMDMODE, g_LBUYMODE, g_LME;

  121. new g_msgDeathMsg,g_msgScoreInfo,g_msgDamage,g_msgStatusText;

  122. new g_dcount[33],g_nowtime,g_MaxPL

  123. new bool:g_settinglaser[33]

  124. new Float:plspeed[33], plsetting[33], g_havemine[33], g_deployed[33];

  125. //new CVAR_LMCost

  126.  

  127. public plugin_init()

  128. {

  129.         register_plugin(PLUGIN, VERSION, AUTHOR);

  130.  

  131.         // Регистрируем ExtraItem

  132.         //CVAR_LMCost = get_cvar_pointer("zp_ltm_cost")

  133.         //g_LME = zp_register_extra_item("Laser Mine", get_pcvar_num(CVAR_LMCost), ZP_TEAM_ANY)

  134.         g_LME = zp_register_extra_item("Lezer", LMCost, ZP_TEAM_ANY)

  135.  

  136.         // Вызываем функцию Laser_TakeDamage при получении урона объектом ENT_CLASS_NAME3 (func_breakable)

  137.         RegisterHam(Ham_TakeDamage, ENT_CLASS_NAME3, "Laser_TakeDamage")

  138.         // Add your code here...

  139.         register_clcmd("+setlaser","CreateLaserMine_Progress_b");

  140.         register_clcmd("-setlaser","StopCreateLaserMine");

  141.         register_clcmd("+dellaser","ReturnLaserMine_Progress");

  142.         register_clcmd("-dellaser","StopReturnLaserMine");

  143.         register_clcmd("say","say_lasermine");

  144.         register_clcmd("buy_lasermine","BuyLasermine");

  145.  

  146.         g_LENABLE       = register_cvar("zp_ltm","1")

  147.         g_LACCESS       = register_cvar("zp_ltm_acs","0") //0 all, 1 admin

  148.         g_LMODE         = register_cvar("zp_ltm_mode","0") //0 lasermine, 1 tripmine

  149.         g_LAMMO         = register_cvar("zp_ltm_ammo","5")

  150.         g_LDMG          = register_cvar("zp_ltm_dmg","60") //laser hit dmg

  151.         g_LCOST         = register_cvar("zp_ltm_cost","2")

  152.         g_LFMONEY       = register_cvar("zp_ltm_fragmoney","1")

  153.         g_LHEALTH       = register_cvar("zp_ltm_health","5")

  154.         g_LTMAX         = register_cvar("zp_ltm_teammax","100")

  155.         g_LRADIUS       = register_cvar("zp_ltm_radius","320.0")

  156.         g_LRDMG         = register_cvar("zp_ltm_rdmg","100") //radius damage

  157.         g_LFF           = register_cvar("zp_ltm_ff","0")

  158.         g_LCBT          = register_cvar("zp_ltm_cbt","ALL")

  159.         g_LDELAY        = register_cvar("zp_ltm_delay","0.1")

  160.         g_LVISIBLE      = register_cvar("zp_ltm_line","1")

  161.         g_LGLOW         = register_cvar("zp_ltm_glow","0")

  162.         g_LCBRIGHT      = register_cvar("zp_ltm_bright","255")//laser line brightness.

  163.         g_LCLMODE       = register_cvar("zp_ltm_color","0") //0 is team color,1 is green

  164.         g_LDMGMODE      = register_cvar("zp_ltm_ldmgmode","0") //0 - frame dmg, 1 - once dmg, 2 - 1 second dmg

  165.         g_LDSEC         = register_cvar("zp_ltm_ldmgseconds","1") //mode 2 only, damage / seconds. default 1 (sec)

  166.         g_LSTAMMO       = register_cvar("zp_ltm_startammo","1")

  167.         g_LBUYMODE      = register_cvar("zp_ltm_buymode","1");

  168.         g_LCMDMODE      = register_cvar("zp_ltm_cmdmode","0");          //0 is +USE key, 1 is bind, 2 is each.

  169.         g_LBEO          = register_cvar("zp_ltm_brokeenemy","1");

  170.         g_NOROUND       = register_cvar("zp_ltm_noround","1");

  171.         g_NEMROUND      = register_cvar("zp_ltm_nemround","1");

  172.         g_SURVROUND     = register_cvar("zp_ltm_survround","1");

  173.         g_SWARMROUND    = register_cvar("zp_ltm_rajmod","1");

  174.  

  175.         register_event("DeathMsg", "DeathEvent", "a");

  176.         register_event("CurWeapon", "standing", "be", "1=1");

  177.         register_event("ResetHUD", "delaycount", "a");

  178.         register_event("ResetHUD", "newround", "b");

  179.         register_logevent("endround", 2, "0=World triggered", "1=Round_End");   // Регистрируем конец раунда

  180.         register_event("Damage","CutDeploy_onDamage","b");

  181.         g_msgDeathMsg   = get_user_msgid("DeathMsg");

  182.         g_msgScoreInfo  = get_user_msgid("ScoreInfo");

  183.         g_msgDamage             = get_user_msgid("Damage");

  184.         g_msgStatusText = get_user_msgid("StatusText");

  185.  

  186.         // Forward.

  187.         register_forward(FM_Think, "ltm_Think");

  188.         register_forward(FM_PlayerPostThink, "ltm_PostThink");

  189.         register_forward(FM_PlayerPreThink, "ltm_PreThink");

  190.  

  191.         // Регистируем файл языков

  192.         register_dictionary("LaserMines.txt")

  193.         register_cvar("Shidla", "[ZP] LaserMines v.2.8 Final", FCVAR_SERVER|FCVAR_SPONLY)

  194. }

  195.  

  196. public plugin_precache()

  197. {

  198.         precache_sound(ENT_SOUND1);

  199.         precache_sound(ENT_SOUND2);

  200.         precache_sound(ENT_SOUND3);

  201.         precache_sound(ENT_SOUND4);

  202.         precache_sound(ENT_SOUND5);

  203.         precache_sound(ENT_SOUND6);

  204.         precache_sound(ENT_SOUND7);

  205.         precache_model(ENT_MODELS);

  206.         beam = precache_model(ENT_SPRITE1);

  207.         boom = precache_model(ENT_SPRITE2);

  208.         return PLUGIN_CONTINUE;

  209. }

  210.  

  211. public plugin_modules()

  212. {

  213.         require_module("fakemeta");

  214.         require_module("cstrike");

  215. }

  216.  

  217. public plugin_cfg()

  218. {

  219.         g_EntMine = engfunc(EngFunc_AllocString,ENT_CLASS_NAME3);

  220.         arrayset(g_havemine,0,sizeof(g_havemine));

  221.         arrayset(g_deployed,0,sizeof(g_deployed));

  222.         g_MaxPL = get_maxplayers();

  223.  

  224.         new file[64]; get_localinfo("amxx_configsdir",file,63);

  225.         format(file, 63, "%s/zp_ltm_cvars_ap.cfg", file);

  226.         if(file_exists(file)) server_cmd("exec %s", file), server_exec();

  227. }

  228.  

  229. public Laser_TakeDamage(victim, inflictor, attacker, Float:f_Damage, bit_Damage)

  230. {

  231.         if(get_pcvar_num(g_LBEO))

  232.         {

  233.                 new i_Owner

  234.  

  235.                 // Получаем ID игрока, который поставил мину

  236.                 i_Owner = pev(victim, LASERMINE_OWNER)

  237.  

  238.                 // Если команда того, кто поставил мину и того, кто атаковал совпадают

  239.                 if(CsTeams:pev(victim, LASERMINE_TEAM) == cs_get_user_team(attacker))

  240.                 // Если тот кто поставил мину, не совпадает с тем, кто ее атаковал, Ń‚Đľ прекращаем выполнение

  241.                 if(i_Owner != attacker)

  242.                         return HAM_SUPERCEDE

  243.                 return PLUGIN_CONTINUE

  244.         }

  245.         return PLUGIN_CONTINUE

  246. }

  247.  

  248. public delaycount(id)

  249. {

  250.         g_dcount[id] = floatround(get_gametime());

  251. }

  252.  

  253. bool:CheckTime(id)

  254. {

  255.         g_nowtime = floatround(get_gametime()) - g_dcount[id];

  256.         if(g_nowtime >= get_pcvar_num(g_LDELAY))

  257.                 return true;

  258.         return false;

  259. }

  260.  

  261. public CreateLaserMine_Progress_b(id)

  262. {

  263.         if(get_pcvar_num(g_LCMDMODE) != 0)

  264.                 CreateLaserMine_Progress(id);

  265.         return PLUGIN_HANDLED;

  266. }

  267.  

  268. public CreateLaserMine_Progress(id)

  269. {

  270.  

  271.         if(!CreateCheck(id))

  272.                 return PLUGIN_HANDLED;

  273.         g_settinglaser[id] = true;

  274.  

  275.         message_begin(MSG_ONE, 108, {0,0,0}, id);

  276.         write_byte(1);

  277.         write_byte(0);

  278.         message_end();

  279.  

  280.         set_task(1.2, "Spawn", (TASK_PLANT + id));

  281.  

  282.         return PLUGIN_HANDLED;

  283. }

  284.  

  285. public ReturnLaserMine_Progress(id)

  286. {

  287.  

  288.         if(!ReturnCheck(id))

  289.                 return PLUGIN_HANDLED;

  290.         g_settinglaser[id] = true;

  291.  

  292.         message_begin(MSG_ONE, 108, {0,0,0}, id);

  293.         write_byte(1);

  294.         write_byte(0);

  295.         message_end();

  296.  

  297.         set_task(1.2, "ReturnMine", (TASK_RELEASE + id));

  298.  

  299.         return PLUGIN_HANDLED;

  300. }

  301.  

  302. public StopCreateLaserMine(id)

  303. {

  304.  

  305.         DeleteTask(id);

  306.         message_begin(MSG_ONE, 108, {0,0,0}, id);

  307.         write_byte(0);

  308.         write_byte(0);

  309.         message_end();

  310.  

  311.         return PLUGIN_HANDLED;

  312. }

  313.  

  314. public StopReturnLaserMine(id)

  315. {

  316.  

  317.         DeleteTask(id);

  318.         message_begin(MSG_ONE, 108, {0,0,0}, id);

  319.         write_byte(0);

  320.         write_byte(0);

  321.         message_end();

  322.  

  323.         return PLUGIN_HANDLED;

  324. }

  325.  

  326. public ReturnMine(id)

  327. {

  328.         id -= TASK_RELEASE;

  329.         new tgt,body,Float:vo[3],Float:to[3];

  330.         get_user_aiming(id,tgt,body);

  331.         if(!pev_valid(tgt)) return;

  332.         pev(id,pev_origin,vo);

  333.         pev(tgt,pev_origin,to);

  334.         if(get_distance_f(vo,to) > 70.0) return;

  335.         new EntityName[32];

  336.         pev(tgt, pev_classname, EntityName, 31);

  337.         if(!equal(EntityName, ENT_CLASS_NAME)) return;

  338.         if(pev(tgt,LASERMINE_OWNER) != id) return;

  339.         RemoveEntity(tgt);

  340.  

  341.         g_havemine[id] ++;

  342.         g_deployed[id] --;

  343.         emit_sound(id, CHAN_ITEM, ENT_SOUND5, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

  344.         ShowAmmo(id)

  345.  

  346.         return;

  347. }

  348.  

  349. public Spawn(id)

  350. {

  351.         id -= TASK_PLANT

  352.         // motor

  353.         new i_Ent = engfunc(EngFunc_CreateNamedEntity,g_EntMine);

  354.         if(!i_Ent)

  355.         {

  356.                 client_print(id, print_chat,"[Laesrmine Debug] Can't Create Entity");

  357.                 return PLUGIN_HANDLED_MAIN;

  358.         }

  359.         set_pev(i_Ent,pev_classname,ENT_CLASS_NAME);

  360.  

  361.         engfunc(EngFunc_SetModel,i_Ent,ENT_MODELS);

  362.  

  363.         set_pev(i_Ent,pev_solid,SOLID_NOT);

  364.         set_pev(i_Ent,pev_movetype,MOVETYPE_FLY);

  365.  

  366.         set_pev(i_Ent,pev_frame,0);

  367.         set_pev(i_Ent,pev_body,3);

  368.         set_pev(i_Ent,pev_sequence,TRIPMINE_WORLD);

  369.         set_pev(i_Ent,pev_framerate,0);

  370.         set_pev(i_Ent,pev_takedamage,DAMAGE_YES);

  371.         set_pev(i_Ent,pev_dmg,100.0);

  372.         set_user_health(i_Ent,get_pcvar_num(g_LHEALTH));

  373.         new Float:vOrigin[3];

  374.         new     Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],

  375.                 Float:vTraceEnd[3],Float:vEntAngles[3];

  376.         pev(id, pev_origin, vOrigin);

  377.         velocity_by_aim(id, 128, vTraceDirection);

  378.         xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);

  379.         engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);

  380.         new Float:fFraction;

  381.         get_tr2(0, TR_flFraction, fFraction);

  382.  

  383.         // -- We hit something!

  384.         if(fFraction < 1.0)

  385.         {

  386.                 // -- Save results to be used later.

  387.                 get_tr2(0, TR_vecEndPos, vTraceEnd);

  388.                 get_tr2(0, TR_vecPlaneNormal, vNormal);

  389.         }

  390.  

  391.  

  392.         xs_vec_mul_scalar(vNormal, 8.0, vNormal);

  393.         xs_vec_add(vTraceEnd, vNormal, vNewOrigin);

  394.  

  395.         engfunc(EngFunc_SetSize, i_Ent, Float:{ -4.0, -4.0, -4.0 }, Float:{ 4.0, 4.0, 4.0 });

  396.         engfunc(EngFunc_SetOrigin, i_Ent, vNewOrigin);

  397.  

  398.         // -- Rotate tripmine.

  399.         vector_to_angle(vNormal,vEntAngles);

  400.         set_pev(i_Ent,pev_angles,vEntAngles);

  401.  

  402.         // -- Calculate laser end origin.

  403.         new Float:vBeamEnd[3], Float:vTracedBeamEnd[3];

  404.                  

  405.         xs_vec_mul_scalar(vNormal, 8192.0, vNormal);

  406.         xs_vec_add(vNewOrigin, vNormal, vBeamEnd);

  407.  

  408.         engfunc(EngFunc_TraceLine, vNewOrigin, vBeamEnd, IGNORE_MONSTERS, -1, 0);

  409.  

  410.         get_tr2(0, TR_vecPlaneNormal, vNormal);

  411.         get_tr2(0, TR_vecEndPos, vTracedBeamEnd);

  412.  

  413.         // -- Save results to be used later.

  414.         set_pev(i_Ent, LASERMINE_OWNER, id);

  415.         set_pev(i_Ent,LASERMINE_BEAMENDPOINT,vTracedBeamEnd);

  416.         set_pev(i_Ent,LASERMINE_TEAM,int:cs_get_user_team(id));

  417.         new Float:fCurrTime = get_gametime();

  418.  

  419.         set_pev(i_Ent,LASERMINE_POWERUP, fCurrTime + 2.5);

  420.         set_pev(i_Ent,LASERMINE_STEP,POWERUP_THINK);

  421.         set_pev(i_Ent,pev_nextthink, fCurrTime + 0.2);

  422.  

  423.         PlaySound(i_Ent,POWERUP_SOUND);

  424.         g_deployed[id]++;

  425.         g_havemine[id]--;

  426.         DeleteTask(id);

  427.         ShowAmmo(id);

  428.         return 1;

  429. }

  430.  

  431. stock TeamDeployedCount(id)

  432. {

  433.         static i;

  434.         static CsTeams:t;t = cs_get_user_team(id);

  435.         static cnt;cnt=0;

  436.  

  437.         for(i = 1;i <= g_MaxPL;i++)

  438.         {

  439.                 if(is_user_connected(i))

  440.                         if(t == cs_get_user_team(i))

  441.                                 cnt += g_deployed[i];

  442.         }

  443.  

  444.         return cnt;

  445. }

  446.  

  447. bool:CheckCanTeam(id)

  448. {

  449.         new arg[5],CsTeam:num;

  450.         get_pcvar_string(g_LCBT,arg,3);

  451.         if(equali(arg,"Z"))

  452.         {

  453.                 num = CsTeam:CS_TEAM_T;

  454.         }

  455.         else if(equali(arg,"H"))

  456.         {

  457.                 num = CsTeam:CS_TEAM_CT;

  458.         }

  459.         else if(equali(arg,"ALL") || equali(arg,"HZ") || equali(arg,"ZH"))

  460.         {

  461.                 num = CsTeam:CS_TEAM_UNASSIGNED;

  462.         }

  463.         else

  464.         {

  465.                 num = CsTeam:CS_TEAM_UNASSIGNED;

  466.         }

  467.         if(num != CsTeam:CS_TEAM_UNASSIGNED && num != CsTeam:cs_get_user_team(id))

  468.                 return false;

  469.         return true;

  470. }

  471.  

  472. bool:CanCheck(id,mode)  // Проверки: когда можно ставить мины

  473. {

  474.         if(!get_pcvar_num(g_LENABLE))

  475.         {

  476.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NOTACTIVE")

  477.  

  478.                 return false;

  479.         }

  480.         if(get_pcvar_num(g_LACCESS) != 0)

  481.                 if(!(get_user_flags(id) & ADMIN_IMMUNITY))

  482.                 {

  483.                         client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NOACCESS")

  484.                         return false;

  485.                 }

  486.         if(!pev_user_alive(id)) return false;

  487.         if(!CheckCanTeam(id))

  488.         {

  489.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_CBT")

  490.                 return false;

  491.         }

  492.         if(mode == 0)

  493.         {

  494.                 if(g_havemine[id] <= 0)

  495.                 {

  496.                         client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_DONTHAVEMINE")

  497.                         return false;

  498.                 }

  499.         }

  500.         if(mode == 1)

  501.         {

  502.                 if(get_pcvar_num(g_LBUYMODE) == 0)

  503.                 {

  504.                         client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_CANTBUY")

  505.                         return false;

  506.                 }

  507.                 if(g_havemine[id] >= get_pcvar_num(g_LAMMO))

  508.                 {

  509.                         client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_HAVEMAX")

  510.                         return false;

  511.                 }

  512.                 if(zp_get_user_ammo_packs(id) < get_pcvar_num(g_LCOST))

  513.                 {

  514.                         client_print(id, print_chat, "%L %L%d %L", id, "CHATTAG",id, "STR_NOMONEY",get_pcvar_num(g_LCOST),id, "STR_NEEDED")

  515.                         return false;

  516.                 }

  517.         }

  518.         if(!CheckTime(id))

  519.         {

  520.                 client_print(id, print_chat, "%L %L %d %L", id, "CHATTAG",id, "STR_DELAY",get_pcvar_num(g_LDELAY)-g_nowtime,id, "STR_SECONDS")

  521.                 return false;

  522.         }

  523.  

  524.         return true;

  525. }

  526.  

  527. bool:ReturnCheck(id)

  528. {

  529.         if(!CanCheck(id,-1)) return false;

  530.         if(g_havemine[id] + 1 > get_pcvar_num(g_LAMMO)) return false;

  531.         new tgt,body,Float:vo[3],Float:to[3];

  532.         get_user_aiming(id,tgt,body);

  533.         if(!pev_valid(tgt)) return false;

  534.         pev(id,pev_origin,vo);

  535.         pev(tgt,pev_origin,to);

  536.         if(get_distance_f(vo,to) > 70.0) return false;

  537.         new EntityName[32];

  538.         pev(tgt, pev_classname, EntityName, 31);

  539.         if(!equal(EntityName, ENT_CLASS_NAME)) return false;

  540.         if(pev(tgt,LASERMINE_OWNER) != id) return false;

  541.         return true;

  542. }

  543.  

  544. bool:CreateCheck(id)

  545. {

  546.         if(!CanCheck(id,0)) return false;

  547.  

  548.         // Проверка на разрешение

  549.         if(!zp_has_round_started() && get_pcvar_num(g_NOROUND))

  550.         {

  551.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NOROUND")

  552.                 return false;

  553.         }

  554.  

  555.         if(zp_is_nemesis_round() && get_pcvar_num(g_NEMROUND))

  556.         {

  557.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_NEMROUND")

  558.                 return false;

  559.         }

  560.  

  561.         if(zp_is_survivor_round() && get_pcvar_num(g_SURVROUND))

  562.         {

  563.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_SURVROUND")

  564.                 return false;

  565.         }

  566.  

  567.         if(g_deployed[id] >= get_pcvar_num(g_LAMMO))

  568.         {

  569.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_MAXDEPLOY")

  570.                 return false;

  571.         }

  572.  

  573.         if(TeamDeployedCount(id) >= get_pcvar_num(g_LTMAX))

  574.         {

  575.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_MANYPPL")

  576.                 return false;

  577.         }

  578.  

  579.         if(zp_is_swarm_round() && get_pcvar_num(g_SWARMROUND))

  580.         {

  581.                 client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_RAJMOD")

  582.                 return false;

  583.         }

  584.         new Float:vTraceDirection[3], Float:vTraceEnd[3],Float:vOrigin[3];

  585.         pev(id, pev_origin, vOrigin);

  586.         velocity_by_aim(id, 128, vTraceDirection);

  587.         xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);

  588.         engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);

  589.         new Float:fFraction,Float:vTraceNormal[3];

  590.         get_tr2(0, TR_flFraction, fFraction);

  591.         // -- We hit something!

  592.         if(fFraction < 1.0)

  593.         {

  594.                 // -- Save results to be used later.

  595.                 get_tr2(0, TR_vecEndPos, vTraceEnd);

  596.                 get_tr2(0, TR_vecPlaneNormal, vTraceNormal);

  597.  

  598.                 return true;

  599.         }

  600.  

  601.         client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_PLANTWALL")

  602.         DeleteTask(id);

  603.         // -- Did not touched something. (not solid)

  604.         return false;

  605. }

  606.  

  607. public ltm_Think(i_Ent)

  608. {

  609.         if(!pev_valid(i_Ent))

  610.                 return FMRES_IGNORED;

  611.         new EntityName[32];

  612.         pev(i_Ent, pev_classname, EntityName, 31);

  613.         if(!get_pcvar_num(g_LENABLE)) return FMRES_IGNORED;

  614.         // -- Entity is not a tripmine, ignoring the next...

  615.         if(!equal(EntityName, ENT_CLASS_NAME))

  616.                 return FMRES_IGNORED;

  617.  

  618.         static Float:fCurrTime;

  619.         fCurrTime = get_gametime();

  620.  

  621.         switch(pev(i_Ent, LASERMINE_STEP))

  622.         {

  623.                 case POWERUP_THINK :

  624.                 {

  625.                         new Float:fPowerupTime;

  626.                         pev(i_Ent, LASERMINE_POWERUP, fPowerupTime);

  627.  

  628.                         if(fCurrTime > fPowerupTime)

  629.                         {

  630.                                 set_pev(i_Ent, pev_solid, SOLID_BBOX);

  631.                                 set_pev(i_Ent, LASERMINE_STEP, BEAMBREAK_THINK);

  632.  

  633.                                 PlaySound(i_Ent, ACTIVATE_SOUND);

  634.                         }

  635.                         if(get_pcvar_num(g_LGLOW)!=0)

  636.                         {

  637.                                 if(get_pcvar_num(g_LCLMODE)==0)

  638.                                 {

  639.                                         switch (pev(i_Ent,LASERMINE_TEAM))

  640.                                         {

  641.                                                 // цвет лазера Зомби

  642.                                                 case CS_TEAM_T: set_rendering(i_Ent,kRenderFxGlowShell,Red_Zomb,Green_Zomb,Blue_Zomb,kRenderNormal,5);

  643.                                                 // цвет лазера Человека

  644.                                                 case CS_TEAM_CT:set_rendering(i_Ent,kRenderFxGlowShell,Red_Hum,Green_Hum,Blue_Hum,kRenderNormal,5);

  645.                                         }

  646.                                 }else

  647.                                 {

  648.                                         // цвет лазера, если стоит "одинаковый для всех" цвет

  649.                                         set_rendering(i_Ent,kRenderFxGlowShell,Red_All,Green_All,Blue_All,kRenderNormal,5);

  650.                                 }

  651.                         }

  652.                         set_pev(i_Ent, pev_nextthink, fCurrTime + 0.1);

  653.                 }

  654.                 case BEAMBREAK_THINK :

  655.                 {

  656.                         static Float:vEnd[3],Float:vOrigin[3];

  657.                         pev(i_Ent, pev_origin, vOrigin);

  658.                         pev(i_Ent, LASERMINE_BEAMENDPOINT, vEnd);

  659.  

  660.                         static iHit, Float:fFraction;

  661.                         engfunc(EngFunc_TraceLine, vOrigin, vEnd, DONT_IGNORE_MONSTERS, i_Ent, 0);

  662.  

  663.                         get_tr2(0, TR_flFraction, fFraction);

  664.                         iHit = get_tr2(0, TR_pHit);

  665.  

  666.                         // -- Something has passed the laser.

  667.                         if(fFraction < 1.0)

  668.                         {

  669.                                 // -- Ignoring others tripmines entity.

  670.                                 if(pev_valid(iHit))

  671.                                 {

  672.                                         pev(iHit, pev_classname, EntityName, 31);

  673.                                         // Игнорим всякую хрень

  674.                                         if(!equal(EntityName, ENT_CLASS_NAME) && !equal(EntityName, gSnarkClassName) && !equal(EntityName, barnacle_class) && !equal(EntityName, weapon_box) && !equal(EntityName, item_thing) && !equal(EntityName, shield))

  675.                                         {

  676.                                                 set_pev(i_Ent, pev_enemy, iHit);

  677.  

  678.                                                 if (!pev_valid(i_Ent))  // если не верный объект - ничего не делаем. Спасибо DJ_WEST

  679.                                                         return FMRES_IGNORED;

  680.  

  681.                                                 if(get_pcvar_num(g_LMODE) == MODE_LASERMINE)

  682.                                                         CreateLaserDamage(i_Ent,iHit);

  683.                                                 else

  684.                                                         if(get_pcvar_num(g_LFF) || CsTeams:pev(i_Ent,LASERMINE_TEAM) != cs_get_user_team(iHit))

  685.                                                                 set_pev(i_Ent, LASERMINE_STEP, EXPLOSE_THINK);

  686.  

  687.                                                 set_pev(i_Ent, pev_nextthink, fCurrTime + random_float(0.1, 0.3));

  688.                                         }

  689.                                 }

  690.                         }

  691.                         if(get_pcvar_num(g_LDMGMODE)!=0)

  692.                                 if(pev(i_Ent,LASERMINE_HITING) != iHit)

  693.                                         set_pev(i_Ent,LASERMINE_HITING,iHit);

  694.  

  695.                         // -- Tripmine is still there.

  696.                         if(pev_valid(i_Ent))

  697.                         {

  698.                                 static Float:fHealth;

  699.                                 pev(i_Ent, pev_health, fHealth);

  700.  

  701.                                 if(fHealth <= 0.0 || (pev(i_Ent,pev_flags) & FL_KILLME))

  702.                                 {

  703.                                 set_pev(i_Ent, LASERMINE_STEP, EXPLOSE_THINK);

  704.                                 set_pev(i_Ent, pev_nextthink, fCurrTime + random_float(0.1, 0.3));

  705.                                 }

  706.                                                                                  

  707.                                 static Float:fBeamthink;

  708.                                 pev(i_Ent, LASERMINE_BEAMTHINK, fBeamthink);

  709.                                                  

  710.                                 if(fBeamthink < fCurrTime && get_pcvar_num(g_LVISIBLE))

  711.                                 {

  712.                                         DrawLaser(i_Ent, vOrigin, vEnd);

  713.                                         set_pev(i_Ent, LASERMINE_BEAMTHINK, fCurrTime + 0.1);

  714.                                 }

  715.                                 set_pev(i_Ent, pev_nextthink, fCurrTime + 0.01);

  716.                         }

  717.                 }

  718.                 case EXPLOSE_THINK :

  719.                 {

  720.                         // -- Stopping entity to think

  721.                         set_pev(i_Ent, pev_nextthink, 0.0);

  722.                         PlaySound(i_Ent, STOP_SOUND);

  723.                         g_deployed[pev(i_Ent,LASERMINE_OWNER)]--;

  724.                         CreateExplosion(i_Ent);

  725.                         CreateDamage(i_Ent,get_pcvar_float(g_LRDMG),get_pcvar_float(g_LRADIUS))

  726.                         RemoveEntity    (i_Ent);

  727.                 }

  728.         }

  729.  

  730.         return FMRES_IGNORED;

  731. }

  732.  

  733. PlaySound(i_Ent, i_SoundType)

  734. {

  735.         switch (i_SoundType)

  736.         {

  737.                 case POWERUP_SOUND :

  738.                 {

  739.                         emit_sound(i_Ent, CHAN_VOICE, ENT_SOUND1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

  740.                         emit_sound(i_Ent, CHAN_BODY , ENT_SOUND2, 0.2, ATTN_NORM, 0, PITCH_NORM);

  741.                 }

  742.                 case ACTIVATE_SOUND :

  743.                 {

  744.                         emit_sound(i_Ent, CHAN_VOICE, ENT_SOUND3, 0.5, ATTN_NORM, 1, 75);

  745.                 }

  746.                 case STOP_SOUND :

  747.                 {

  748.                         emit_sound(i_Ent, CHAN_BODY , ENT_SOUND2, 0.2, ATTN_NORM, SND_STOP, PITCH_NORM);

  749.                         emit_sound(i_Ent, CHAN_VOICE, ENT_SOUND3, 0.5, ATTN_NORM, SND_STOP, 75);

  750.                 }

  751.         }

  752. }

  753.  

  754. DrawLaser(i_Ent, const Float:v_Origin[3], const Float:v_EndOrigin[3])

  755. {

  756.         new tcolor[3];

  757.         new teamid = pev(i_Ent, LASERMINE_TEAM);

  758.         if(get_pcvar_num(g_LCLMODE) == 0)

  759.         {

  760.                 switch(teamid){

  761.                         case 1:{

  762.                                 // Цвет луча для Зомби

  763.                                 tcolor[0] = Red_Zomb;

  764.                                 tcolor[1] = Green_Zomb;

  765.                                 tcolor[2] = Blue_Zomb;

  766.                         }

  767.                         case 2:{

  768.                                 // Цвет луча для Человека

  769.                                 tcolor[0] = Red_Hum;

  770.                                 tcolor[1] = Green_Hum;

  771.                                 tcolor[2] = Blue_Hum;

  772.                         }

  773.                 }

  774.         }else

  775.         {

  776.                 // Цвет луча для всез при режиме 1-Đ˝ луч для всех

  777.                 tcolor[0] = Red_All;

  778.                 tcolor[1] = Green_All;

  779.                 tcolor[2] = Blue_All;

  780.         }

  781.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  782.         write_byte(TE_BEAMPOINTS);

  783.         engfunc(EngFunc_WriteCoord,v_Origin[0]);

  784.         engfunc(EngFunc_WriteCoord,v_Origin[1]);

  785.         engfunc(EngFunc_WriteCoord,v_Origin[2]);

  786.         engfunc(EngFunc_WriteCoord,v_EndOrigin[0]); //Random

  787.         engfunc(EngFunc_WriteCoord,v_EndOrigin[1]); //Random

  788.         engfunc(EngFunc_WriteCoord,v_EndOrigin[2]); //Random

  789.         write_short(beam);

  790.         write_byte(0);

  791.         write_byte(0);

  792.         write_byte(1)//Life

  793.         write_byte(5)//Width

  794.         write_byte(0)//wave

  795.         write_byte(tcolor[0]); // r

  796.         write_byte(tcolor[1]); // g

  797.         write_byte(tcolor[2]); // b

  798.         write_byte(get_pcvar_num(g_LCBRIGHT));

  799.         write_byte(255);

  800.         message_end();

  801. }

  802.  

  803. CreateDamage(iCurrent,Float:DmgMAX,Float:Radius)

  804. {

  805.         // Get given parameters

  806.         new Float:vecSrc[3];

  807.         pev(iCurrent, pev_origin, vecSrc);

  808.  

  809.         new AtkID =pev(iCurrent,LASERMINE_OWNER);

  810.         new TeamID=pev(iCurrent,LASERMINE_TEAM);

  811.  

  812.         new ent = -1;

  813.         new Float:tmpdmg = DmgMAX;

  814.  

  815.         new Float:kickback = 0.0;

  816.         // Needed for doing some nice calculations :P

  817.         new Float:Tabsmin[3], Float:Tabsmax[3];

  818.         new Float:vecSpot[3];

  819.         new Float:Aabsmin[3], Float:Aabsmax[3];

  820.         new Float:vecSee[3];

  821.         new trRes;

  822.         new Float:flFraction;

  823.         new Float:vecEndPos[3];

  824.         new Float:distance;

  825.         new Float:origin[3], Float:vecPush[3];

  826.         new Float:invlen;

  827.         new Float:velocity[3];

  828.         new iHitHP,iHitTeam;

  829.         // Calculate falloff

  830.         new Float:falloff;

  831.         if(Radius > 0.0)

  832.         {

  833.                 falloff = DmgMAX / Radius;

  834.         } else {

  835.                 falloff = 1.0;

  836.         }

  837.         // Find monsters and players inside a specifiec radius

  838.         while((ent = engfunc(EngFunc_FindEntityInSphere, ent, vecSrc, Radius)) != 0)

  839.         {

  840.                 if(!pev_valid(ent)) continue;

  841.                 if(!(pev(ent, pev_flags) & (FL_CLIENT | FL_FAKECLIENT | FL_MONSTER)))

  842.                 {

  843.                         // Entity is not a player or monster, ignore it

  844.                         continue;

  845.                 }

  846.                 if(!pev_user_alive(ent)) continue;

  847.                 // Reset data

  848.                 kickback = 1.0;

  849.                 tmpdmg = DmgMAX;

  850.                 // The following calculations are provided by Orangutanz, THANKS!

  851.                 // We use absmin and absmax for the most accurate information

  852.                 pev(ent, pev_absmin, Tabsmin);

  853.                 pev(ent, pev_absmax, Tabsmax);

  854.                 xs_vec_add(Tabsmin,Tabsmax,Tabsmin);

  855.                 xs_vec_mul_scalar(Tabsmin,0.5,vecSpot);

  856.                 pev(iCurrent, pev_absmin, Aabsmin);

  857.                 pev(iCurrent, pev_absmax, Aabsmax);

  858.                 xs_vec_add(Aabsmin,Aabsmax,Aabsmin);

  859.                 xs_vec_mul_scalar(Aabsmin,0.5,vecSee);

  860.                 engfunc(EngFunc_TraceLine, vecSee, vecSpot, 0, iCurrent, trRes);

  861.                 get_tr2(trRes, TR_flFraction, flFraction);

  862.                 // Explosion can 'see' this entity, so hurt them! (or impact through objects has been enabled xD)

  863.                 if(flFraction >= 0.9 || get_tr2(trRes, TR_pHit) == ent)

  864.                 {

  865.                         // Work out the distance between impact and entity

  866.                         get_tr2(trRes, TR_vecEndPos, vecEndPos);

  867.                         distance = get_distance_f(vecSrc, vecEndPos) * falloff;

  868.                         tmpdmg -= distance;

  869.                         if(tmpdmg < 0.0)

  870.                                 tmpdmg = 0.0;

  871.                         // Kickback Effect

  872.                         if(kickback != 0.0)

  873.                         {

  874.                                 xs_vec_sub(vecSpot,vecSee,origin);

  875.                                 invlen = 1.0/get_distance_f(vecSpot, vecSee);

  876.  

  877.                                 xs_vec_mul_scalar(origin,invlen,vecPush);

  878.                                 pev(ent, pev_velocity, velocity)

  879.                                 xs_vec_mul_scalar(vecPush,tmpdmg,vecPush);

  880.                                 xs_vec_mul_scalar(vecPush,kickback,vecPush);

  881.                                 xs_vec_add(velocity,vecPush,velocity);

  882.                                 if(tmpdmg < 60.0)

  883.                                 {

  884.                                         xs_vec_mul_scalar(velocity,12.0,velocity);

  885.                                 } else {

  886.                                         xs_vec_mul_scalar(velocity,4.0,velocity);

  887.                                 }

  888.                                 if(velocity[0] != 0.0 || velocity[1] != 0.0 || velocity[2] != 0.0)

  889.                                 {

  890.                                         // There's some movement todo :)

  891.                                         set_pev(ent, pev_velocity, velocity)

  892.                                 }

  893.                         }

  894.  

  895.                         iHitHP = pev_user_health(ent) - floatround(tmpdmg)

  896.                         iHitTeam = int:cs_get_user_team(ent)

  897.                         if(iHitHP <= 0)

  898.                         {

  899.                                 if(iHitTeam != TeamID)

  900.                                 {

  901.                                         zp_set_user_ammo_packs(AtkID,zp_get_user_ammo_packs(AtkID) + get_pcvar_num(g_LFMONEY))

  902.                                         set_score(AtkID,ent,1,iHitHP)

  903.                                 }else

  904.                                 {

  905.                                         if(get_pcvar_num(g_LFF))

  906.                                         {

  907.                                                 zp_set_user_ammo_packs(AtkID,zp_get_user_ammo_packs(AtkID) - get_pcvar_num(g_LFMONEY))

  908.                                                 set_score(AtkID,ent,-1,iHitHP)

  909.                                         }

  910.                                 }

  911.                         }else

  912.                         {

  913.                                 if(iHitTeam != TeamID || get_pcvar_num(g_LFF))

  914.                                 {

  915.                                         //set_pev(Player,pev_health,iHitHP)

  916.                                         set_user_health(ent, iHitHP)

  917.                                         engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},ent);

  918.                                         write_byte(floatround(tmpdmg))

  919.                                         write_byte(floatround(tmpdmg))

  920.                                         write_long(DMG_BULLET)

  921.                                         engfunc(EngFunc_WriteCoord,vecSrc[0])

  922.                                         engfunc(EngFunc_WriteCoord,vecSrc[1])

  923.                                         engfunc(EngFunc_WriteCoord,vecSrc[2])

  924.                                         message_end()

  925.                                 }

  926.                         }

  927.                 }

  928.         }

  929.         return

  930. }

  931.  

  932. bool:pev_user_alive(ent)

  933. {

  934.         new deadflag = pev(ent,pev_deadflag);

  935.         if(deadflag != DEAD_NO)

  936.                 return false;

  937.         return true;

  938. }

  939.  

  940. CreateExplosion(iCurrent)

  941. {

  942.         new Float:vOrigin[3];

  943.         pev(iCurrent,pev_origin,vOrigin);

  944.  

  945.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);

  946.         write_byte(99); //99 = KillBeam

  947.         write_short(iCurrent);

  948.         message_end();

  949.  

  950.         engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vOrigin, 0);

  951.         write_byte(TE_EXPLOSION);

  952.         engfunc(EngFunc_WriteCoord,vOrigin[0]);

  953.         engfunc(EngFunc_WriteCoord,vOrigin[1]);

  954.         engfunc(EngFunc_WriteCoord,vOrigin[2]);

  955.         write_short(boom);

  956.         write_byte(30);

  957.         write_byte(15);

  958.         write_byte(0);

  959.         message_end();

  960. }

  961.  

  962. CreateLaserDamage(iCurrent,isHit)

  963. {

  964.         if(isHit < 0) return PLUGIN_CONTINUE

  965.         switch(get_pcvar_num(g_LDMGMODE))

  966.         {

  967.                 case 1:

  968.                 {

  969.                         if(pev(iCurrent,LASERMINE_HITING) == isHit)

  970.                                 return PLUGIN_CONTINUE

  971.                 }

  972.                 case 2:

  973.                 {

  974.                         if(pev(iCurrent,LASERMINE_HITING) == isHit)

  975.                         {

  976.                                 static Float:cnt

  977.                                 static now,htime;now = floatround(get_gametime())

  978.  

  979.                                 pev(iCurrent,LASERMINE_COUNT,cnt)

  980.                                 htime = floatround(cnt)

  981.                                 if(now - htime < get_pcvar_num(g_LDSEC))

  982.                                 {

  983.                                         return PLUGIN_CONTINUE;

  984.                                 }else{

  985.                                         set_pev(iCurrent,LASERMINE_COUNT,get_gametime())

  986.                                 }

  987.                         }else

  988.                         {

  989.                                 set_pev(iCurrent,LASERMINE_COUNT,get_gametime())

  990.                         }

  991.                 }

  992.         }

  993.  

  994.         new Float:vOrigin[3],Float:vEnd[3]

  995.         pev(iCurrent,pev_origin,vOrigin)

  996.         pev(iCurrent,pev_vuser1,vEnd)

  997.  

  998.         new teamid = pev(iCurrent, LASERMINE_TEAM)

  999.  

  1000.         new szClassName[32]

  1001.         new Alive,God

  1002.         new iHitTeam,iHitHP,id

  1003.         new hitscore

  1004.  

  1005.         szClassName[0] = '^0'

  1006.         pev(isHit,pev_classname,szClassName,32)

  1007.         if((pev(isHit, pev_flags) & (FL_CLIENT | FL_FAKECLIENT | FL_MONSTER)))

  1008.         {

  1009.                 Alive = pev_user_alive(isHit)

  1010.                 God = get_user_godmode(isHit)

  1011.                 if(!Alive || God) return PLUGIN_CONTINUE

  1012.                 iHitTeam = int:cs_get_user_team(isHit)

  1013.                 iHitHP = pev_user_health(isHit) - get_pcvar_num(g_LDMG)

  1014.                 id = pev(iCurrent,LASERMINE_OWNER)//, szNetName[32]

  1015.                 if(iHitHP <= 0)

  1016.                 {

  1017.                         if(iHitTeam != teamid)

  1018.                         {

  1019.                                 emit_sound(isHit, CHAN_WEAPON, ENT_SOUND4, 1.0, ATTN_NORM, 0, PITCH_NORM)

  1020.                                 hitscore = 1

  1021.                                 zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id) + get_pcvar_num(g_LFMONEY))

  1022.                                 set_score(id,isHit,hitscore,iHitHP)

  1023.                         }else

  1024.                         {

  1025.                                 if(get_pcvar_num(g_LFF))

  1026.                                 {

  1027.                                         emit_sound(isHit, CHAN_WEAPON, ENT_SOUND4, 1.0, ATTN_NORM, 0, PITCH_NORM)

  1028.                                         hitscore = -1

  1029.                                         zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id) - get_pcvar_num(g_LFMONEY))

  1030.                                         set_score(id,isHit,hitscore,iHitHP)

  1031.                                 }

  1032.                         }

  1033.                 }else if(iHitTeam != teamid || get_pcvar_num(g_LFF))

  1034.                 {

  1035.                         emit_sound(isHit, CHAN_WEAPON, ENT_SOUND4, 1.0, ATTN_NORM, 0, PITCH_NORM)

  1036.                         set_user_health(isHit,iHitHP)

  1037.                         set_pev(iCurrent,LASERMINE_HITING,isHit);

  1038.                         engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},isHit);

  1039.                         write_byte(get_pcvar_num(g_LDMG))

  1040.                         write_byte(get_pcvar_num(g_LDMG))

  1041.                         write_long(DMG_BULLET)

  1042.                         engfunc(EngFunc_WriteCoord,vOrigin[0])

  1043.                         engfunc(EngFunc_WriteCoord,vOrigin[1])

  1044.                         engfunc(EngFunc_WriteCoord,vOrigin[2])

  1045.                         message_end()

  1046.                 }

  1047.         }else if(equal(szClassName, ENT_CLASS_NAME3))

  1048.         {

  1049.                 new hl;

  1050.                 hl = pev_user_health(isHit);

  1051.                 set_user_health(isHit,hl-get_pcvar_num(g_LDMG));

  1052.         }

  1053.         return PLUGIN_CONTINUE

  1054. }

  1055.  

  1056. stock pev_user_health(id)

  1057. {

  1058.         new Float:health

  1059.         pev(id,pev_health,health)

  1060.         return floatround(health)

  1061. }

  1062.  

  1063. stock set_user_health(id,health)

  1064. {

  1065.         health > 0 ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);

  1066. }

  1067.  

  1068. stock get_user_godmode(index) {

  1069.         new Float:val

  1070.         pev(index, pev_takedamage, val)

  1071.  

  1072.         return (val == DAMAGE_NO)

  1073. }

  1074.  

  1075. stock set_user_frags(index, frags)

  1076. {

  1077.         set_pev(index, pev_frags, float(frags))

  1078.  

  1079.         return 1

  1080. }

  1081.  

  1082. stock pev_user_frags(index)

  1083. {

  1084.         new Float:frags;

  1085.         pev(index,pev_frags,frags);

  1086.         return floatround(frags);

  1087. }

  1088.  

  1089. set_score(id,target,hitscore,HP){

  1090.  

  1091.         new idfrags = pev_user_frags(id) + hitscore// get_user_frags(id) + hitscore

  1092.         set_user_frags(id,idfrags)

  1093.         new tarfrags = pev_user_frags(target) + 1 //get_user_frags(target) + 1

  1094.         set_user_frags(target,tarfrags)

  1095.         new idteam = int:cs_get_user_team(id)

  1096.         new iddeaths = cs_get_user_deaths(id)

  1097.  

  1098.  

  1099.         message_begin(MSG_ALL, g_msgDeathMsg, {0, 0, 0} ,0)

  1100.         write_byte(id)

  1101.         write_byte(target)

  1102.         write_byte(0)

  1103.         write_string(ENT_CLASS_NAME)

  1104.         message_end()

  1105.  

  1106.         message_begin(MSG_ALL, g_msgScoreInfo)

  1107.         write_byte(id)

  1108.         write_short(idfrags)

  1109.         write_short(iddeaths)

  1110.         write_short(0)

  1111.         write_short(idteam)

  1112.         message_end()

  1113.  

  1114.         set_msg_block(g_msgDeathMsg, BLOCK_ONCE)

  1115.  

  1116.         set_user_health(target, HP)

  1117.  

  1118. }

  1119.  

  1120. public BuyLasermine(id)

  1121. {

  1122.         if(!CanCheck(id,1)) return PLUGIN_CONTINUE

  1123.  

  1124.         zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id) - get_pcvar_num(g_LCOST))

  1125.         g_havemine[id]++;

  1126.  

  1127.         client_print(id, print_chat, "%L %L", id, "CHATTAG",id, "STR_BOUGHT")

  1128.  

  1129.         emit_sound(id, CHAN_ITEM, ENT_SOUND5, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

  1130.         ShowAmmo(id)

  1131.         return PLUGIN_HANDLED

  1132. }

  1133.  

  1134. public zp_extra_item_selected(id, itemid)

  1135. {

  1136.         if(itemid == g_LME)

  1137.                 {

  1138.                 zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + LMCost)

  1139.                 BuyLasermine(id)

  1140.                 }

  1141.         return PLUGIN_CONTINUE

  1142. }

  1143.  

  1144. ShowAmmo(id)

  1145. {

  1146.         new ammo[51]

  1147.         new PlugStat[ 555 char ];

  1148.         formatex(PlugStat, charsmax(PlugStat), "%L", LANG_PLAYER, "STR_STATE")

  1149.         formatex(ammo, 50, "%s %i/%i",PlugStat, g_havemine[id],get_pcvar_num(g_LAMMO))

  1150.  

  1151.         message_begin(MSG_ONE, g_msgStatusText, {0,0,0}, id)

  1152.         write_byte(0)

  1153.         write_string(ammo)

  1154.         message_end()

  1155. }

  1156.  

  1157. public showInfo(id)

  1158. {

  1159.         client_print(id, print_chat, "%L", id, "STR_REF")

  1160. }

  1161.  

  1162. public say_lasermine(id){

  1163.         new said[32]

  1164.         read_argv(1,said,31);

  1165.         if(!get_pcvar_num(g_LENABLE))

  1166.         {

  1167.                 return PLUGIN_CONTINUE

  1168.         }

  1169.         if(equali(said,"/buy lasermine")||equali(said,"/lm")||equali(said,"buy_lasermine")){

  1170.                 BuyLasermine(id)

  1171.         }else if(equali(said, "lasermine") || equali(said, "/lasermine")){

  1172.                 const SIZE = 1024

  1173.                 new msg[SIZE+1],len = 0;

  1174.                 len += formatex(msg[len], SIZE - len, "<html><body>")

  1175.                 len += formatex(msg[len], SIZE - len, "<p><b>LaserMine</b></p><br/><br/>")

  1176.                 len += formatex(msg[len], SIZE - len, "<p>You can be setting the mine on the wall.</p><br/>")

  1177.                 len += formatex(msg[len], SIZE - len, "<p>That laser will give what touched it damage.</p><br/><br/>")

  1178.                 len += formatex(msg[len], SIZE - len, "<p><b>LaserMine Commands</b></p><br/><br/>")

  1179.                 len += formatex(msg[len], SIZE - len, "<p><b>Say /buy lasermine</b> or <b>Say /lm</b> //buying lasermine<br/>")

  1180.                 len += formatex(msg[len], SIZE - len, "<b>buy_lasermine</b> //bind ^"F2^" buy_lasermine : using F2 buying lasermine<br/>")

  1181.                 len += formatex(msg[len], SIZE - len, "<b>+setlaser</b> //bind mouse3 +setlaser : using mouse3 set lasermine on wall<br/>")

  1182.                 len += formatex(msg[len], SIZE - len, "</body></html>")

  1183.                 show_motd(id, msg, "Lasermine Entity help")

  1184.                 return PLUGIN_CONTINUE

  1185.         }

  1186.         else if(containi(said, "laser") != -1) {

  1187.                 showInfo(id)

  1188.                 return PLUGIN_CONTINUE

  1189.         }

  1190.         return PLUGIN_CONTINUE

  1191. }

  1192.  

  1193. public standing(id)

  1194. {

  1195.         if(!g_settinglaser[id])

  1196.                 return PLUGIN_CONTINUE

  1197.  

  1198.         set_pev(id, pev_maxspeed, 1.0)

  1199.  

  1200.         return PLUGIN_CONTINUE

  1201. }

  1202.  

  1203. public ltm_PostThink(id)

  1204. {

  1205.         if(!g_settinglaser[id] && plsetting[id]){

  1206.                 resetspeed(id)

  1207.         }

  1208.         else if(g_settinglaser[id] && !plsetting[id]) {

  1209.                 pev(id, pev_maxspeed,plspeed[id])

  1210.                 set_pev(id, pev_maxspeed, 1.0)

  1211.         }

  1212.         plsetting[id] = g_settinglaser[id]

  1213.         return FMRES_IGNORED

  1214. }

  1215.  

  1216. public ltm_PreThink(id)

  1217. {

  1218.         if(!pev_user_alive(id) || g_settinglaser[id] == true || is_user_bot(id) || get_pcvar_num(g_LCMDMODE) == 1)

  1219.                 return FMRES_IGNORED;

  1220.  

  1221.         if(pev(id, pev_button) & IN_USE && !(pev(id, pev_oldbuttons) & IN_USE))

  1222.                 CreateLaserMine_Progress(id)

  1223.         return FMRES_IGNORED;

  1224. }

  1225.  

  1226. resetspeed(id)

  1227. {

  1228.         set_pev(id, pev_maxspeed, plspeed[id])

  1229. }

  1230.  

  1231. public client_putinserver(id){

  1232.         g_deployed[id] = 0;

  1233.         g_havemine[id] = 0;

  1234.         DeleteTask(id);

  1235.         return PLUGIN_CONTINUE

  1236. }

  1237.  

  1238. public client_disconnect(id){

  1239.         if(!get_pcvar_num(g_LENABLE))

  1240.                 return PLUGIN_CONTINUE

  1241.         DeleteTask(id);

  1242.         RemoveAllTripmines(id);

  1243.         return PLUGIN_CONTINUE

  1244. }

  1245.  

  1246.  

  1247. public newround(id){

  1248.         if(!get_pcvar_num(g_LENABLE))

  1249.                 return PLUGIN_CONTINUE

  1250.         pev(id, pev_maxspeed,plspeed[id])

  1251.         DeleteTask(id);

  1252.         RemoveAllTripmines(id);

  1253.         //client_print(id, print_chat, "[ZP][LM][DeBug] All Mines removied!");

  1254.         delaycount(id);

  1255.         SetStartAmmo(id);

  1256.         return PLUGIN_CONTINUE

  1257. }

  1258.  

  1259. public endround(id)

  1260. {

  1261.         if(!get_pcvar_num(g_LENABLE))

  1262.                 return PLUGIN_CONTINUE

  1263.  

  1264.         // Удаление мин после конца раунда

  1265.         DeleteTask(id);

  1266.         RemoveAllTripmines(id);

  1267.  

  1268.         return PLUGIN_CONTINUE

  1269. }

  1270.  

  1271. public DeathEvent(){

  1272.         if(!get_pcvar_num(g_LENABLE))

  1273.                 return PLUGIN_CONTINUE

  1274.  

  1275.         new id = read_data(2)

  1276.         if(is_user_connected(id)) DeleteTask(id);

  1277.         return PLUGIN_CONTINUE

  1278. }

  1279.  

  1280. public RemoveAllTripmines(i_Owner)

  1281. {

  1282.         new iEnt = g_MaxPL + 1;

  1283.         new clsname[32];

  1284.         while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", ENT_CLASS_NAME)))

  1285.         {

  1286.                 if(i_Owner)

  1287.                 {

  1288.                         if(pev(iEnt, LASERMINE_OWNER) != i_Owner)

  1289.                                 continue;

  1290.                         clsname[0] = '^0'

  1291.                         pev(iEnt, pev_classname, clsname, sizeof(clsname)-1);

  1292.                         if(equali(clsname, ENT_CLASS_NAME))

  1293.                         {

  1294.                                 PlaySound(iEnt, STOP_SOUND);

  1295.                                 RemoveEntity(iEnt);

  1296.                         }

  1297.                 }

  1298.                 else

  1299.                         set_pev(iEnt, pev_flags, FL_KILLME);

  1300.         }

  1301.         g_deployed[i_Owner]=0;

  1302. }

  1303.  

  1304. SetStartAmmo(id)

  1305. {

  1306.         new stammo = get_pcvar_num(g_LSTAMMO);

  1307.         if(stammo <= 0) return PLUGIN_CONTINUE;

  1308.         g_havemine[id] = (g_havemine[id] <= stammo) ? stammo : g_havemine[id];

  1309.         return PLUGIN_CONTINUE;

  1310. }

  1311.  

  1312. public CutDeploy_onDamage(id)

  1313. {

  1314.         if(get_user_health(id) < 1)

  1315.                 DeleteTask(id);

  1316. }

  1317.  

  1318. DeleteTask(id)

  1319. {

  1320.         if(task_exists((TASK_PLANT + id)))

  1321.         {

  1322.                 remove_task((TASK_PLANT + id))

  1323.         }

  1324.         if(task_exists((TASK_RELEASE + id)))

  1325.         {

  1326.                 remove_task((TASK_RELEASE + id))

  1327.         }

  1328.         g_settinglaser[id] = false

  1329.         return PLUGIN_CONTINUE;

  1330. }

  1331.  

  1332. stock set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)

  1333. {

  1334.         static Float:RenderColor[3];

  1335.         RenderColor[0] = float(r);

  1336.         RenderColor[1] = float(g);

  1337.         RenderColor[2] = float(b);

  1338.  

  1339.         set_pev(entity, pev_renderfx, fx);

  1340.         set_pev(entity, pev_rendercolor, RenderColor);

  1341.         set_pev(entity, pev_rendermode, render);

  1342.         set_pev(entity, pev_renderamt, float(amount));

  1343.  

  1344.         return 1

  1345. }

  1346.  

  1347. // Gets offset data

  1348. get_offset_value(id, type)

  1349. {

  1350.         new key = -1;

  1351.         switch(type)

  1352.         {

  1353.                 case OFFSET_TEAM: key = OFFSET_TEAM;

  1354.                 case OFFSET_MONEY:

  1355.                 key = OFFSET_MONEY;

  1356.                 case OFFSET_DEATH: key = OFFSET_DEATH;

  1357.         }

  1358.         if(key != -1)

  1359.         {

  1360.                 if(is_amd64_server()) key += 25;

  1361.                 return get_pdata_int(id, key);

  1362.         }

  1363.         return -1;

  1364. }


Ezzel állítod be, hogy rajmódban tíltva legyen.
zp_ltm_rajmod "1" (1-Tiltva,0-Engedélyezve)

Készítessz egy TXT fájlt LaserMines.txt névvel. Ezeket beleirod:

[hu]
CHATTAG = [ LézeR ]
STR_NOTACTIVE = A lézer nincs bekapcsolva.
STR_NOROUND = Lézert csak körkezdés után tehetsz le.
STR_SURVROUND = Túlélő Módban nem használható a Lézer.
STR_NEMROUND = Nemesis Módban nem használható a Lézer.
STR_DONTHAVEMINE = Nincs több lézer nállad.
STR_MAXDEPLOY = Letetted a maximum mennyiségü Lézert.
STR_MANYPPL = A csapatod letette a maximum mennyiségü Lézert.
STR_PLANTWALL = Lézert a falra tedd.
STR_REF = Lézer: Leraká: bind x +setlaser , Felvétel: bind c +dellaser
STR_CBT = A te csapatod nem tehet le Lézert.
STR_CANTBUY = Nem engedélyezett a Lézer vásárlás.
STR_HAVEMAX = Elérted a maximum Lézer mennyiséget.
STR_NOMONEY = Nincs elég Lőszer Csomagod hogy Lézet vehess.
STR_DELAY = Lézert letételéig várj:
STR_SECONDS = Másodpercet.
STR_BOUGHT = Vettél egy Lézert.
STR_STATE = Lézereid:
STR_NOACCESS = Érvénytelen Parancs!

Valamint kiegészíted ezzel a sorral:

STR_RAJMOD = Raj Módban nem használható a Lézer.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Lézer
HozzászólásElküldve: 2012.06.25. 14:32 
Offline
Őstag
Avatar

Csatlakozott: 2011.11.15. 16:29
Hozzászólások: 1142
Megköszönt másnak: 8 alkalommal
Megköszönték neki: 24 alkalommal
Hmm Köszi!

_________________
[url=http://www.gametracker.com/server_info/188.227.227.114:27286/][img]http://cache.www.gametracker.com/server_info/188.227.227.114:27286/b_350_20_323957_202743_F19A15_111111.png[/img][/url]


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 10 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 2 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole