GetVehicleMaxPassengers: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | |||
__NOTOC__ | __NOTOC__ | ||
This function returns the maximum number of passengers that a specified vehicle can hold. Only passenger seats are counted, the driver seat is excluded. | |||
This function returns the maximum number of passengers that a specified vehicle can hold. | |||
{{Important Note | Only passenger seats are counted, the driver seat is excluded.}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">getVehicleMaxPassengers ( vehicle )</syntaxhighlight> | <syntaxhighlight lang="lua">int getVehicleMaxPassengers ( vehicle theVehicle / int modelID )</syntaxhighlight> | ||
{{OOP||[[vehicle]]:getMaxPassengers|maxPassengers}} | |||
===Required Arguments=== | |||
*'''theVehicle:''' the [[vehicle]] that you wish to know the maximum capacity of. | |||
OR | |||
*'''modelID:''' the model id 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. | ||
<syntaxhighlight lang="lua">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</syntaxhighlight> | |||
==See Also== | |||
{{Vehicle functions}} |
Revision as of 11:42, 13 June 2018
This function returns the maximum number of passengers that a specified vehicle can hold. Only passenger seats are counted, the driver seat is excluded.
Important Note: Only passenger seats are counted, the driver seat is excluded. |
Syntax
int getVehicleMaxPassengers ( vehicle theVehicle / int modelID )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getMaxPassengers(...)
- Variable: .maxPassengers
Required Arguments
- theVehicle: the vehicle that you wish to know the maximum capacity of.
OR
- modelID: the model id 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
- addVehicleSirens
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehiclesOfType
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgrades
- getVehicleUpgradeSlotName
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates
- spawnVehicle
- toggleVehicleRespawn