The key the player’s phone data is filed under, or nil
GetAccount(src)
{ id, name, createdAt, avatar? } - the signed-in Lemon Account, or nil
GetDeviceKey(src)
The handset the player holds ('phone:<serial>' / 'player:<id>'), or nil
SIM cards and phone numbers
Export
GiveSim(src, { carrier?, label?, number? })
Creates a SIM card item -> ok, meta
GetSims(src)
{ list = { { slot, number, carrier, label? } }, active }
GetPhoneNumber(src)
The active line’s number, or nil
InsertSim(src, meta)
Puts a SIM in the handset -> slot, or nil (no handset / no free slot)
ReloadSims(src)
Re-reads the cards from the database and pushes them to the phone
-- A phone shop: give the buyer a new SIM card.localok,meta=exports['gfx-phone']:GiveSim(source,{carrier='Fleeca Mobile'})ifokthenprint('new number',meta.number)end
Calls
Export
FindPlayerByNumber(number)
The online player whose active line is number, or nil
GetCallPartner(src)
The player src is talking to (the first other one on a conference call), or nil
GetCallMembers(src)
Every player on src’s call, src included ({} when not on one)
IsCallMuted(src)
true while src has their call muted
Special numbers
Phone numbers your script answers - hotlines, keypad menus, hold music. Guide: Special numbers.
Export
RegisterSpecialNumber(number, def)
A line your resource answers (label, ringSeconds, audio, onStart, onKey, onEnd…) -> true | false, err
Clears water damage and cracks (a repair shop, after payment)
Mail
Export
SendMail(src, msg)
Mail to an online player -> id, or nil + 'offline' | 'invalid'
SendMailTo(address, msg)
Mail to any mailbox address, the owner online or not -> id, or nil + 'invalid' | 'noMailbox'
SendMailToMany(targets, msg)
Mass mail: targets = addresses and/or online server ids (max 2000) -> mailboxes reached
msg = { from?, fromName?, subject, body?, category?, icon?, codes? }. codes = { { label, value } }
(max 4) shows copy boxes under the body - one-time codes, temporary passwords.
exports['gfx-phone']:SendMail(source,{fromName='Maze Bank',subject='Your login code',body='Use this code to sign in.',codes={{label='Code',value='482913'}},})
Bills and invoices
Export
CreateInvoice(src, target, amount, reason, job?)
-> invoice, or nil + error. src = the issuing employee, or 0 / nil = your resource bills on behalf of job (built-in billing). target = server id, citizen id / identifier or phone number. reason = text or item lines { { label, amount?, qty? } }.
GetInvoices(identifier)
The invoices of a character: { { id, issuer, title, amount, lateFee?, status, issuedAt, dueAt, paidAt?, society? } }
Re-pushes the player’s services view (after a job change)
-- A store robbery alarm.exports['gfx-phone']:CreateServiceCall({service='police',message='24/7 robbery in progress',code='10-90',x=coords.x,y=coords.y,z=coords.z,priority=1,})
ID cards
Export
RefreshIdCards(src)
Re-reads the player’s documents now (after your script issued / revoked one) -> count
GetIdCards(src)
The player’s documents, or nil
PushIdCard(src, card)
Adds / replaces a document from your script (kept until the player leaves) -> true | false, err
RemoveIdCard(src, id)
Removes a document added with PushIdCard
Home (housing)
Export
HavenEvent(propertyId, kind, { who?, visitor? })
Logs an event on a property and notifies its owner and key holders. kind = doorbell, entry, lockpick, alarm, raid, offer, keyGranted, keyRevoked, billPaid. A doorbell with visitor (server id) can be answered from the phone.
HavenChanged(propertyId)
The property changed in your housing script: its holders’ phones re-read it
GetHavenProperties(src)
The player’s properties as the Home app shows them
GetHousingScript()
The housing script Home runs against ('none' when none)
Apps
Export
GetBinixPrice(symbol)
A stock / coin price, or nil
GetMinitFleet()
The Renty car-sharing fleet
SetMinitCarStatus(id, status, extra?)
Changes a fleet car (only cars nobody reserved or rents)