跳到主要内容

SetPlayerVelocity

描述

在 X、Y、Z 轴上设置玩家的速度。

名称说明
playerid要设置速度的玩家 ID
Float:xX 轴方向的速度
Float:yY 轴方向的速度
Float:zZ 轴方向的速度

返回值

true - 函数执行成功。

false - 函数执行失败。玩家未连接。

示例

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/jump", cmdtext))
{
SetPlayerVelocity(playerid, 0.0, 0.0, 0.2); // 强制玩家跳跃(Z轴速度+0.2)
return 1;
}
return 0;
}

相关函数