Pular para o conteúdo principal

SetPlayerVelocity

Description

Set a player's velocity on the X, Y and Z axes.

NameDescription
playeridThe player to apply the speed to.
Float:xThe velocity (speed) on the X axis.
Float:yThe velocity (speed) on the Y axis.
Float:zThe velocity (speed) on the Z axis.

Returns

true - The function executed successfully.

false - The function failed to execute. This means the player is not connected.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/jump", cmdtext))
{
SetPlayerVelocity(playerid, 0.0, 0.0, 0.2); // Forces the player to jump (Z velocity + 0.2)
return 1;
}
return 0;
}