Events and state

Error codes

The short error codes exports and phone requests return when they fail.

An export that can fail returns false or nil, and often a short error code as the second value:

lualocal ok, err = exports['fx-phone']:CreateCall({ number = '5551234' })
if not ok then print('call failed:', err) end

The same codes are the error of the phone's own requests.

#General

Code Meaning
invalid A missing or malformed argument
not_found No such player, number, app or record
denied A check or a permission blocked it
disabled The feature is switched off in the config
internal The server could not finish the request
rate Too many requests, or the same account is busy with another money move
timeout No answer in time
too_large Over a size limit
too_long A text is over its length limit
limit Over a configured limit
exists Already there: a contact, a number, a username
self The target is the caller
unknown The number does not belong to any phone
expired The item or offer is no longer valid

#Calls and messages

Code Meaning
busy The caller is already in a call
target_busy The other side is in a call
unavailable The other side is offline, has no phone, or nobody answers the company line
airplane Airplane mode is on
blocked The other side blocked the caller
in_call Not possible during a call
video_off Video calls are switched off
offline The player is offline
not_member, not_owner, member_limit, not_admin, owner_only, admins_only Group and channel permissions
pin_limit Too many pinned items
privacy The other side's privacy settings do not allow it
window The time in which a message can be edited or deleted has passed

#SIM

Code Meaning
no_sim The phone has no working SIM
has_sim The phone has no free SIM slot
sim2 The app needs the GhostNet card and it is missing, switched off or expired
cooldown The SIM slot does not take another SIM yet
no_item The item is not in the inventory
inventory The inventory could not take or give the item

#Money and shop

Code Meaning
funds Not enough money or coins
no_account The bank adapter has no account for that job
no_price The coin has no price yet
owned The player already owns it
sold_out Nothing left to buy
closed The match, invite or poll has already ended

#Other

Code Meaning
provider The upload provider failed or is off
url The link is not on an allowed host
banned The account is banned from that app
alarm_limit Too many alarms

#Codes outside the list

A few exports return their own codes:

Code Returned by
invalid_id, invalid_ui, reserved_id AddCustomApp. See Custom apps (client)
far Handing a Wallet card to a player who is not close enough
size An upload from the page that is over the size limit