GetVehicleNumberOfSeats

From Onset Developer Wiki
Revision as of 22:47, 7 March 2020 by 28days (talk | contribs) (Add client support for v1.1.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
GetVehicleNumberOfSeats

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Returns the amount of seats a given vehicle has.

Syntax

GetVehicleNumberOfSeats(vehicle)

Parameters

  • vehicle
    The vehicle identifier.

Return Value

  • Number of valid seats the given vehicle has. Returns false on error.

Example

function cmd_vehicleseats(player, vehicle)
	if (vehicle == nil) then
		return AddPlayerChat(player, "Usage: /vehicleseats <vehicle>")
	end

	if (not IsValidVehicle(vehicle)) then
		return AddPlayerChat(player, "Vehicle (ID: "..vehicle..") does not exist")
	end

	local seats = GetVehicleNumberOfSeats(vehicle)

	AddPlayerChat(player, "Vehicle "..vehicle.." has "..seats)
end
AddCommand("passengers", cmd_passengers)

See also