Exports

getContact(identifier)

Use this export to retrieve the info from a contact, including the player reputation.

If the player hasn't meet the contact yet the export will return false, unless the contact config field default is set to true.

Params:

  • identifier:string The contact identifier

Returns:

  • result: table or false

local result = exports['av_contacts']:getContact("garbage_job")
if result then
    --[[
        {
            identifier:string,
            name:string,
            default:boolean,
            coords:table,
            xp:number,
            description:string,
            avatar:string,
        }
    ]]--
else
    print("Player doesn't know this contact yet")
end

getContacts()

Returns a table with all the contacts known by the player.

local result = exports['av_contacts']:getContacts()
if result and next(result) then
    for identifier, contact in pairs(result) do
        print(json.encode(contact, {indent = true}))
        --[[
            {
                identifier:string,
                name:string,
                default:boolean,
                coords:table,
                xp:number,
                description:string,
                avatar:string,
            }
        ]]--
    end
end

Last updated