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:
{{Server client function}}
__NOTOC__
__NOTOC__
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.
Line 14: Line 15:
This example creates a vehicle then gets the number of passenger seats and outputs it in the chat box.
This example creates a vehicle then gets the number of passenger seats and outputs it in the chat box.
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a vehicle
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a vehicle
maxseats = getVehicleMaxPassengers ( newcar ) -- get the passenger seat count
numseats = getVehicleMaxPassengers ( newcar ) -- get the passenger seat count
outputChatBox ( "This vehicle supports " .. maxseats .. " passengers." ) -- show it in the chat</syntaxhighlight>
outputChatBox ( "This vehicle supports " .. numseats .. " passengers." ) -- show it in the chat</syntaxhighlight>


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

Revision as of 17:30, 17 August 2007

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
numseats = getVehicleMaxPassengers ( newcar ) -- get the passenger seat count
outputChatBox ( "This vehicle supports " .. numseats .. " passengers." ) -- show it in the chat

See Also