Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock GetVehicleRelativePos(vehicleid, &Float:x, &Float:y, &Float:z, Float:xoff=0.0, Float:yoff=0.0, Float:zoff=0.0)
- {
- new Float:rot;
- GetVehicleZAngle(targetid, rot);
- rot = 360 - rot; // Making the vehicle rotation compatible with pawns sin/cos
- GetVehiclePos(vehicleid, x, y, z);
- x = floatsin(rot,degrees) * yoff + floatcos(rot,degrees) * xoff + x;
- y = floatcos(rot,degrees) * yoff - floatsin(rot,degrees) * xoff + y;
- z = zoff + z;
- /*
- where xoff/yoff/zoff are the offsets relative to the vehicle
- x/y/z then are the coordinates of the point with the given offset to the vehicle
- xoff = 1.0 would e.g. point to the right side of the vehicle, -1.0 to the left, etc.
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement