Spawn in front of vehicle
#3

As said by cool, use GetXYInFrontOfPlayer function to achieve it.
pawn Код:
Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    else GetPlayerFacingAngle(playerid, a);
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
    return a;
}
Reply


Messages In This Thread
Spawn in front of vehicle - by Osamakurdi - 11.07.2018, 12:51
Re: Spawn in front of vehicle - by coool - 11.07.2018, 17:51
Re: Spawn in front of vehicle - by Caessius - 11.07.2018, 18:06
Re: Spawn in front of vehicle - by Osamakurdi - 13.07.2018, 16:13

Forum Jump:


Users browsing this thread: 1 Guest(s)