OPX//77
opx_infinitydealership

Client

Last updated on

The dealership contract on the client — the list, the offer answer and the dealer underfoot.

local dealership = OPX.Api.Get('dealership')

From client code inside opx_infinity.

Open

Same as pressing the key: opens the list for the dealer underfoot, or closes it if open.

dealership.Open(origin)

Parameters

Returns

  • Result

Close

Closes the list. Refused when none is open.

dealership.Close()

Returns

  • Result true — error not_open

IsOpen

dealership.IsOpen()

Returns

  • boolean

Decide

Answers the offer waiting for this player.

dealership.Decide(yes, garage)

Parameters

  • yes: boolean
  • garage?: string — the garage to file it under (only sent with a yes); nil: the vehicles default. The server refuses an unknown one with dealership.noSuchGarage.

Returns

  • Result { queued = true } — errors dealership.noOffer (none waiting), not_sent
Example
dealership.Decide(true, 'watson_garage')

Nearest

dealership.Nearest()

Returns

  • Result { key, label, kind } — error dealership.noSuchSpot when not on a dealer

Spots

Dealers this client was sent (its own bucket).

dealership.Spots()

Returns

  • Result { spots }

State

Diagnostic: dealers, markers, nearest, open screen, stock count.

dealership.State()

Returns

  • Result

On this page