hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.07.05. 22:19



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-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  [2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: javítani valaki?
HozzászólásElküldve:2014.03.09. 13:56 
Offline
Jómunkásember

Csatlakozott:2014.01.04. 18:31
Hozzászólások:326
Megköszönt másnak: 79 alkalommal
Megköszönték neki: 7 alkalommal
Ebbe mia hiba?

SMA Forráskód: [ Mindet kijelol ]
  1. public kula1(id)
  2. {
  3.  
  4. new xD = floatround(halflife_time()-wait1[id])
  5. new czas = 10-xD
  6. if (halflife_time()-wait1[id] <= 10)
  7. {
  8. client_print(id, print_center, "Za %d sek mozesz uzyc mocy!", czas)
  9. return PLUGIN_CONTINUE;
  10. }
  11. else {
  12. DispBall_Spawn(id)
  13. wait1[id]=floatround(halflife_time())
  14. }
  15. return PLUGIN_HANDLED
  16. }
  17. public DispBall_Explode(ent)
  18. {
  19. if (!pev(ent, pev_iuser3)){
  20. new Float: origin[3];
  21. pev(ent, pev_origin, origin);
  22. set_pev(ent, pev_iuser3, 1);
  23.  
  24. UTIL_MakeBeamCylinder(origin, m_DispRing) ;
  25.  
  26. new Players[32], playerCount, a
  27. get_players(Players, playerCount, "ah")
  28.  
  29. new id = pev(ent,pev_owner)
  30. for (new i=0; i<playerCount; i++)
  31. {
  32. a = Players[i]
  33.  
  34. new Float:aOrigin[3]
  35. pev(a,pev_origin,aOrigin)
  36.  
  37. if (get_user_team(id) != get_user_team(a) && get_distance_f(aOrigin,origin) < 280.0)
  38. {
  39. ExecuteHamB(Ham_TakeDamage, a, ent, id, 25.0+player_intelligence[id]*1.5, DMG_ENERGYBEAM );
  40. }
  41.  
  42. }
  43. }
  44. set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0});
  45. set_pev(ent, pev_iuser4, 1);
  46. set_pev(ent, pev_nextthink, get_gametime() + 0.6);
  47. }
  48. public DispBall_Spawn(id)
  49. {
  50. static AllocStringCached;
  51. if (!AllocStringCached)
  52. {
  53. AllocStringCached = engfunc(EngFunc_AllocString, "info_target");
  54. }
  55.  
  56. new ent = engfunc(EngFunc_CreateNamedEntity, AllocStringCached);
  57. if(!pev_valid(ent)) return 0;
  58.  
  59. set_pev(ent, pev_classname, BALL_CLASSNAME);
  60.  
  61. new Float: origin[3];
  62. new Float: velocity[3];
  63. new Float: v_forward[3];
  64. new Float: v_right[3];
  65. new Float: v_up[3];
  66.  
  67. GetGunPosition(id, origin);
  68.  
  69. global_get(glb_v_forward, v_forward);
  70. global_get(glb_v_right, v_right);
  71. global_get(glb_v_up, v_up);
  72.  
  73. //xs_vec_mul_scalar(v_forward, 29.0, v_forward)
  74. xs_vec_mul_scalar(v_right, 2.0, v_right);
  75. xs_vec_mul_scalar(v_up, -5.0, v_up);
  76.  
  77. xs_vec_add(origin, v_forward, origin);
  78. xs_vec_add(origin, v_right, origin);
  79. xs_vec_add(origin, v_up, origin);
  80.  
  81. set_pev(ent, pev_origin, origin);
  82. set_pev(ent, pev_owner, id);
  83. set_pev(ent, pev_dmg, 100.0);
  84.  
  85. engfunc(EngFunc_SetModel, ent, m_ExitPortal);
  86. engfunc(EngFunc_SetSize, ent, Float:{0.0, 0.0, 0.0} , Float:{0.0, 0.0, 0.0});
  87.  
  88. set_pev(ent, pev_effects, pev(ent, pev_effects) | EF_LIGHT);
  89. set_rendering(ent, kRenderFxNone, 0, 0, 0, kRenderTransAdd, 255);
  90.  
  91. velocity_by_aim(id, 500, velocity);
  92. set_pev(ent, pev_velocity, velocity);
  93.  
  94. dllfunc(DLLFunc_Spawn, ent);
  95.  
  96. set_pev(ent, pev_movetype, MOVETYPE_FLY);
  97. set_pev(ent, pev_solid, SOLID_BBOX);
  98. set_pev(ent, pev_scale, 5);
  99. set_pev(ent, pev_nextthink, get_gametime() + 0.1);
  100.  
  101. return ent;
  102. }
  103.  
  104. public DispBall_Think(ent)
  105. {
  106. if (!pev_valid(ent))
  107. return;
  108.  
  109. DispBall_Animate(ent);
  110.  
  111. if (pev(ent, pev_iuser4))
  112. {
  113. remove_entity(ent);
  114. return;
  115. }
  116.  
  117. static Float: velocity[3];
  118. pev(ent, pev_velocity, velocity);
  119.  
  120. if (!vector_length(velocity) || !IsInWorld(ent))
  121. {
  122. DispBall_Explode(ent)
  123. return;
  124. }
  125.  
  126. static ptr, i, id, owner, beam;
  127. static Float: Dist;
  128. static Float: flFraction;
  129. static Float: origin[3];
  130. static Float: vecDir[3];
  131. static Float: vecEndPos[3];
  132.  
  133. Dist = 1.00; ptr = create_tr2();
  134.  
  135. pev(ent, pev_origin, origin);
  136.  
  137. while ((id = engfunc(EngFunc_FindEntityInSphere, id, origin, 280.0)))
  138. {
  139. if (random_float(0.0, 1.0) <= 0.2 && pev(id, pev_takedamage) && is_visible(id, ent) && id != (owner = pev(ent, pev_owner)))
  140. {
  141. static Float: target_origin[3]; pev(id, pev_origin, target_origin);
  142.  
  143. ExecuteHamB(Ham_TakeDamage, id, ent, owner, 22.0, DMG_ENERGYBEAM );
  144.  
  145. if ((beam = BeamCreate(id, SPRITE_PLASMA, m_Plasma, 65.0)))
  146. {
  147. RelinkBeam(beam, origin, target_origin);
  148.  
  149. BeamSetColor(beam, 255.0, 255.0, 255.0);
  150. BeamSetNoise(beam, 45);
  151. BeamSetBrightness(beam, 255.0);
  152. BeamSetScrollRate(beam, 35.0);
  153. BeamLiveForTime(beam, 0.1);
  154. }
  155. }
  156. }
  157. for (i = 0; i < 10; i++)
  158. {
  159. vecDir[0] = random_float(-1.0, 1.0);
  160. vecDir[1] = random_float(-1.0, 1.0);
  161. vecDir[2] = random_float(-1.0, 1.0);
  162.  
  163. VecNormilize(vecDir, vecDir);
  164. xs_vec_mul_scalar(vecDir, 1536.0, vecDir);
  165. xs_vec_add(vecDir, origin, vecDir);
  166.  
  167. engfunc(EngFunc_TraceLine, origin, vecDir, IGNORE_MONSTERS, ent, ptr);
  168. get_tr2(ptr, TR_flFraction, flFraction);
  169.  
  170. if (Dist > flFraction)
  171. {
  172. get_tr2(ptr, TR_vecEndPos, vecEndPos);
  173. Dist = flFraction;
  174. }
  175. }
  176.  
  177. if (Dist < 1.0)
  178. {
  179. if ((beam = BeamCreate(ent, SPRITE_PLASMA, m_Plasma, 30.0)))
  180. {
  181. RelinkBeam(beam, vecEndPos, origin);
  182.  
  183. BeamSetColor(beam, 23.0, 170.0, 17.0);
  184. BeamSetNoise(beam, 65);
  185. BeamSetBrightness(beam, 255.0);
  186. BeamSetScrollRate(beam, 35.0);
  187. BeamLiveForTime(beam, 1.0);
  188. }
  189. }
  190.  
  191. set_pev(ent, pev_nextthink, get_gametime() + 0.1);
  192. free_tr2(ptr);
  193. }
  194.  
  195. public DispBeam_Think(ent)
  196. {
  197. if (pev_valid(ent))
  198. {
  199. remove_entity(ent);
  200. }
  201. }
  202.  
  203. public DispBall_Explode_Touch(ent)
  204. {
  205. if (pev_valid(ent))
  206. {
  207. DispBall_Explode(ent);
  208. }
  209. }
  210.  
  211. stock GetGunPosition(const player, Float:origin[3] )
  212. {
  213. new Float:viewOfs[3];
  214.  
  215. pev(player, pev_origin, origin);
  216. pev(player, pev_view_ofs, viewOfs);
  217.  
  218. xs_vec_add( origin, viewOfs, origin);
  219. }
  220. stock BeamCreate(const endIndex, const pSpriteName[], const spriteIndex, const Float: width)
  221. {
  222. static AllocStringCached;
  223. if (!AllocStringCached)
  224. {
  225. AllocStringCached = engfunc(EngFunc_AllocString, "beam");
  226. }
  227.  
  228. static ent;
  229. if (!(ent = engfunc(EngFunc_CreateNamedEntity, AllocStringCached)))
  230. return 0;
  231.  
  232. set_pev(ent, pev_classname, BEAM_CLASSNAME);
  233.  
  234. set_pev(ent, pev_flags, pev(ent, pev_flags) | FL_CUSTOMENTITY);
  235.  
  236. BeamSetFrame(ent, 0);
  237.  
  238. set_pev(ent, pev_model, pSpriteName);
  239.  
  240. BeamSetTexture(ent, spriteIndex);
  241. BeamSetWidth(ent, width);
  242.  
  243. set_pev(ent, pev_skin, endIndex);
  244. set_pev(ent, pev_sequence, 0);
  245. set_pev(ent, pev_rendermode, 1);
  246.  
  247. DispatchSpawn(ent);
  248.  
  249. return ent;
  250. }
  251. stock RelinkBeam(const beam, const Float: startPos[3], const Float: endPos[3])
  252. {
  253. static Float: mins[3], Float: maxs[3];
  254.  
  255. mins[0] = floatmin(startPos[0], endPos[0]);
  256. mins[1] = floatmin(startPos[1], endPos[1]);
  257. mins[2] = floatmin(startPos[2], endPos[2]);
  258.  
  259. maxs[0] = floatmax(startPos[0], endPos[0]);
  260. maxs[1] = floatmax(startPos[1], endPos[1]);
  261. maxs[2] = floatmax(startPos[2], endPos[2]);
  262.  
  263. xs_vec_sub(mins, startPos, mins);
  264. xs_vec_sub(maxs, startPos, maxs);
  265.  
  266. set_pev(beam, pev_mins, mins);
  267. set_pev(beam, pev_maxs, maxs);
  268.  
  269. engfunc(EngFunc_SetSize, beam, mins, maxs);
  270. engfunc(EngFunc_SetOrigin, beam, startPos);
  271. }
  272.  
  273.  
  274. stock VecNormilize(Float: in[3], Float: out[3])
  275. {
  276. static Float: vlen;
  277.  
  278. vlen = vector_length(in);
  279. vlen = 1/vlen;
  280.  
  281. out[0] *= vlen;
  282. out[1] *= vlen;
  283. out[2] *= vlen;
  284. }
  285.  
  286. stock UTIL_MakeBeamCylinder(const Float:origin[3], const m_Sprite)
  287. {
  288. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  289. write_byte(TE_BEAMCYLINDER);
  290. engfunc(EngFunc_WriteCoord, origin[0]);
  291. engfunc(EngFunc_WriteCoord, origin[1]);
  292. engfunc(EngFunc_WriteCoord, origin[2]);
  293. engfunc(EngFunc_WriteCoord, origin[0]);
  294. engfunc(EngFunc_WriteCoord, origin[1]);
  295. engfunc(EngFunc_WriteCoord, origin[2] + 200.0) ;
  296. write_short(m_Sprite) ;
  297. write_byte(0);
  298. write_byte(10);
  299. write_byte(3);
  300. write_byte(20);
  301. write_byte(0);
  302. write_byte(255);
  303. write_byte(255);
  304. write_byte(255);
  305. write_byte(255);
  306. write_byte(0);
  307. message_end();
  308. }
  309. DispBall_Animate(const ent)
  310. {
  311. entity_set_float(ent, EV_FL_frame, entity_get_float(ent, EV_FL_frame) + 10.0);
  312.  
  313. if (entity_get_float(ent, EV_FL_frame) > 24.0)
  314. entity_set_float(ent, EV_FL_frame, 0.0);
  315. }
  316.  
  317.  
  318. BeamLiveForTime(const ent, const Float: time)
  319. {
  320. set_pev(ent, pev_nextthink, halflife_time() + time);
  321. }
  322.  
  323. BeamSetColor(const ent, const Float: red, const Float: green, const Float: blue)
  324. {
  325. static Float: rgb[3];
  326.  
  327. rgb[0] = red;
  328. rgb[1] = green;
  329. rgb[2] = blue;
  330.  
  331. set_pev(ent, pev_rendercolor, rgb);
  332. }
  333.  
  334. BeamSetBrightness(const ent, const Float: brightness)
  335. {
  336. set_pev(ent, pev_renderamt, brightness);
  337. }
  338.  
  339. BeamSetNoise(const ent, const noise)
  340. {
  341. set_pev(ent, pev_body, noise);
  342. }
  343.  
  344. BeamSetFrame(const ent, const frame)
  345. {
  346. set_pev(ent, pev_frame, frame);
  347. }
  348.  
  349. BeamSetScrollRate(const ent, const Float: speed)
  350. {
  351. set_pev(ent, pev_animtime, speed);
  352. }
  353.  
  354. BeamSetTexture(const ent, const spriteIndex)
  355. {
  356. set_pev(ent, pev_modelindex, spriteIndex);
  357. }
  358.  
  359. BeamSetWidth(const ent, const Float: width)
  360. {
  361. set_pev(ent, pev_scale, width);
  362. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: javítani valaki?
HozzászólásElküldve:2014.03.09. 18:51 
Offline
Senior Tag
Avatar

Csatlakozott:2013.12.06. 18:38
Hozzászólások:229
Megköszönt másnak: 15 alkalommal
Megköszönték neki: 16 alkalommal
Ez a teljes sma?
Mert hiányzik belőle a tipus verzio és a neve!


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  [2 hozzászólás ] 


Ki van itt

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