GetVehicleNumberOfSeats

From Onset Developer Wiki
Revision as of 13:08, 22 March 2019 by BlueMountains (talk | contribs)
GetVehicleNumberOfSeats

Type: Function
Context: Server
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.

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