opx_infinityprompts
Server
Last updated on
The prompts contract on the server — post key-strip rows to one player.
local prompts = OPX.Api.Get('prompts')From server code inside opx_infinity. Each call only sends a net event to one player; the client validates the spec. The answer says the event was sent, not that the group was accepted.
- Errors:
prompts.invalidPlayer(sourceis not a number),prompts.invalidOwner. - The server owner is stored on the client as
@server:<owner>, so it never collides with a client owner. - A client cannot see a server module stop: a server module that restarts should call
HideAllbefore posting again.
Show
Sends opx:net:prompts:show.
prompts.Show(source, owner, id, spec)Parameters
- source:
number— a connected player id.-1(everyone) is refused withprompts.invalidPlayer. - owner:
string - id:
string - spec:
table— as the client spec
Returns
Result—{ id }
prompts.Show(source, 'garage', 'menu', { rows = { { label = 'Garage', keys = 'E' } } })Update
Sends opx:net:prompts:update.
prompts.Update(source, owner, id, patch)Parameters
- source:
number - owner:
string - id:
string - patch:
table— as the clientUpdate
Returns
Result—{ id }
Hide
Sends opx:net:prompts:hide.
prompts.Hide(source, owner, id)Parameters
- source:
number - owner:
string - id:
string
Returns
Result—{ id }
HideAll
Sends opx:net:prompts:hideAll.
prompts.HideAll(source, owner)Parameters
- source:
number - owner:
string
Returns
Result—true