02.05.2010, 16:21
pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x2, y2, a);
GetPlayerFacingAngle(playerid, a);
if(GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x2 += (distance * floatsin(-a, degrees));
y2 += (distance * floatcos(-a, degrees));
}
pawn Код:
stock GetOffsetFromPlayer(playerid, Float:x, Float:y, Float:z, Float:xo, Float:yo, Float:zo)
{
new Float:pa;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, pa);
x += (xo * sin(-pa)) + (yo * sin(pa + 90));
y += (xo * cos(-pa)) + (yo * cos(pa + 90));
z += zo;
}