26.07.2011, 14:56
Quote:
Thanks for this function RyDeR. I don't know how the function works, but is it possible to detect rear position of this vehicle by using this code?
|
That goes the half of the y_size to the back of the vehicle
pawn Код:
new Float: Pos[6];
GetVehicleZAngle(vehicleid, Pos[3]);
GetVehicleSize(GetVehicleModel(vehicleid), Pos[2], Pos[4], Pos[5]);
GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
Pos[0] += (floatsin(Pos[3], degrees) * 0.5 * Pos[4]);
Pos[1] -= (floatcos(Pos[3], degrees) * 0.5 * Pos[4]);
CreateExplosion(Pos[0], Pos[1], Pos[2] + 0.5 * Pos[5], 0, 5.0);