ItsMods
[Tutorial] Spawn Helicopters and Planes - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Tutorial] Spawn Helicopters and Planes (/Thread-Tutorial-Spawn-Helicopters-and-Planes.html)



Spawn Helicopters and Planes - Yamato - 07-27-2011

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


RE: Spawn Helicopters and Planes - GscGunner - 01-19-2012

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



RE: Spawn Helicopters and Planes - Yamato - 01-19-2012

OMA

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



RE: Spawn Helicopters and Planes - GscGunner - 01-19-2012

thanks,