limitSpeed: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added example code from JamesF1)
Line 17: Line 17:


| [[Nothing]] |= Return value
| [[Nothing]] |= Return value
____________________________________________________________________________________________
|x1= <pre>// Adjust "speedLimit" variable to change limited speed
this setVariable ["speedLimit", 200];
nul = this spawn {
while {canMove _this) } do {
_this limitSpeed (_this getVariable "speedLimit");
sleep 0.1;
};
};</pre> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 03:37, 17 October 2012

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Limit speed of given vehicle or person to given value (in km/h).
Groups:
Uncategorised

Syntax

Syntax:
objectName limitSpeed speed
Parameters:
objectName: Object
speed: Number
Return Value:
Nothing

Examples

Example 1:
// Adjust "speedLimit" variable to change limited speed
this setVariable ["speedLimit", 200];
nul = this spawn {
	while {canMove _this) } do {
		_this limitSpeed (_this getVariable "speedLimit");
		sleep 0.1;
	};
};

Additional Information

See also:
speed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on 9 February 2008
Kronzky
Has only an temporary effect on the vehicle specified (i.e. vehicle goes back to its previous speed right away). So, in order for this command to have a real, noticeable effect, it would have to be issued continuously (e.g. via a script loop). (V1.08.5163)

Bottom Section