GetXYOnTheRightOfPlayer O.o
#2

You could modify that function. One approach, for example:

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));
}
Usage example:

pawn Код:
GetXYFromPlayer(playerid, x, y, LEFT, 10.0);
Should work
Reply


Messages In This Thread
GetXYOnTheRightOfPlayer O.o - by S0n1COwnsYou - 09.08.2013, 22:34
Re: GetXYOnTheRightOfPlayer O.o - by Youarex - 10.08.2013, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)