Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock create_laser_motion( Float:origin[3], Float:src_corner[3], Float:dst_corner[3], Float:color[3], Float:speed, Float:damage, const name[] )
- {
- static n;
- static m;
- new _name[ 3 ][ 32 ];
- formatex( _name[0], charsmax(_name[]), "%i_%s_target", ++n, name );
- formatex( _name[1], charsmax(_name[]), "%s_train_%i", name, ++m );
- formatex( _name[2], charsmax(_name[]), "%s_train_%i", name, ++m );
- new entity = create_entity( "env_laser" );
- DispatchKeyValue( entity, "LaserTarget", _name[0] );
- DispatchKeyValue( entity, "damage", "100" );
- DispatchKeyValue( entity, "framestart", "0" );
- DispatchKeyValue( entity, "TextureScroll", "35" );
- DispatchKeyValue( entity, "EndSprite", glow01 );
- DispatchKeyValue( entity, "texture", laserbeam );
- DispatchKeyValue( entity, "NoiseAmplitude", "0" );
- DispatchKeyValue( entity, "width", "40" );
- DispatchKeyValue( entity, "renderamt", "100" );
- DispatchKeyValue( entity, "renderfx", "0" );
- DispatchKeyValue( entity, "spawnflags", "97" );
- entity_set_float( entity, EV_FL_dmg, damage );
- entity_set_vector( entity, EV_VEC_rendercolor, color );
- entity_set_origin( entity, origin );
- DispatchSpawn( entity );
- entity = create_entity( "func_train" );
- DispatchKeyValue( entity, "target", _name[1] );
- DispatchKeyValue( entity, "targetname", _name[0] );
- DispatchKeyValue( entity, "rendermode", "2" );
- DispatchKeyValue( entity, "skin", "0" );
- DispatchKeyValue( entity, "dmg", "0" );
- DispatchKeyValue( entity, "stopsnd", "0" );
- DispatchKeyValue( entity, "movesnd", "3" );
- entity_set_float( entity, EV_FL_speed, speed );
- entity_set_int( entity, EV_INT_spawnflags, SF_TRACKTRAIN_PASSABLE );
- entity_set_origin( entity, src_corner );
- DispatchSpawn( entity );
- entity = create_entity( "path_corner" );
- DispatchKeyValue( entity, "target", _name[2] );
- DispatchKeyValue( entity, "targetname", _name[1] );
- entity_set_origin( entity, src_corner );
- DispatchSpawn( entity );
- entity = create_entity( "path_corner" );
- DispatchKeyValue( entity, "target", _name[1] );
- DispatchKeyValue( entity, "targetname", _name[2] );
- entity_set_origin( entity, dst_corner );
- DispatchSpawn( entity );
- entity = create_entity( "trigger_auto" );
- DispatchKeyValue( entity, "delay", "1.0" );
- DispatchKeyValue( entity, "triggerstate", "1" );
- DispatchKeyValue( entity, "target", _name[0] );
- entity_set_int( entity, EV_INT_spawnflags, SF_AUTO_FIREONCE );
- DispatchSpawn( entity );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement