Skip to content

Contacts

Contacts

Manage the player's contact list. Supports add, edit, delete, favorite toggle, proximity sharing, and accepting shared contacts.

Database Tables

TablePurpose
phone_contactsContact entries -- identifier, number, display, avatar, favorite

Server Callbacks

CallbackPurpose
gcphone:getContactsReturns all contacts for the player, sorted by favorite then display name
gcphone:addContactAdds a new contact (prevents duplicates by number)
gcphone:updateContactUpdates an existing contact's name, number, and avatar
gcphone:deleteContactDeletes a contact by ID
gcphone:toggleFavoriteToggles the favorite flag on a contact
gcphone:shareContactSends a contact to a nearby player via proximity
gcphone:acceptSharedContactAccepts and saves a contact shared by another player

Config Options

lua
Config.Contacts = {
    MaxContacts       = 200,
    AllowSharing      = true,
    ProximityDistance  = 3.0,
}

Exports

ExportSignaturePurpose
GetContacts(identifier, requestSource) -> table[]Returns contact list (access-checked)

Hooks

Fires TriggerPhoneHook for:

  • contactAdded -- when a contact is created
  • contactUpdated -- when a contact is edited
  • contactDeleted -- when a contact is removed

Released under GPL-3.0 License