10.08.2013, 19:09
You could modify that function. One approach, for example:
Usage example:
Should work
pawn Код:
enum
{
INFRONT,
LEFT,
BEHIND,
RIGHT
}
pawn Код:
stock GetXYFromPlayer(playerid, &Float:x, &Float:y, direction, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
switch(direction)
{
case LEFT:
{
a += 90;
}
case BEHIND:
{
a += 180;
}
case RIGHT:
{
a += 270;
}
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
pawn Код:
GetXYFromPlayer(playerid, x, y, LEFT, 10.0);