跳至主要内容

InterpolateCameraPos

Description

Move a player's camera from one position to another, within the set time. Useful for scripted cut scenes

NameDescription
playeridThe ID of the player the camera should be moved for
Float:fromXThe X position the camera should start to move from
Float:fromYThe Y position the camera should start to move from
Float:fromZThe Z position the camera should start to move from
Float:toXThe X position the camera should move to
Float:toYThe Y position the camera should move to
Float:toZThe Z position the camera should move to
timeTime in milliseconds
CAM_MOVE:cutThe jumpcut to use. Defaults to CAMERA_CUT. Set to CAMERA_MOVE for a smooth movement

Returns

This function does not return any specific values.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/moveme", true))
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraPos(playerid, 0.0, 0.0, 10.0, 1000.0, 1000.0, 30.0, 10000, CAMERA_MOVE);
//Move the player's camera from point A to B in 10000 milliseconds (10 seconds).
return 1;
}
return 0;
}

Notes

提示