Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Artillery Script by Sharpe\\
- /*/*//*/*//*/*//*/*//*/*//*/*//*/*//*
- \\
- \\
- \\___.
- _((|_L]_
- _/(__(\_ _)\_
- //*//*/*//*/*//*/*//*/*//*/*//*/*/
- #using_animtree( "custom_anims" );
- #define LAUNCH_EXP "sharpe/artillery/launch_exp"
- #define LAUNCH_SMK "sharpe/artillery/launch_smk"
- #define BULLET "veh_t7_drone_raps"
- #define IMPACT "sharpe/artillery/impact"
- #define ANIM "flak38anim"
- #precache( "model", BULLET );
- #precache( "xanim", ANIM );
- #precache( "fx" , LAUNCH_EXP );
- #precache( "fx" , LAUNCH_SMK );
- #precache( "fx" , IMPACT );
- function autoexec init()
- {
- //==============Variables to Change============\
- level.time_to_impact = 1;
- level.cooldown = 40;
- level.exp_radius = 1;
- //============Variables to Not Change==========\
- level.artillery = GetEntArray( "artillery_trigger", "targetname" );
- level.players = GetPlayers();
- main();
- }
- function main()
- {
- foreach(artillery in level.artillery)
- artillery thread artillery();
- }
- function artillery()
- {
- //Clean Up for when the game is over
- self endon("death");
- level endon("end_game");
- //Get rid of the hint icon
- self SetCursorHint("HINT_NOICON");
- model = GetEnt( self.target , "targetname" );
- muzzle = GetEnt( model.target , "targetname" );
- bullet = GetEnt( muzzle.target, "targetname" );
- arcLoc = GetEnt( bullet.target, "targetname" );
- impact = GetEnt( arcLoc.target, "targetname" );
- wait(RandomIntRange(1, 20));
- while(true)
- {
- //Set the hint to say we are ready to fire
- self SetHintString( "Hold ^3&&1^7 to fire");
- //Wait till a player activate the artillery
- wait(10);
- //Update the hintstring for firing
- self SetHintString( "Firing" );
- //Play the launch sound
- PlaySoundAtPosition( "artillery_launch", muzzle.origin );
- launch_smoke = PlayFX(LAUNCH_SMK, muzzle.origin );
- launch_smoke.angles = muzzle.angles;
- launch_explosion = PlayFX(LAUNCH_EXP, muzzle.origin );
- launch_explosion.angles = muzzle.angles;
- play_anims(model);
- bullet.origin = muzzle.origin;
- bullet.angles = muzzle.angles;
- bullet PlaySound("artillery_whistle");
- thread move_bullet(bullet, arcLoc, impact);
- wait( level.time_to_impact );
- //Play the impact sound
- impact PlaySound( "artillery_impact" );
- impact_fx = PlayFX(IMPACT, impact.origin);
- impact_fx.angles = impact.angles;
- radius = spawn( "trigger_radius", impact.origin, 1, level.exp_radius, level.exp_radius );
- //self SetHintString( "Cooling Down" );
- //self PlaySound ( "artillery_ready" );
- }
- }
- function move_bullet(bullet, arc, impact)
- {
- half_time = level.time_to_impact / 2;
- bullet MoveTo(arc.origin, half_time);
- wait(half_time);
- bullet.angles = arc.angles;
- bullet MoveTo(impact.origin, half_time);
- wait(half_time);
- bullet MoveZ(-1000, 0.1);
- wait(0.1);
- }
- function play_anims(model)
- {
- model useanimtree(#animtree);
- model AnimScripted( ANIM, model.origin , model.angles, %flak38anim); // Add Your Anims file name where you see "Your_Anim_fileName_Here" in both spots.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement