ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getVehicleMaxPassengers

Function

getVehicleMaxPassengers

Server and clientVehiclesIdentical to MTA:SA

Returns the number of passenger seats of a vehicle or model (not counting the driver): e.g. 1 for a two-seater, 3 for a saloon. The data comes from the game, so the server only knows it once a client reports it (usually after the model first appears for a player); before that it returns false.

Syntax

int getVehicleMaxPassengers(vehicle/int vehicleOrModel)

Arguments

vehicleOrModelvehicle/int
A vehicle or a model ID.

Returns

The number of passenger seats, or false.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    outputChatBox("Miejsc dla pasazerow: " .. tostring(getVehicleMaxPassengers(vehicle)))
end

See also