Object front of player
#3

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    GetPlayerPos(playerid, x, y, Angle);
    GetPlayerFacingAngle(playerid, Angle);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
    }
    x += (distance * floatsin(-Angle, degrees));
    y += (distance * floatcos(-Angle, degrees));
}
Use GetXYInFrontOfPlayer(playerid, X, Y, 20);
To take the X, Y 20 in front of the player, with the PlayerFacing Angle or VehicleZAngle.

good luck
Reply


Messages In This Thread
Object front of player - by Dime - 29.10.2010, 11:00
Re: Object front of player - by WillyP - 29.10.2010, 12:00
Re: Object front of player - by pater - 29.10.2010, 13:41
Re: Object front of player - by Dime - 29.10.2010, 14:32
Re: Object front of player - by Jeffry - 29.10.2010, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)