Editing attached objects on vehicles
#1

So I am trying to edit an object on a vehicle which I attached by removing that object creating it again so I can move it around with EditObject(etc), but then I have to calculate what the pos is for AttachObjectToVehicle, So I got this but Its not working that well, the Z coords is ofcourse but the others once im finished editing they get like put back still the Z and one of the other is good but one coord is messing up and putting the object a little bit to the back of the vehicle, Anyone know why?

PHP код:
ObjectToCarPos(carid, &Float:X, &Float:Y, &Float:Z, &Float:RX, &Float:RY, &Float:RZ) {
    new 
Float:CXFloat:CYFloat:CZ;
    new 
Float:CRZ;
    
GetVehiclePos(caridCXCYCZ);
    
GetVehicleZAngle(caridCRZ);
    
    
X-CX;
    
Y-CY;
    
Z-CZ;
    
    
X*floatcos(CRZdegrees)+Y*floatsin(CRZdegrees);
    
= -X*floatsin(CRZdegrees)+Y*floatcos(CRZdegrees);
    
    
RZ RZ-CRZ;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)