Перейти к основному содержимому

SetVehicleVelocity

Description

Sets the X, Y and Z velocity of a vehicle.

NameDescription
vehicleidThe ID of the vehicle to set the velocity of.
Float:xThe velocity in the X direction.
Float:yThe velocity in the Y direction.
Float:zThe velocity in the Z direction.

Returns

true - The function executed successfully.

false - The function failed to execute. The vehicle does not exist.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/jump", cmdtext))
{
if (IsPlayerInAnyVehicle(playerid))
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2);
}
return 1;
}
}

Notes

warning

This function has no affect on un-occupied vehicles and does not affect trains.