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
- origin?:
string— echoed assourceon the decision.
Returns
Result
Close
Closes the list. Refused when none is open.
dealership.Close()Returns
Resulttrue— errornot_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 withdealership.noSuchGarage.
Returns
Result{ queued = true }— errorsdealership.noOffer(none waiting),not_sent
dealership.Decide(true, 'watson_garage')Nearest
dealership.Nearest()Returns
Result{ key, label, kind }— errordealership.noSuchSpotwhen 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