07-27-2011, 14:36
Hello
New tutorial, this time is about spawning a plane and a helicopter,
First: Spawn a Plane
An example:
Some functions:
Second: Spawn a Helicopter, it uses different commands.(vehicle commands)
An example(chopper gunner):
Some functions:
There are many more commands and things you can use, but thats your part,
Thanks for reading.
New tutorial, this time is about spawning a plane and a helicopter,
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,
Thanks for reading.