SHARE
TWEET

Untitled

a guest May 25th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Create_PlasmaBall(iPlayer)
  2. {
  3.     new iEntity = engfunc(EngFunc_CreateNamedEntity, gl_iszAllocString_EnvSprite);
  4.     if(!iEntity) return 0;
  5.  
  6.     new Float: flGameTime = get_gametime();
  7.     new Float: vecOrigin[3]; pev(iPlayer, pev_origin, vecOrigin);
  8.     new Float: vecAngles[3]; pev(iPlayer, pev_v_angle, vecAngles);
  9.     new Float: vecVelocity[3]; angle_vector(vecAngles, ANGLEVECTOR_FORWARD, vecVelocity);
  10.     new Float: vecViewOfs[3]; pev(iPlayer, pev_view_ofs, vecViewOfs);
  11.  
  12.     vecOrigin[0] += vecViewOfs[0] + vecVelocity[0] * 20.0;
  13.     vecOrigin[1] += vecViewOfs[1] + vecVelocity[1] * 20.0;
  14.     vecOrigin[2] += vecViewOfs[2] + vecVelocity[2] * 20.0;
  15.  
  16.     vecVelocity[0] *= ENTITY_PLASMABALL_SPEED;
  17.     vecVelocity[1] *= ENTITY_PLASMABALL_SPEED;
  18.     vecVelocity[2] *= ENTITY_PLASMABALL_SPEED;
  19.  
  20.     engfunc(EngFunc_SetModel, iEntity, ENTITY_PLASMABALL_SPRITE);
  21.     engfunc(EngFunc_SetSize, iEntity, Float: {-1.0, -1.0, -1.0}, Float: {1.0, 1.0, 1.0});
  22.     engfunc(EngFunc_SetOrigin, iEntity, vecOrigin);
  23.  
  24.     set_pev_string(iEntity, pev_classname, gl_iszAllocString_PlasmaBall);
  25.     set_pev(iEntity, pev_spawnflags, SF_SPRITE_TEMPORARY);
  26.     set_pev(iEntity, pev_solid, SOLID_TRIGGER);
  27.     set_pev(iEntity, pev_movetype, MOVETYPE_FLY);
  28.     set_pev(iEntity, pev_owner, iPlayer);
  29.     set_pev(iEntity, pev_velocity, vecVelocity);
  30.    
  31.     set_pev(iEntity, pev_animtime, flGameTime);
  32.     set_pev(iEntity, pev_framerate, 10.0);
  33.     set_pev(iEntity, pev_frame, 1.0);
  34.  
  35.     set_pev(iEntity, pev_rendermode, kRenderTransAdd);
  36.     set_pev(iEntity, pev_renderamt, 200.0);
  37.     set_pev(iEntity, pev_scale, 0.5);
  38.  
  39.     return iEntity;
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top