SetVehicleNitroCount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|4.0140|1.3.1|4993| This function set the nitro count to the vehicle. }} ==Syntax== <syntaxhighlight lang="lua">bool setVehicleNitroCount ...")
 
No edit summary
Line 20: Line 20:
if pPlayer == localPlayer then
if pPlayer == localPlayer then
addVehicleUpgrade( source, 1010 ) -- Install a nitro.
addVehicleUpgrade( source, 1010 ) -- Install a nitro.
setVehicleNitroCount( source, 101 ) -- Set up an infinite nitro
setVehicleNitroCount( source, 101 ) -- Set up an infinite nitro.
end
end
end
end

Revision as of 14:43, 7 February 2013

ADDED/UPDATED IN VERSION 1.3.1 r4993:

This function set the nitro count to the vehicle.

Syntax

bool setVehicleNitroCount ( vehicle theVehicle, int count )

Required Arguments

  • theVehicle The vehicle element 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, false otherwise.

Example

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

Requirements

This template will be deleted.

See Also