I'm trying to make a system where I need to position the camera in front of the vehicle so that it "points" to the vehicle without setting the coordinates in an array, having a "radius" using a GetVehicleModelInfo function.
I managed to do a function where I can get the front of the vehicle using some calculations. But I can't point the camera at the vehicle at the right angle.
btw, is this function correct??
I managed to do a function where I can get the front of the vehicle using some calculations. But I can't point the camera at the vehicle at the right angle.
PHP Code:
GetVehicleFront(vehicleid, &Float:x, &Float:y)
{
? ? new Float:a, Float:fSize[3];
? ? GetVehiclePos(vehicleid, x, y, a);
? ? GetVehicleZAngle(vehicleid, a);
? ? GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, fSize[0], fSize[1], fSize[2]);
? ? x = (/* radius using fSize? (about 7.5) */ * floatsin(-a, degrees));
? ? y = (/* radius using fSize? (about 7.5) */ * floatcos(-a, degrees));
? ? return 1;
}
btw, is this function correct??