hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.11.10. 20:46



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Google [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  [1 hozzászólás ] 
Szerző Üzenet
HozzászólásElküldve:2014.06.29. 20:05 
Offline
Minden6ó
Avatar

Csatlakozott:2011.01.19. 12:14
Hozzászólások:4293
Megköszönt másnak: 219 alkalommal
Megköszönték neki: 287 alkalommal
Sziasztok!

Bele tudná nekem valaki írni azt hogy a tulélőnek ne legyen jetpack?
Egy másik jetpackba már bele írta virtual, de az a baj hogy abba benne van a sprite.

Itt van a link amibe bele írta virtual hátha könnyebb lesz ezzel.
[ZP] Extra Cuc: JetPack Túlélő módba ne legyen

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <engine>
  4. #include <fakemeta>
  5. #include <hamsandwich>
  6. #include <zombieplague>
  7.  
  8. #define PLUGINNAME "Extra Item Jetpack+Bazooka"
  9. #define VERSION "3.2"
  10. #define AUTHOR "B!gBud"
  11.  
  12. #define ACCESS_LEVEL ADMIN_LEVEL_A
  13. #define VOTE_ACCESS ADMIN_CFG
  14.  
  15. #define TE_EXPLOSION 3
  16. #define TE_BEAMFOLLOW 22
  17. #define TE_BEAMCYLINDER 21
  18.  
  19. #define JETPACK_COST 100 // set how may ammopacks the Jatpack+Rocket cost
  20.  
  21. new ROCKET_MDL[64] = "models/rpgrocket.mdl"
  22. new ROCKET_SOUND[64] = "weapons/rocketfire1.wav"
  23. new getrocket[64] = "items/9mmclip2.wav"
  24.  
  25. new bool:fly[33] = false
  26. new bool:rocket[33] = false
  27. new bool:rksound[33] = false
  28. new bool:shot[33] = false
  29.  
  30. new Float:gltime = 0.0
  31. new Float:last_Rocket[33] = 0.0
  32. new Float:jp_cal[33] = 0.0
  33. new Float:jp_soun[33] = 0.0
  34. new flame, explosion, trail, white
  35. new g_flyEnergy[33], hasjet[33]
  36. new cvar_jetpack, cvar_jetpackSpeed, cvar_jetpackUpSpeed, cvar_jetpackAcrate ,cvar_RocketDelay, cvar_RocketSpeed, cvar_RocketDmg, cvar_Dmg_range, cvar_fly_max_engery, cvar_fly_engery, cvar_regain_energy, g_item_jetpack, cvar_cal_time, cvar_oneround
  37.  
  38.  
  39. public plugin_init() {
  40. register_plugin(PLUGINNAME, VERSION, AUTHOR)
  41.  
  42. g_item_jetpack = zp_register_extra_item("\rJetpack+Bazooka\y", JETPACK_COST, ZP_TEAM_HUMAN)
  43.  
  44.  
  45. new ver[64]
  46. format(ver,63,"%s v%s",PLUGINNAME,VERSION)
  47. register_cvar("zp_jp_version",ver,FCVAR_SERVER)
  48.  
  49. cvar_jetpack = register_cvar("zp_jetpack", "2")
  50.  
  51. cvar_jetpackSpeed=register_cvar("zp_jp_forward_speed","300.0")
  52. cvar_jetpackUpSpeed=register_cvar("zp_jp_up_speed","35.0")
  53. cvar_jetpackAcrate=register_cvar("zp_jp_accelerate","100.0")
  54.  
  55. cvar_RocketDelay=register_cvar("zp_jp_rocket_delay","12.0")
  56. cvar_RocketSpeed=register_cvar("zp_jp_rocket_speed","1500")
  57. cvar_RocketDmg=register_cvar("zp_jp_rocket_damage","1500")
  58. cvar_Dmg_range=register_cvar("zp_jp_damage_radius","350")
  59.  
  60. cvar_fly_max_engery = register_cvar("zp_jp_max_engery", "100")
  61. cvar_fly_engery = register_cvar("zp_jp_engery", "10")
  62. cvar_regain_energy = register_cvar("zp_jp_regain_energy", "3")
  63. cvar_cal_time = register_cvar("zp_jp_energy_cal", "1.0")
  64. cvar_oneround = register_cvar("zp_jp_oneround", "0")
  65.  
  66.  
  67. register_event("CurWeapon", "check_models", "be")
  68. register_event("DeathMsg", "player_die", "a")
  69. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  70.  
  71. register_forward(FM_StartFrame, "fm_startFrame")
  72. register_forward(FM_EmitSound, "emitsound")
  73. }
  74.  
  75. public plugin_precache() {
  76. precache_model("models/p_egon.mdl")
  77. precache_model("models/v_egon.mdl")
  78. precache_model("models/w_egon.mdl")
  79. precache_sound("jetpack.wav")
  80. precache_sound("jp_blow.wav")
  81.  
  82. precache_model(ROCKET_MDL)
  83. precache_sound(ROCKET_SOUND)
  84. precache_sound(getrocket)
  85.  
  86. explosion = precache_model("sprites/zerogxplode.spr")
  87. white = precache_model("sprites/white.spr")
  88. }
  89.  
  90. public client_putinserver(id) {
  91. fly[id] = false
  92. rocket[id] = false
  93. hasjet[id] = 0
  94. g_flyEnergy[id] = 0
  95. }
  96.  
  97. public client_disconnect(id) {
  98. fly[id] = false
  99. rocket[id] = false
  100. hasjet[id] = 0
  101. g_flyEnergy[id] = 0
  102. }
  103.  
  104. public event_round_start()
  105. {
  106. remove_jetpacks();
  107. if (get_pcvar_num(cvar_oneround) == 1) {
  108. for (new id; id <= 32; id++) hasjet[id] = 0, g_flyEnergy[id] = 0, fly[id] = false;
  109. }
  110. }
  111.  
  112. public fm_startFrame(){
  113.  
  114. gltime = get_gametime()
  115. static id
  116. for (id = 1; id <= 32; id++)
  117. {
  118. jp_forward(id)
  119. }
  120. }
  121.  
  122. public jp_forward(player) {
  123.  
  124. if (!is_user_alive(player) || (zp_get_user_zombie(player) || zp_get_user_nemesis(player) || zp_get_user_survivor(player)))
  125. return FMRES_IGNORED
  126.  
  127. if (!hasjet[player])
  128. return FMRES_IGNORED
  129.  
  130. if(jp_cal[player] < gltime){
  131. jp_energy(player); jp_cal[player] = gltime + get_pcvar_float(cvar_cal_time)
  132. }
  133.  
  134. check_rocket(player)
  135.  
  136. new clip,ammo
  137. new wpnid = get_user_weapon(player,clip,ammo)
  138. if (wpnid == CSW_KNIFE){
  139. if(get_pcvar_num(cvar_jetpack) == 1){
  140. if(!(pev(player, pev_flags)&FL_ONGROUND) && pev(player,pev_button)&IN_ATTACK){
  141. if((g_flyEnergy[player] > get_pcvar_num(cvar_fly_max_engery)*0.3) && (g_flyEnergy[player] <= get_pcvar_num(cvar_fly_max_engery))){
  142. if(jp_soun[player] < gltime){
  143. emit_sound(player,CHAN_ITEM,"jetpack.wav",1.0,ATTN_NORM,1,PITCH_HIGH)
  144. jp_soun[player] = gltime + 1.0
  145. }
  146. }
  147. else if((g_flyEnergy[player] > 0) && (g_flyEnergy[player] < get_pcvar_num(cvar_fly_max_engery)*0.3)){
  148. if(jp_soun[player] < gltime){
  149. emit_sound(player,CHAN_ITEM,"jp_blow.wav",1.0,ATTN_NORM,1,PITCH_HIGH)
  150. jp_soun[player] = gltime + 1.0
  151. }
  152. }
  153. }
  154. human_fly(player)
  155. attack(player)
  156. }
  157. if((pev(player,pev_button)&IN_ATTACK2)){
  158. attack2(player)
  159. }
  160. }
  161. if((get_pcvar_num(cvar_jetpack) == 2 && !(pev(player, pev_flags)&FL_ONGROUND)) && (pev(player,pev_button)&IN_JUMP && pev(player,pev_button)&IN_DUCK) && get_user_weapon(player) == CSW_KNIFE)
  162. {
  163. if((g_flyEnergy[player] > get_pcvar_num(cvar_fly_max_engery)*0.3) && (g_flyEnergy[player] <= get_pcvar_num(cvar_fly_max_engery)))
  164. {
  165. if(jp_soun[player] < gltime)
  166. {
  167. if(get_user_weapon(player) == CSW_KNIFE)
  168. {
  169. emit_sound(player,CHAN_ITEM,"jetpack.wav",1.0,ATTN_NORM,1,PITCH_HIGH)
  170. jp_soun[player] = gltime + 1.0
  171. }
  172. }
  173. }
  174. else if((g_flyEnergy[player] > 0) && (g_flyEnergy[player] < get_pcvar_num(cvar_fly_max_engery)*0.3))
  175. {
  176. if(jp_soun[player] < gltime)
  177. {
  178. if(get_user_weapon(player) == CSW_KNIFE)
  179. {
  180. emit_sound(player,CHAN_ITEM,"jp_blow.wav",1.0,ATTN_NORM,1,PITCH_HIGH)
  181. jp_soun[player] = gltime + 1.0
  182. }
  183. }
  184. }
  185. human_fly(player)
  186. attack(player)
  187. }
  188. if((g_flyEnergy[player] >= get_pcvar_num(cvar_fly_max_engery)*0.8) && (g_flyEnergy[player] <= get_pcvar_num(cvar_fly_max_engery)))
  189. {
  190. Icon_Energy({0, 255, 0}, 1, player); // Green
  191. }
  192. else if((g_flyEnergy[player] >= get_pcvar_num(cvar_fly_max_engery)*0.5) && (g_flyEnergy[player] < get_pcvar_num(cvar_fly_max_engery)*0.8))
  193. {
  194. Icon_Energy({255, 255, 0}, 1, player); // yellow
  195. }
  196. else if((g_flyEnergy[player] >= get_pcvar_num(cvar_fly_max_engery)*0.3) && (g_flyEnergy[player] < get_pcvar_num(cvar_fly_max_engery)*0.5))
  197. {
  198. Icon_Energy({255, 215, 0}, 2, player);
  199. }
  200. else if((g_flyEnergy[player] > 0) && (g_flyEnergy[player] < get_pcvar_num(cvar_fly_max_engery)*0.3))
  201. {
  202. Icon_Energy({255, 0, 0}, 1, player);
  203. }
  204. return FMRES_IGNORED
  205. }
  206.  
  207. public jp_energy(player) {
  208.  
  209. if (!(pev(player, pev_flags)&FL_ONGROUND) && pev(player,pev_button)&IN_ATTACK)
  210. {
  211. // Get our current velocity
  212. new clip,ammo
  213. new wpnid = get_user_weapon(player,clip,ammo)
  214. if (wpnid == CSW_KNIFE)
  215. {
  216. // flying
  217. if(g_flyEnergy[player] > get_pcvar_num(cvar_fly_max_engery)*0.09)
  218. g_flyEnergy[player] = g_flyEnergy[player] - get_pcvar_num(cvar_fly_engery); // Increase distance counter
  219. }
  220. }
  221. else if ((get_pcvar_num(cvar_jetpack) == 2 && !(pev(player, pev_flags)&FL_ONGROUND)) && (pev(player,pev_button)&IN_JUMP && pev(player,pev_button)&IN_DUCK))
  222. {
  223. if(g_flyEnergy[player] > get_pcvar_num(cvar_fly_max_engery)*0.09)
  224. g_flyEnergy[player] = g_flyEnergy[player] - get_pcvar_num(cvar_fly_engery); // Increase distance counter
  225. }
  226. // Walking/Runnig
  227. if (pev(player, pev_flags) & FL_ONGROUND)
  228. g_flyEnergy[player] = g_flyEnergy[player] + get_pcvar_num(cvar_regain_energy);// Decrease distance counter
  229. }
  230.  
  231. public attack(player) {
  232. //code snippa from TS_Jetpack 1.0 - Jetpack plugin for The Specialists.
  233. //http://forums.alliedmods.net/showthread.php?s=3ea22295e3e5a292fa82899676583326&t=55709&highlight=jetpack
  234. //By: Bad_Bud
  235. if(fly[player])
  236. {
  237. static Float:JetpackData[3]
  238. pev(player,pev_velocity,JetpackData)
  239.  
  240. new fOrigin[3],Float:Aim[3]
  241. VelocityByAim(player, 10, Aim)
  242. get_user_origin(player,fOrigin)
  243. fOrigin[0] -= floatround(Aim[0])
  244. fOrigin[1] -= floatround(Aim[1])
  245. fOrigin[2] -= floatround(Aim[2])
  246.  
  247.  
  248. if((pev(player,pev_button)&IN_FORWARD) && !(pev(player, pev_flags) & FL_ONGROUND))
  249. {
  250.  
  251. message_begin(MSG_ALL,SVC_TEMPENTITY)
  252. write_byte(17)
  253. write_coord(fOrigin[0])
  254. write_coord(fOrigin[1])
  255. write_coord(fOrigin[2])
  256. write_short(flame)
  257. write_byte(10)
  258. write_byte(255)
  259. message_end()
  260.  
  261. static Float:Speed
  262. Speed=floatsqroot(JetpackData[0]*JetpackData[0]+JetpackData[1]*JetpackData[1])
  263.  
  264. if(Speed!=0.0)//Makes players only lay down if their speed isn't 0; if they are thrusting forward.
  265. {
  266. set_pev(player,pev_gaitsequence,0)
  267. set_pev(player,pev_sequence,111)
  268. }
  269.  
  270. if(Speed<get_pcvar_float(cvar_jetpackSpeed))
  271. Speed+=get_pcvar_float(cvar_jetpackAcrate)
  272.  
  273. static Float:JetpackData2[3]
  274. pev(player,pev_angles,JetpackData2)
  275. JetpackData2[2]=0.0//Remove the Z value/
  276.  
  277. angle_vector(JetpackData2,ANGLEVECTOR_FORWARD,JetpackData2)
  278. JetpackData2[0]*=Speed
  279. JetpackData2[1]*=Speed
  280.  
  281. JetpackData[0]=JetpackData2[0]
  282. JetpackData[1]=JetpackData2[1]
  283. }
  284.  
  285. if(JetpackData[2]<get_pcvar_float(cvar_jetpackSpeed)&&JetpackData[2]>0.0)//Jetpacks get more power on the way down -- it helps landing.
  286. JetpackData[2]+=get_pcvar_float(cvar_jetpackUpSpeed)
  287. else if(JetpackData[2]<0.0)
  288. JetpackData[2]+=(get_pcvar_float(cvar_jetpackUpSpeed)*1.15)
  289.  
  290. set_pev(player,pev_velocity,JetpackData)
  291. }
  292. }
  293.  
  294. public attack2(player) {
  295.  
  296. if (rocket[player])
  297. {
  298.  
  299. new rocket = create_entity("info_target")
  300. if(rocket == 0) return PLUGIN_CONTINUE
  301.  
  302. entity_set_string(rocket, EV_SZ_classname, "zp_jp_rocket")
  303. entity_set_model(rocket, ROCKET_MDL)
  304.  
  305. entity_set_size(rocket, Float:{0.0, 0.0, 0.0}, Float:{0.0, 0.0, 0.0})
  306. entity_set_int(rocket, EV_INT_movetype, MOVETYPE_FLY)
  307. entity_set_int(rocket, EV_INT_solid, SOLID_BBOX)
  308.  
  309. new Float:vSrc[3]
  310. entity_get_vector(player, EV_VEC_origin, vSrc)
  311.  
  312. new Float:Aim[3],Float:origin[3]
  313. VelocityByAim(player, 64, Aim)
  314. entity_get_vector(player,EV_VEC_origin,origin)
  315.  
  316. vSrc[0] += Aim[0]
  317. vSrc[1] += Aim[1]
  318. entity_set_origin(rocket, vSrc)
  319.  
  320. new Float:velocity[3], Float:angles[3]
  321. VelocityByAim(player, get_pcvar_num(cvar_RocketSpeed), velocity)
  322.  
  323. entity_set_vector(rocket, EV_VEC_velocity, velocity)
  324. vector_to_angle(velocity, angles)
  325. entity_set_vector(rocket, EV_VEC_angles, angles)
  326. entity_set_edict(rocket,EV_ENT_owner,player)
  327. entity_set_float(rocket, EV_FL_takedamage, 1.0)
  328.  
  329. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  330. write_byte(TE_BEAMFOLLOW)
  331. write_short(rocket)
  332. write_short(trail)
  333. write_byte(25)
  334. write_byte(5)
  335. write_byte(224)
  336. write_byte(224)
  337. write_byte(255)
  338. write_byte(255)
  339. message_end()
  340.  
  341. emit_sound(rocket, CHAN_WEAPON, ROCKET_SOUND, 1.0, ATTN_NORM, 0, PITCH_NORM)
  342.  
  343. shot[player] = true
  344. last_Rocket[player] = gltime + get_pcvar_num(cvar_RocketDelay)
  345. }
  346. return PLUGIN_CONTINUE
  347. }
  348.  
  349. public check_models(id) {
  350.  
  351. if (zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id))
  352. return FMRES_IGNORED
  353.  
  354. if(hasjet[id]) {
  355. new clip,ammo
  356. new wpnid = get_user_weapon(id,clip,ammo)
  357.  
  358. if ( wpnid == CSW_KNIFE ) {
  359. switchmodel(id)
  360. }
  361. return PLUGIN_CONTINUE
  362. }
  363. return PLUGIN_CONTINUE
  364. }
  365.  
  366. public switchmodel(id) {
  367. entity_set_string(id,EV_SZ_viewmodel,"models/v_egon.mdl")
  368. entity_set_string(id,EV_SZ_weaponmodel,"models/p_egon.mdl")
  369. }
  370.  
  371. public remove_jetpacks() {
  372. new nextitem = find_ent_by_class(-1,"zp_jp_jetpack")
  373. while(nextitem) {
  374. remove_entity(nextitem)
  375. nextitem = find_ent_by_class(-1,"zp_jp_jetpack")
  376. }
  377. return PLUGIN_CONTINUE
  378. }
  379.  
  380. public emitsound(entity, channel, const sample[]) {
  381. if(is_user_alive(entity)) {
  382. new clip,ammo
  383. new weapon = get_user_weapon(entity,clip,ammo)
  384.  
  385. if(hasjet[entity] && weapon == CSW_KNIFE) {
  386. if(equal(sample,"weapons/knife_slash1.wav")) return FMRES_SUPERCEDE
  387. if(equal(sample,"weapons/knife_slash2.wav")) return FMRES_SUPERCEDE
  388.  
  389. if(equal(sample,"weapons/knife_deploy1.wav")) return FMRES_SUPERCEDE
  390. if(equal(sample,"weapons/knife_hitwall1.wav")) return FMRES_SUPERCEDE
  391.  
  392. if(equal(sample,"weapons/knife_hit1.wav")) return FMRES_SUPERCEDE
  393. if(equal(sample,"weapons/knife_hit2.wav")) return FMRES_SUPERCEDE
  394. if(equal(sample,"weapons/knife_hit3.wav")) return FMRES_SUPERCEDE
  395. if(equal(sample,"weapons/knife_hit4.wav")) return FMRES_SUPERCEDE
  396.  
  397. if(equal(sample,"weapons/knife_stab.wav")) return FMRES_SUPERCEDE
  398. }
  399. }
  400. return FMRES_IGNORED
  401. }
  402.  
  403. public Icon_Show(icon[], color[3], mode, player)
  404. {
  405. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("StatusIcon"), {0,0,0}, player);
  406. write_byte(mode); // status (0=hide, 1=show, 2=flash)
  407. write_string(icon); // sprite name
  408. write_byte(color[0]); // red
  409. write_byte(color[1]); // green
  410. write_byte(color[2]); // blue
  411. message_end();
  412. }
  413.  
  414. public Icon_Energy(color[3], mode, player) {
  415.  
  416. Icon_Show("item_longjump", color, mode, player)
  417. }
  418.  
  419. public human_fly(player) {
  420.  
  421. if (g_flyEnergy[player] <= get_pcvar_num(cvar_fly_max_engery)*0.1)
  422. {
  423. jp_off(player);
  424. }
  425. if (g_flyEnergy[player] > get_pcvar_num(cvar_fly_max_engery)*0.1)
  426. {
  427. jp_on(player);
  428. }
  429. }
  430.  
  431. public jp_on(player) {
  432.  
  433. fly[player] = true
  434.  
  435. }
  436.  
  437. public jp_off(player) {
  438.  
  439. fly[player] = false
  440.  
  441. }
  442.  
  443. public check_rocket(player) {
  444.  
  445. if (last_Rocket[player] > gltime)
  446. {
  447. rk_forbidden(player)
  448. rksound[player] = true
  449. }
  450. else
  451. {
  452.  
  453. if (shot[player])
  454. {
  455. rksound[player] = false
  456. shot[player] = false
  457. }
  458. rk_sound(player)
  459. rk_allow(player)
  460. }
  461.  
  462. }
  463.  
  464. public rk_allow(player) {
  465.  
  466. rocket[player] = true
  467. }
  468.  
  469. public rk_forbidden(player) {
  470.  
  471. rocket[player] = false
  472.  
  473. }
  474.  
  475. public rk_sound(player) {
  476.  
  477. if (!rksound[player])
  478. {
  479. engfunc(EngFunc_EmitSound, player, CHAN_WEAPON, getrocket, 1.0, ATTN_NORM, 0, PITCH_NORM)
  480. client_print(player, print_center, "* Bazooka UJRATOLTVE *")
  481. rksound[player] = true
  482. }
  483. else if (rksound[player])
  484. {
  485.  
  486. }
  487.  
  488. }
  489.  
  490. public player_die() {
  491.  
  492. new id = read_data(2)
  493. if(hasjet[id])
  494. {
  495. hasjet[id] = 0
  496. rocket[id] = false
  497. g_flyEnergy[id] = 0
  498. }
  499.  
  500. return PLUGIN_CONTINUE
  501. }
  502.  
  503. public pfn_touch(ptr, ptd)
  504. {
  505. if(is_valid_ent(ptr))
  506. {
  507. new classname[32]
  508. entity_get_string(ptr,EV_SZ_classname,classname,31)
  509.  
  510. if(equal(classname, "zp_jp_rocket"))
  511. {
  512. new Float:fOrigin[3]
  513. new iOrigin[3]
  514. entity_get_vector(ptr, EV_VEC_origin, fOrigin)
  515. FVecIVec(fOrigin,iOrigin)
  516. jp_radius_damage(ptr)
  517.  
  518. message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)
  519. write_byte(TE_EXPLOSION)
  520. write_coord(iOrigin[0])
  521. write_coord(iOrigin[1])
  522. write_coord(iOrigin[2])
  523. write_short(explosion)
  524. write_byte(30)
  525. write_byte(15)
  526. write_byte(0)
  527. message_end()
  528.  
  529. message_begin(MSG_ALL,SVC_TEMPENTITY,iOrigin)
  530. write_byte(TE_BEAMCYLINDER)
  531. write_coord(iOrigin[0])
  532. write_coord(iOrigin[1])
  533. write_coord(iOrigin[2])
  534. write_coord(iOrigin[0])
  535. write_coord(iOrigin[1])
  536. write_coord(iOrigin[2]+200)
  537. write_short(white)
  538. write_byte(0)
  539. write_byte(1)
  540. write_byte(6)
  541. write_byte(8)
  542. write_byte(1)
  543. write_byte(255)
  544. write_byte(255)
  545. write_byte(192)
  546. write_byte(128)
  547. write_byte(5)
  548. message_end()
  549.  
  550. if(is_valid_ent(ptd))
  551. {
  552. new classname2[32]
  553. entity_get_string(ptd,EV_SZ_classname,classname2,31)
  554.  
  555. if(equal(classname2,"func_breakable"))
  556. force_use(ptr,ptd)
  557. }
  558.  
  559. remove_entity(ptr)
  560. }
  561. }
  562. return PLUGIN_CONTINUE
  563. }
  564.  
  565. public zp_user_infected_pre(player, infector){
  566.  
  567. Icon_Energy({0, 255, 0}, 0, player);
  568. hasjet[player] = 0;
  569. g_flyEnergy[player] = 0;
  570. rocket[player] = false;
  571. }
  572.  
  573. public zp_extra_item_selected(player, itemid){
  574.  
  575.  
  576. new clip,ammo
  577. new weapon = get_user_weapon(player,clip,ammo)
  578.  
  579. if (itemid == g_item_jetpack)
  580. {
  581. hasjet[player] = 1
  582. g_flyEnergy[player] = get_pcvar_num(cvar_fly_max_engery)
  583. rocket[player] = true
  584. client_cmd(player,"spk items/gunpickup2.wav")
  585.  
  586. if(weapon == CSW_KNIFE)
  587. {
  588. switchmodel(player)
  589. }
  590. else
  591. {
  592. engclient_cmd(player,"weapon_knife"),switchmodel(player)
  593. }
  594. }
  595. }
  596.  
  597. stock jp_radius_damage(entity) {
  598. new id = entity_get_edict(entity,EV_ENT_owner)
  599. for(new i = 1; i < 33; i++) {
  600. if(is_user_alive(i)) {
  601. new dist = floatround(entity_range(entity,i))
  602.  
  603. if(dist <= get_pcvar_num(cvar_Dmg_range)) {
  604. new hp = get_user_health(i)
  605. new Float:damage = get_pcvar_float(cvar_RocketDmg)-(get_pcvar_float(cvar_RocketDmg)/get_pcvar_float(cvar_Dmg_range))*float(dist)
  606.  
  607. new Origin[3]
  608. get_user_origin(i,Origin)
  609.  
  610. if(zp_get_user_zombie(id) != zp_get_user_zombie(i)) {
  611. if(hp > damage)
  612. jp_take_damage(i,floatround(damage),Origin,DMG_BLAST)
  613. else
  614. log_kill(id,i,"Jetpack Rocket",0)
  615. }
  616. }
  617. }
  618. }
  619. }
  620.  
  621. stock log_kill(killer, victim, weapon[], headshot)
  622. {
  623. // code from MeRcyLeZZ
  624. set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
  625. ExecuteHamB(Ham_Killed, victim, killer, 2) // set last param to 2 if you want victim to gib
  626. set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
  627.  
  628.  
  629. message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))
  630. write_byte(killer)
  631. write_byte(victim)
  632. write_byte(headshot)
  633. write_string(weapon)
  634. message_end()
  635. //
  636.  
  637. if(get_user_team(killer)!=get_user_team(victim))
  638. set_user_frags(killer,get_user_frags(killer) +1)
  639. if(get_user_team(killer)==get_user_team(victim))
  640. set_user_frags(killer,get_user_frags(killer) -1)
  641.  
  642. new kname[32], vname[32], kauthid[32], vauthid[32], kteam[10], vteam[10]
  643.  
  644. get_user_name(killer, kname, 31)
  645. get_user_team(killer, kteam, 9)
  646. get_user_authid(killer, kauthid, 31)
  647.  
  648. get_user_name(victim, vname, 31)
  649. get_user_team(victim, vteam, 9)
  650. get_user_authid(victim, vauthid, 31)
  651.  
  652. log_message("^"%s<%d><%s><%s>^" MEGOLVE ^"%s<%d><%s><%s>^" with ^"%s^"",
  653. kname, get_user_userid(killer), kauthid, kteam,
  654. vname, get_user_userid(victim), vauthid, vteam, weapon)
  655.  
  656. return PLUGIN_CONTINUE;
  657. }
  658.  
  659. stock jp_take_damage(victim,damage,origin[3],bit) {
  660. message_begin(MSG_ONE,get_user_msgid("Damage"),{0,0,0},victim)
  661. write_byte(21)
  662. write_byte(20)
  663. write_long(bit)
  664. write_coord(origin[0])
  665. write_coord(origin[1])
  666. write_coord(origin[2])
  667. message_end()
  668.  
  669. set_user_health(victim,get_user_health(victim)-damage)
  670. }

_________________
<<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ások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 1 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