Chuyển tới nội dung chính

GetPlayerObjectRot

Description

Use this function to get the object's current rotation. The rotation is saved by reference in three rotationX/rotationY/rotationZ variables.

NameDescription
playeridThe player you associated this object to.
objectidThe objectid of the object you want to get the rotation from.
&Float:rotationXThe variable to store the X rotation, passed by reference.
&Float:rotationYThe variable to store the Y rotation, passed by reference.
&Float:rotationZThe variable to store the Z rotation, passed by reference.

Returns

The object's rotation is stored in the specified variables.

Examples

new gPlayerObject[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);

new Float:rotationX, Float:rotationY, Float:rotationZ;
GetPlayerObjectRot(playerid, objectid, rotationX, rotationY, rotationZ);
// rotationX = 0.0
// rotationY = 0.0
// rotationZ = 96.0
return 1;
}