SetVehicleNitroCount: Difference between revisions

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


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


==Example==
==Example==

Revision as of 15:29, 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 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
			addVehicleUpgrade( source, 1010 ) -- Install a nitro.
			setVehicleNitroCount( source, 101 ) -- Set up an infinite nitro.
		end
	end
)

Requirements

Minimum server version n/a
Minimum client version 1.3.1-9.04993

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.1-9.04993" />

See Also