Przejdź do głównej zawartości

GetObjectRot

Description

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

NameDescription
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 referenced variables, not in the return value.

Examples

public OnGameModeInit()
{
new objectid = CreateObject(652, 732.32690, 1940.21289, 4.27340, 357.00000, 0.00000, -76.00000);

new Float:rotationX, Float:rotationY, Float:rotationZ;
GetObjectRot(objectid, rotationX, rotationY, rotationZ);
// rotationX = 357.00000
// rotationY = 0.00000
// rotationZ = -76.00000
return 1;
}