GetVehicleMaxPassengers: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function returns the maximum number of passengers that a specified vehicle can hold.
This function returns the maximum number of passengers that a specified vehicle can hold.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">getVehicleMaxPassengers ( vehicle )</syntaxhighlight>
<syntaxhighlight lang="lua">int getVehicleMaxPassengers ( vehicle theVehicle )</syntaxhighlight>


==Required Arguments==
===Required Arguments===
*'''Vehicle:''' A handle to the [[vehicle]] that you wish to know the maximum capacity of.
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the maximum capacity of.
 
===Returns===
Returns an [[int]] indicating the maximum number of passengers that can enter a vehicle.


==Example==
==Example==
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )
This example creates a vehicle then gets the number of passenger seats and outputs it in the chat box.
maxseats = getVehicleMaxPassengers ( newcar )
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a vehicle
outputChatBox ( "This vehicle supports ", maxseats, " passengers." )</syntaxhighlight>
maxseats = getVehicleMaxPassengers ( newcar ) -- get the passenger seat count
outputChatBox ( "This vehicle supports " .. maxseats .. " passengers." ) -- show it in the chat</syntaxhighlight>


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Revision as of 13:48, 14 August 2006

This function returns the maximum number of passengers that a specified vehicle can hold.

Syntax

int getVehicleMaxPassengers ( vehicle theVehicle )

Required Arguments

  • theVehicle: A handle to the vehicle that you wish to know the maximum capacity of.

Returns

Returns an int indicating the maximum number of passengers that can enter a vehicle.

Example

This example creates a vehicle then gets the number of passenger seats and outputs it in the chat box.

newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a vehicle
maxseats = getVehicleMaxPassengers ( newcar ) -- get the passenger seat count
outputChatBox ( "This vehicle supports " .. maxseats .. " passengers." ) -- show it in the chat

See Also