SetVehicleVelocity

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 18:55, 1 July 2013
Smithy (Talk | contribs)

← Previous diff
Revision as of 23:03, 31 January 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{0.3Added|function|}} {{0.3Added|function|}}
Line 34: Line 33:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +
 +[[fr:SetVehicleVelocity]]
[[ru:SetVehicleVelocity]] [[ru:SetVehicleVelocity]]

Revision as of 23:03, 31 January 2014



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


Description:

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


Image:32px-Circle-style-warning.png

Important
Note

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


Parameters:
(vehicleid, Float:x, Float:y, Float:z)
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.


Return Values:

This function does not return any specific values.


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