Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. stock create_laser_motion( Float:origin[3], Float:src_corner[3], Float:dst_corner[3], Float:color[3], Float:speed, Float:damage, const name[] )
  2. {
  3. static n;
  4. static m;
  5.  
  6. new _name[ 3 ][ 32 ];
  7. formatex( _name[0], charsmax(_name[]), "%i_%s_target", ++n, name );
  8. formatex( _name[1], charsmax(_name[]), "%s_train_%i", name, ++m );
  9. formatex( _name[2], charsmax(_name[]), "%s_train_%i", name, ++m );
  10.  
  11. new entity = create_entity( "env_laser" );
  12. DispatchKeyValue( entity, "LaserTarget", _name[0] );
  13. DispatchKeyValue( entity, "damage", "100" );
  14. DispatchKeyValue( entity, "framestart", "0" );
  15. DispatchKeyValue( entity, "TextureScroll", "35" );
  16. DispatchKeyValue( entity, "EndSprite", glow01 );
  17. DispatchKeyValue( entity, "texture", laserbeam );
  18. DispatchKeyValue( entity, "NoiseAmplitude", "0" );
  19. DispatchKeyValue( entity, "width", "40" );
  20. DispatchKeyValue( entity, "renderamt", "100" );
  21. DispatchKeyValue( entity, "renderfx", "0" );
  22. DispatchKeyValue( entity, "spawnflags", "97" );
  23. entity_set_float( entity, EV_FL_dmg, damage );
  24. entity_set_vector( entity, EV_VEC_rendercolor, color );
  25. entity_set_origin( entity, origin );
  26. DispatchSpawn( entity );
  27.  
  28. entity = create_entity( "func_train" );
  29. DispatchKeyValue( entity, "target", _name[1] );
  30. DispatchKeyValue( entity, "targetname", _name[0] );
  31. DispatchKeyValue( entity, "rendermode", "2" );
  32. DispatchKeyValue( entity, "skin", "0" );
  33. DispatchKeyValue( entity, "dmg", "0" );
  34. DispatchKeyValue( entity, "stopsnd", "0" );
  35. DispatchKeyValue( entity, "movesnd", "3" );
  36. entity_set_float( entity, EV_FL_speed, speed );
  37. entity_set_int( entity, EV_INT_spawnflags, SF_TRACKTRAIN_PASSABLE );
  38. entity_set_origin( entity, src_corner );
  39. DispatchSpawn( entity );
  40.  
  41. entity = create_entity( "path_corner" );
  42. DispatchKeyValue( entity, "target", _name[2] );
  43. DispatchKeyValue( entity, "targetname", _name[1] );
  44. entity_set_origin( entity, src_corner );
  45. DispatchSpawn( entity );
  46.  
  47. entity = create_entity( "path_corner" );
  48. DispatchKeyValue( entity, "target", _name[1] );
  49. DispatchKeyValue( entity, "targetname", _name[2] );
  50. entity_set_origin( entity, dst_corner );
  51. DispatchSpawn( entity );
  52.  
  53. entity = create_entity( "trigger_auto" );
  54. DispatchKeyValue( entity, "delay", "1.0" );
  55. DispatchKeyValue( entity, "triggerstate", "1" );
  56. DispatchKeyValue( entity, "target", _name[0] );
  57. entity_set_int( entity, EV_INT_spawnflags, SF_AUTO_FIREONCE );
  58. DispatchSpawn( entity );
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement