ItsMods

Full Version: Spawn Helicopters and Planes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

New tutorial, this time is about spawning a plane and a helicopter, Smile

First: Spawn a Plane

Code:
    plane = spawnplane( owner, "script_model", origin, "allie compass icon", "enemy compass icon" );

An example:

Code:
    jet = spawnplane( self, "script_model", self.origin, "compass_objpoint_airstrike_friendly", "compass_objpoint_airstrike_busy" );

Some functions:

Code:
    jet setModel("vehicle_mig29_desert"); //for model, a jet example
    jet.angles = (pitch,yaw,roll); //for angles
    jet EnableLinkTo(); //to be possible to link to it
    jet MoveTo(position, time); //to move it
    jet RotateTo((pitch,yaw,roll),time); //to rotate it

Second: Spawn a Helicopter, it uses different commands.(vehicle commands)

Code:
    heli = spawnHelicopter( owner, position, angles, "heli type", "heli model" );

An example(chopper gunner):

Code:
    heli = spawnHelicopter( self, self.origin+(0,0,150), self.angles, "cobra_minigun_mp", "vehicle_mi-28_mp" );

Some functions:

Code:
    heli Vehicle_SetSpeed(200,100); //modify heli speed
    heli SetTurningAbility(1); //make it take new angles
    heli SetMaxPitchRoll(30,20); //max Pitch and Max Roll angles
    heli setVehWeapon("cobra_player_minigun_mp"); //set vehicle weapon
    heli setVehGoalPos(position,1); //set goal, for moving it
             heli maps\mp\killstreaks\_helicopter::addToHeliList(); //add to heli list and make it consume air space

There are many more commands and things you can use, but thats your part, Wink

Thanks for reading. Nyan Cat
can you exlplain how to let if follow you?
cuz i cant get it working
well i can but it will be a fucking long code of keep wait 1; heli self origin
OMA

Code:
while( 1 )
{
heli setVehGoalPos( self.origin + ( 0, 0, 500 ), 1 );
wait 1;
}
thanks,