18.04.2011, 20:30
Hello. I'm trying to make something like when you press KEY_ACTION in a vehicle, a ramp will be created in front of you. Here's the part of my code that creates the ramp:
The problem is that this only makes the ramp in front of the vehicle when it's on flat ground. I decided to make some drawings for you so it's easier to understand
(I guess could do better lol)
That's what I have right now:

/imageshack/img88/5650/rampsbad.png
That's what I want to have:

/imageshack/img218/6373/ramps.png
So basically I want the ramp to have the same pitch, yaw and roll angles as the vehicle and make it right in front of the vehicle no matter what its rotation on any axis is. I know this will have something to do with GetVehicleRotationQuat but... That stuff is magic for me ;P
So, could anyone help?
pawn Код:
new Float:x, Float:y, Float:z, Float:a;
GetVehiclePos(vehicleID, x, y, z);
GetVehicleZAngle(vehicleID, a);
ramp[playerid] = CreateDynamicObject(1655, x+(floatmul(20, floatsin(-a, degrees))), y+(floatmul(20, floatcos(-a, degrees))), z - 0.3, 0.0, 0.0, a, -1, -1, -1, DIST);

That's what I have right now:

/imageshack/img88/5650/rampsbad.png
That's what I want to have:

/imageshack/img218/6373/ramps.png
So basically I want the ramp to have the same pitch, yaw and roll angles as the vehicle and make it right in front of the vehicle no matter what its rotation on any axis is. I know this will have something to do with GetVehicleRotationQuat but... That stuff is magic for me ;P
So, could anyone help?