void spawnairtugforplane(uint vehwithplaneline)
{
float x, y, z;
GET_CHAR_COORDINATES(GetPlayerPed(), &x, &y, &z);
LoadModel(vehwithplaneline);
CreateVehicleAndWarpPlayerIntoIt(vehwithplaneline, x, y, z);
}
void Airplane(void)
{
if( IsKeyPressed(STICK_R, DPAD_DOWN) )
{
spawnairtugforplane(MODEL_AIRTUG);
if(IsPlayerInVehicle())
{
Vehicle CurrObjVehicle;
CurrObjVehicle = GetCurrentPlayerVehicle();
SET_CAR_VISIBLE(CurrObjVehicle, FALSE);
Object attachedObject;
Object attachedObject1;
CREATE_OBJECT(MODEL_CJ_PLANE_1 ,0,0,0,&attachedObject,1);
CREATE_OBJECT(MODEL_CJ_PLANE_1B ,0,0,0,&attachedObject1,1);
WAIT(10);
ATTACH_OBJECT_TO_CAR(attachedObject,CurrObjVehicle,0,0,0,10.5,0,0,160.20);
ATTACH_OBJECT_TO_CAR(attachedObject1,CurrObjVehicle,0,0,0,10.5,0,0,160.20);
SET_OBJECT_VISIBLE(attachedObject, TRUE);
SET_OBJECT_VISIBLE(attachedObject1, TRUE);
PrintMenu("Airplane");
}
}
}