AV Scripts
StoreDiscord
  • Documentation
  • Guides
    • Dealerships
      • Installation
      • Admin Panel
        • Permissions
        • Creator
        • Import Vehicles
        • Warehouse
      • Dealership Panel
        • Dealership Blip
        • Overview
        • Auctions
        • Bank
        • Employees
        • Orders
        • Financing
        • Rentals
        • Showroom
        • Warehouse
        • Pre Owned
        • Settings
      • Showroom
      • Exports
      • FAQ
    • House Robbery
      • Installation
        • Inventories
      • Add Shells
      • Dispatch
      • Exports
      • Weather
      • Minigames
      • Notifications
      • New Houses
      • Object Types
    • Illegal Runs
      • Installation
      • Customization
      • Ox Inventory
      • QB Inventory
    • Multicharacter
      • Installation
      • Character Slots
      • Clothes
      • Scenes
        • Previews
      • Exports
      • Weather
    • Paleto Heist
      • Buy here
    • Refund System
      • Installation
        • Inventories
    • Tuning Script
      • Installation
      • Events and Controls
      • Exports
      • Price Multiplier
    • Vehicleshop
      • Installation
      • Admin Panel
      • Addon Vehicles
      • Functions
        • Fuel
        • Keys
        • VIP
        • Weather
      • Garages
      • HUD
      • Society
    • Weather Script
      • Installation
        • Roxwood Map
      • Breath Condensation
      • Fog
      • Real Time Sync
      • Exports
    • VIP Script
      • Installation
      • Exports
      • Categories
      • Admin
      • Tebex
      • Free Tokens
  • LAPTOP PACK V3
    • Laptop v3
      • Installation
        • Inventory
        • Cosmo
        • Permissions
        • QBCore
        • Custom Framework/Inventory
        • Phone
        • Translate
      • Browser
      • Terminal
      • Documents
      • APPs Config
      • Exports
    • Boosting
      • Create Profile
      • APP
      • Contracts
      • Dispatch
      • Lockpick Export
      • VIN Export
    • Business
      • Installation
        • Inventories
          • Origen Inventory
            • ESX
            • QBCore
          • OX Inventory
          • QB/PS/LJ Inventory
          • Quasar Inventory
            • ESX
            • QBCore
          • Codem Inventory
          • Tgiann Inventory
        • ESX
      • Admin Panel
        • Create Zones
        • Edit Zones
      • Config
        • Animations
        • Blips
        • Buttons
        • Crafting
        • Effects
        • Events
          • Items
          • Zones
        • Logs
          • Custom Logs
        • Permissions
      • Exports
      • Banking Scripts
      • Multijobs
    • Cameras
      • Installation
        • Vehicle Cameras
      • Place Camera
      • Job Cameras
    • Contacts
      • Exports
    • Drugs
      • Installation
      • Admin Panel
      • APP
      • Tables
      • Labs
        • PC
        • Raids
      • Alert Cops
      • Shells
      • Exports
    • Gangs
      • Installation
      • Admin Panel
        • Gangs
        • Whitelist
      • Properties
      • Register Gang
      • APP
        • Members
        • Settings
        • Missions
        • Blackmarket
        • Properties
      • Graffitis
      • Missions
      • Gang NPC
      • Shells
      • Exports
      • Labs
    • Groups
      • Events
      • Exports
    • Music
      • Installation
      • Music Labels
      • APP
        • Search Music
        • Playlists
        • Headphones
      • CDs
    • Racing
      • Installation
        • Permissions
        • Discord Logs
        • Addon Vehicles
      • Admin Panel
      • Categories
      • Events
      • Exports
      • Personal Settings
      • The Underground
    • Custom APPs
    • Discord Support
Powered by GitBook
On this page
  1. LAPTOP PACK V3
  2. Contacts

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

newContact(data)

Use this export from an external script to register a new contact in the contact list configuration.

Params:

  • data: table

    • identifier: string An unique identifier for the contact.

    • name: string Name used for display.

    • coords: table Coords where the contact is located {x:number, y:number, z:number}

    • avatar?: string Avatar used for contact list.

    • description: string Description used for contact list.

    • default?: boolean Show this contact by default.

    • max?: number Max level available for this contact (every 100XP is 1 level)

local data = {
    identifier = "av_scripts",
    name = "AV Scripts",
    avatar = "https://files.fivemerr.com/images/303c36b5-0730-4d9f-b1c8-e61725a233d3.png",
    coords = {x = 129.10, y = 19.87, z = 20.55},
    description = "The best laptop available for Fivem",
    default = true,
    max = 5,
}
local registered = exports['av_contacts']:newContact(data)
print("Registered?", registered)

addContact(playerId, identifier)

Trigger this export when the player meets a contact, this will register the contact in the player contacts list.

Params:

  • playerId:number The player server ID.

  • identifier:string The contact identifier.

Returns:

  • result: boolean It will return true if the contact is registered successfully or false if the player already had this contact on his list.

local registered = exports['av_contacts']:addContact(source,"garbage_job")
print("Registered?", registered)

removeContact(playerId, identifier)

Use this export to remove a contact from the player contacts list and remove his reputation with the contact.

Params:

  • playerId: number The player server ID.

  • identifier: string The contact identifier.

Returns:

  • result: boolean Return true if the contact was removed or false if the contact didn't exists in player list OR you added a non existing contact identifier.

local removed = exports['av_contacts']:removeContact(source,"garbage_job")
print("Removed?", removed)

addXP(playerId, identifier, xp)

Add reputation to the relationship between the player and the selected contact.

Params:

  • playerId: number The player server ID

  • identifier: string The contact identifier

  • xp: number The reputation to add

Returns:

  • result: boolean It will only return false if the export receives a null value, or if the player ID and/or contact identifier don't exist.

local added = exports['av_contacts']:addXP(source,"garbage_job",25)
print("Added?", added)

removeXP(playerId, identifier, xp)

Remove reputation to the relationship between the player and the contact.

Params:

  • playerId: number The player server ID

  • identifier: string The contact identifier

  • xp: number The reputation to remove

Returns:

  • result: boolean It will return false if any parameter is null or invalid, or if the player has no existing relationship with the specified contact.

local removed = exports['av_contacts']:removeXP(source, "garbage_job", 25)
print("Removed?", removed)

getContacts(playerId)

Params:

  • playerId: number The player server ID

Returns:

  • result: table Returns a table with all the contacts known by the player.

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

getContact(playerId, 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:

  • playerId: number The player server ID

  • identifier:string The contact identifier

Returns:

  • result: table or false

local contact = exports['av_contacts']:getContact(source, "garbage_job")
if contact then
    print(json.encode(contact, {indent = true}))
    --[[
        {
            identifier:string,
            name:string,
            default:boolean,
            coords:table,
            xp:number,
            description:string,
            avatar:string,
        }
    ]]--
end

Last updated 14 days ago