Player Angles
#1

Hai, i tried several times with a player to try get this object to move where the player is facing, not where hes camera is facing.

Just like when someone types /air there will be a hugeass plane going past him though im wanting the plane to fly towards where he faces (THE PLAYER once again not the Players Camera)

If anyone knows how to do this, me and a friend tried, failed for us

pawn Код:
gPlayerData[playerid][E_AIRSTRIKE_AROMANDA] = CreateObject(14553,pos[0]-60, pos[1],pos[2]+80,0, 0, 90);
MoveObject(gPlayerData[playerid][E_AIRSTRIKE_AROMANDA], pos[0] + 260, pos[1], pos[2] + 80, 30);
Edit:
To Example Completely
Well i want the plane in the code to basicly face and fly the way the players angle
Reply
#2

bump
Reply
#3

Use GetXYInFrontOfPlayer

pawn Код:
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 100.0);
MoveObject(gPlayerData[playerid][E_AIRSTRIKE_AROMANDA], pos[0], pos[1], pos[2] + 80, 30);
pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    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));
}
Reply
#4

That isn't working either, lol im so raging over this
Reply
#5

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)