X Y Z in front of player
#1

How Can I get XYZ in front of player like when flying a plane and heading down to the ground ??
Reply
#2

Um, dont really know what you mean.

But to get a player cords, it should be like this:

Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Reply
#3

Try this function.

pawn Код:
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));
}
I don't know who created this...
Reply
#4

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Try this function.

pawn Код:
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));
}
I don't know who created this...
that gets the x and y in front of player i want x y z
Reply
#5

Z = Height!!!
Reply
#6

Z is the same as the player, don't?
Reply
#7

Quote:
Originally Posted by Opah
Посмотреть сообщение
that gets the x and y in front of player i want x y z
You can use that function to get the X,Y but then you can use MapAndreas to obtain the Z from the X,Y from the first function.
Reply
#8

no guys you just dont get it
look i am in a hydra and heading to the ground (nose is looking towards the ground) i want the X and Y and Z (= height )of the point in front of me (while i am facing the ground) in distance D
Reply
#9

Search for Quaternion Converter, or use GetVehicleRotationQuat and wikipedia (goto: For Euler angles)
Reply
#10

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Search for Quaternion Converter, or use GetVehicleRotationQuat and wikipedia (goto: For Euler angles)
Thanx Bro I Was Searching For Something Like That Trying Now To Make A Function
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)