opx_infinitycalls
Server
Last updated on
The calls contract on the server — read calls and contacts, hang a player up.
local calls = OPX.Api.Get('calls')From server code inside opx_infinity. Each function answers a Result; error codes are calls.error.<reason>.
IsOnCall
calls.IsOnCall(playerId)Parameters
- playerId:
number
Returns
Result—{ onCall = false }or{ onCall = true, callId, founder, participants, elapsedMs };participantsis a list of player ids.
local res = calls.IsOnCall(source)
if res.ok and res.value.onCall then print('on call', res.value.callId) endList
Every live call.
calls.List()Returns
Result—{ calls = { { id, participants = { { id, name } } } } }
HangUp
Takes the player off their call; the call ends if fewer than two remain. The other participants get no toast.
calls.HangUp(playerId, caller)Parameters
- playerId:
number - caller:
string— only written to the audit line
Returns
Result—{ callId, ended }
Eyes
Whether the holocall eye glow is on, and whether this module holds it.
calls.Eyes(playerId)Parameters
- playerId:
number
Returns
Result—{ lit, ours }; errorcalls.error.unreadable
Contacts
The player's stored contacts.
calls.Contacts(playerId)Parameters
- playerId:
number
Returns
Result—{ contacts = { { citizenId, name } } }