SetVehicleVelocity
From SA-MP Wiki
SetVehicleVelocity
Warning: This function was added in SA-MP version 0.3. It is not available in previous versions.
Sets the X, Y and Z velocity of a vehicle
Important Note: This function has no effect on un-occupied vehicles!
(vehicleid, Float:x, Float:y, Float:z)
| vehicleid | The ID of the vehicle to set the velocity of. |
| Float:x | The amount of velocity in the X direction. |
| Float:y | The amount of velocity in the Y direction . |
| Float:z | The amount of velocity in the Z direction. |
This function does not return a specific value.
public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/carjump", cmdtext)) { if(IsPlayerInAnyVehicle(playerid)) SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.2); return 1; } }
- SetPlayerVelocity: Set a player's velocity.
- GetPlayerVelocity: Get a player's velocity.
- GetVehicleVelocity: Get a vehicle's velocity.
