teleporting behind
#2

pawn Код:
GetXYBehindPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    x -= (distance * floatsin(-a, degrees));
    y -= (distance * floatcos(-a, degrees));
    return 1;
}
Example:
pawn Код:
GetXYBehindPlayer(target, x, y, 2.0);
SetPlayerPos(playerid, x, y, z);
Reply


Messages In This Thread
teleporting behind - by suni - 05.07.2015, 18:42
Re: teleporting behind - by Threshold - 05.07.2015, 19:41
Re: teleporting behind - by suni - 05.07.2015, 23:46

Forum Jump:


Users browsing this thread: 1 Guest(s)