Possible to get XYZ in front of player without camera vectors?
#2

pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    // Created by ******

    new Float:a;

    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);

    if (GetPlayerVehicleID(playerid)) {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }

    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Then Z being the same as the player's position (or you could add +1.0). So use GetPlayerPos beforehand.
Reply


Messages In This Thread
Possible to get XYZ in front of player without camera vectors? - by iggy1 - 23.05.2012, 10:14
Re: Possible to get XYZ in front of player without camera vectors? - by Vince - 23.05.2012, 10:18
Re: Possible to get XYZ in front of player without camera vectors? - by iggy1 - 23.05.2012, 10:20

Forum Jump:


Users browsing this thread: 1 Guest(s)