SetPlayerVelocity
From SA-MP Wiki
(Difference between revisions)
Revision as of 00:33, 30 December 2009 Mikep (Talk | contribs) ← Previous diff |
Revision as of 01:06, 3 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 37: | Line 37: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
+ | |||
+ | [[fr:SetPlayerVelocity]] |
Revision as of 01:06, 3 February 2014
Description:
Makes the player move in that direction at the given speed.
(playerid, Float:x, Float:y, Float:z)
playerid | The player to apply the speed to. |
Float:x | How much speed in the X direction will be applied. |
Float:y | How much speed in the Y direction will be applied. |
Float:z | How much speed in the Z direction will be applied. |
Return Values:
This function does not return any specific values.
public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/jump", cmdtext)) { SetPlayerVelocity(playerid,0.0,0.0,0.2); //Forces the player to jump return 1; } if (!strcmp("/sink", cmdtext)) { SetPlayerVelocity(playerid,0.0,0.0,-0.5); //Forces the player to sink return 1; } return 0; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetPlayerVelocity: Get a player's velocity.
- SetVehicleVelocity: Set a vehicle's velocity.
- GetVehicleVelocity: Get a vehicle's velocity.