SetVehicleNitroCount

From Multi Theft Auto: Wiki
Revision as of 15:56, 9 February 2013 by Kenix1 (talk | contribs)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.3.1 r4993:

This function set the nitro count to the vehicle.

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

Syntax

bool setVehicleNitroCount ( vehicle theVehicle, int count )

Required Arguments

  • theVehicle The vehicle which you want to set.
  • count Nitro count you want to set [0-100] 101 - is infinite.

Returns

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

Example

addEventHandler( 'onClientVehicleEnter', root,
	function( pPlayer )
		if pPlayer == localPlayer then
			if not isVehicleNitroInstalled( source ) then
				addVehicleUpgrade( source, 1010 ) -- Install a nitro.
				setVehicleNitroCount( source, 101 ) -- Set up an infinite nitro.
			end
		end
	end
)

Requirements

This template will be deleted.

See Also