GetVehicleNitroLevel: 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">float getVehicleNitroLevel ( vehicle theVehicle )</syntaxhighlight>  
<syntaxhighlight lang="lua">float getVehicleNitroLevel ( vehicle theVehicle )</syntaxhighlight>  

Revision as of 23:28, 10 March 2013

ADDED/UPDATED IN VERSION 1.3.1 r4993:

This function get the nitro level from 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

float getVehicleNitroLevel ( vehicle theVehicle )

Required Arguments

  • theVehicle The vehicle which you want to get a nitro level.

Returns

Returns the nitro level [ range is 0.0001 to 1.0 ] from the vehicle.

Example

addEventHandler( 'onClientVehicleEnter', root,
	function( pPlayer )
		if pPlayer == localPlayer then
			if getVehicleUpgradeOnSlot( source, 8 ) then -- Nitro installed?
				local fNitroLevel = getVehicleNitroLevel( source )
				outputChatBox( 'Your nitro level for vehicle ' .. getVehicleName( source ) .. ' is ' .. fNitroLevel .. '.' )
			end
		end
	end
)

Requirements

This template will be deleted.

See Also