SetPlayerVelocity

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
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




SetPlayerVelocity was added in SA-MP 0.3a This function was added in SA-MP 0.3a and will not work in earlier versions!


Description:

Makes the player move in that direction at the given speed.


Parameters:
(playerid, Float:x, Float:y, Float:z)
playeridThe player to apply the speed to.
Float:xHow much speed in the X direction will be applied.
Float:yHow much speed in the Y direction will be applied.
Float:zHow 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.

In other languages