27.09.2014, 15:26
https://sampforum.blast.hk/showthread.php?tid=325872
Now you would need to modify that slightly to do what you want example.
Now you would need to modify that slightly to do what you want example.
pawn Код:
stock Float:GetPosInFrontOfPlayer(playerid, Float:distance, Float:aoffset, &Float:x, &Float:y)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
a += aoffset;
switch(IsPlayerInAnyVehicle(playerid))
{
case 0: GetPlayerFacingAngle(playerid, a);
case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}