19.09.2015, 11:13
Quote:
No, it isn't the what i want. That function not drops position behind of the car as in the example.
|
So here you go, the function generalised
pawn Код:
GetXYAroundPlayer(playerid, & Float: X, & Float: Y, Float: distance, Float: angle) {
new
Float: A
;
if(GetPlayerPos(playerid, X, Y, A)) {
new
vehicleid = GetPlayerVehicleID(playerid)
;
if(vehicleid) {
GetVehicleZAngle(vehicleid, A);
} else {
GetPlayerFacingAngle(playerid, A);
}
A += angle;
X -= distance * floatsin(A, degrees);
Y += distance * floatcos(A, degrees);
return true;
}
return false;
}