AttachObjectToVehicle Problem
#2

vehicle id IS NOT vehicle model id, please don't be confused with it.
Sunrise Vehicle model ID is 550, but vehicle id is the ID of every vehicle (like player ID).
If you type /dl you can see a label on vehicle, the "id" means the vehicle id, and the "type" means the model id

Here, try use this instead:
Код:
public OnVehicleSpawn(vehicleid)
{
	if(GetVehicleModel(vehicleid) == 550))
    {
        AddVehicleComponent(vehicleid, 1001);
        AddVehicleComponent(vehicleid, 1005);
        AddVehicleComponent(vehicleid, 1006);
        AddVehicleComponent(vehicleid, 1010);
        AddVehicleComponent(vehicleid, 1020);
        AddVehicleComponent(vehicleid, 1025);
        AddVehicleComponent(vehicleid, 1143);
        tmpobjid = CreateDynamicObject(1593,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
        SetDynamicObjectMaterial(tmpobjid, 0, 1560, "7_11_door", "CJ_CHROME2", -16738048);
        AttachDynamicObjectToVehicle(tmpobjid, vehicleid, 0.000, 3.000, -0.400, 0.000, 90.000, 90.000);
        tmpobjid = CreateDynamicObject(1593,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
        SetDynamicObjectMaterial(tmpobjid, 0, 1560, "7_11_door", "CJ_CHROME2", -16738048);
        AttachDynamicObjectToVehicle(tmpobjid, vehicleid, 0.000, 3.000, -0.200, 0.000, 90.000, 90.000);
    }
	return 1;
}
Reply


Messages In This Thread
AttachObjectToVehicle Problem - by Toxik - 18.08.2015, 01:08
Re: AttachObjectToVehicle Problem - by RoboN1X - 18.08.2015, 02:13
Re: AttachObjectToVehicle Problem - by Cenzy - 18.08.2015, 02:17
Re: AttachObjectToVehicle Problem - by Toxik - 18.08.2015, 03:20

Forum Jump:


Users browsing this thread: 1 Guest(s)