What's new

Solved Request: Script Coding to attach objects to cars.

  • Thread starter SalvatoreLeone
  • Start date
  • Views 1,079
Status
Not open for further replies.
SalvatoreLeone

SalvatoreLeone

Enthusiast
Messages
376
Reaction score
36
Points
85
Sin$
0
Don't spouse anyone has got the coding to stick objects to cars like the "jumbo jet" for the c++ program, not ducks releases just the coding for it or like that.

It just saves me from doing it tbh.

Thanks, SaIvatore Leone
 
E

Evil Blunt

Getting There
Platinum Record
Messages
958
Reaction score
1,491
Points
245
Sin$
7
Here from our ps3 source

all been fixed up for the jumbo jet all parts have been added and object offset changed so your not ontop of the plane nomore.

Code:
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");
            }
    }
}
 
Upvote 0
Status
Not open for further replies.
Top Bottom
Login
Register