SetVehicleNitroLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 6: Line 6:


'''Note:''' This function return ''false'' if nitro is not exists. So you need add nitro via function [[addVehicleUpgrade]].
'''Note:''' This function return ''false'' if nitro is not exists. So you need add nitro via function [[addVehicleUpgrade]].
 
{{Warning|Function not working correctly}}
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">bool setVehicleNitroLevel ( vehicle theVehicle, float level )</syntaxhighlight>  
<syntaxhighlight lang="lua">bool setVehicleNitroLevel ( vehicle theVehicle, float level )</syntaxhighlight>  

Revision as of 23:28, 10 March 2013

ADDED/UPDATED IN VERSION 1.3.1 r4993:

This function set the nitro level to the vehicle.

Note: This function return false if nitro is not exists. So you need add nitro via function addVehicleUpgrade.

[[|link=|]] Warning: Function not working correctly

Syntax

bool setVehicleNitroLevel ( vehicle theVehicle, float level )

Required Arguments

  • theVehicle The vehicle which you want to set.
  • level Nitro level you want to set [0.0001-1.0].

Returns

Returns true if the nitro level was set successfully to the vehicle, false otherwise.

Example

addEventHandler( 'onClientVehicleEnter', root,
	function( pPlayer )
		if pPlayer == localPlayer then
			if not getVehicleUpgradeOnSlot( source, 8 ) then -- Nitro doesn't installed?
				addVehicleUpgrade( source, 1010 ) -- Install a nitro.
				setVehicleNitroLevel( source, 0.1 ) -- Set up an 0.1 level for nitro.
			end
		end
	end
)

Requirements

This template will be deleted.

See Also