Edit attached vehicle object.
#6

Basically, he's saying that you can create the object, edit the object and put this code underneath OnPlayerEditObject. In the code below, it basically takes the XYZ position of the object and subtracts the vehicle's position FROM the object's coordinates.

I didn't even know that was possible until I saw this... the only issue with the code below is that it doesn't set the proper rotation when attaching the object to the vehicle. I'm not sure how I'd accomplish that.

pawn Код:
new
            Float:fPos[3]
        ;
       
        GetVehiclePos(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);    
        printf("\n\nOBJECT OFFSETS: %f, %f, %f, %f, %f, %f\n\n", x-fPos[0], y-fPos[1], z-fPos[2], rx, ry, rz);
       
        AttachDynamicObjectToVehicle(objectid, GetPlayerVehicleID(playerid), x-fPos[0], y-fPos[1], z-fPos[2], rx, ry, rz);
Reply


Messages In This Thread
Edit attached vehicle object. - by newbienoob - 23.03.2013, 13:08
Re: Edit attached vehicle object. - by Stylock - 23.03.2013, 14:12
Re: Edit attached vehicle object. - by newbienoob - 23.03.2013, 14:16
Re: Edit attached vehicle object. - by Stylock - 23.03.2013, 14:26
Re: Edit attached vehicle object. - by newbienoob - 23.03.2013, 15:51
Re: Edit attached vehicle object. - by Scenario - 23.03.2013, 16:11
Re: Edit attached vehicle object. - by Stylock - 23.03.2013, 17:02
Re: Edit attached vehicle object. - by Scenario - 23.03.2013, 17:25
Re: Edit attached vehicle object. - by newbienoob - 23.03.2013, 17:32
Re: Edit attached vehicle object. - by Scenario - 23.03.2013, 17:36

Forum Jump:


Users browsing this thread: 5 Guest(s)