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
      • Add Shells
      • Dispatch
      • Exports
      • Weather
      • Minigames
      • Notifications
      • New Houses
      • Object Types
      • Sell Items
    • 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
      • 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
    • 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
  • createGroup(...)
  • getGroups(resource)
  • joinGroup(...)
  • leaveGroup(playerId, resource, group)
  • getPlayerGroup(playerId, resource)
  • removeMember(resource, identifier, group)
  • deleteGroup(resource, group)
  • setGroupState(resource,group,status)
  1. LAPTOP PACK V3
  2. Groups

Exports

All the exports listed here are server side and should be triggered from your own resource, this will NOT work if av_laptop is not installed and running in your server.

createGroup(...)

Create a new group and assign the player as owner.

parameters:

  • playerId number: The player id server from the person who's creating it and will be designed as owner.

  • resource string: The resource name that is triggering the export, if not provided it will return false and cancel the process.

  • maxMembers? number: The max members allowed for the group, default is 10.

  • name? string: The group name, if not defined it will use the group identifier as name.

  • password? string: The group password in case you want to make it private, optional.

  • status? string: The current group status, "N/A" if not provided.

  • ownerName? string: The owner nickname used for the group, if not provided it will use his character name or "User-" with a random number.

returns:

  • identifier false | string: If there's any problem while group creation it will return false, if the group was created it will return the group identifier as string.

local playerId = source
local resource = "av_boosting"
local maxMembers = 5
local name = "AV Scripts"
local password = false
local status = "Waiting"
local ownerName = "Avilchiis"
local identifier = exports['av_groups']:createGroup(playerId, resource, name, password, status, ownerName)
if identifier then
    print("Group created, identifier:"..identifier)
else
    print("Something went wrong, group couldn't be created")
end

getGroups(resource)

Get all the groups from an existing resource.

parameters:

  • resource string: Resource name you want to get a list of groups.

returns:

  • groups table

local boostingGroups = exports['av_groups']:getGroups("av_boosting")
print(json.encode(boostingGroups, {indent = true}))
-- it will print an empty table if there's no groups or something like this:
--[[
    boostingGroups = {
        ["group_identifier"] = {
            maxMembers: number,
            identifier: string,
            owner: string,
            label: string,
            password: string or false,
            status: string,
            members: {
                {
                    name: string,
                    identifier: string,
                    playerId: string
                },
            }
        },
    }

]]--

joinGroup(...)

parameters:

  • playerId number: The server id from the player who's joining the group.

  • resource string: Resource name where the group belongs.

  • group string: Group identifier.

  • password? string: User password input, will be compared to group password.

  • nickname? string: The name used for player in the group.

returns:

  • result boolean: Returns true if player was able to join the group or false.

local playerId = source
local resource = "av_boosting"
local group = "group_identifier"
local password = "123"
local nickName = "Avilchiis"
local joined = exports['av_groups']:joinGroup(playerId, resoource, group, password, nickName)
if joined then
    print("Player joined the boosting group")
else
    print("Something went wrong...")
end

leaveGroup(playerId, resource, group)

parameters:

  • playerId number: The server id from the player who's leaving the group.

  • resource string: The resource name where the group belongs.

  • group string: The group identifier.

returns:

  • result boolean: Returns true if player was removed from any group or false.

local playerId = source
local resource = "av_boosting"
local group = "group_identifier"
local res = exports['av_groups']:leaveGroup(playerId, resource, group)
if res then
    print("Player was removed from group")
else
    print("Something went wrong...")
end

getPlayerGroup(playerId, resource)

Returns a table with the current group info.

parameters:

  • playerId number: The server id from player.

  • resource string: The resource name where the group belongs to.

returns:

  • result boolean | table: If a group is found it will return a table with all group info, if not then it will return false.

local playerId = source
local resource = "av_boosting"
local group = exports['av_groups']:getPlayerGroup(playerId, resource)
if group then
    print(json.encode(group, {indent = true}))
    --[[ this will print something like this:
        {
            identifier: string,
            maxMembers: number,
            owner: string,
            label: string,
            password: string or false,
            status: string,
            members: {
                {
                    name: string,
                    identifier: string,
                    playerId: number,
                },
            }
        }
    ]]--
else
    print("Player isn't part of any group")
end

removeMember(resource, identifier, group)

Removes the player from a group.

parameters:

  • resource string: The resource name the group belongs to.

  • identifier string: The player identifier

  • group string: The group identifier

returns:

  • removed boolean

local resource = "av_boosting"
local identifier = exports['av_laptop']:getIdentifier(source)
local group = "group_identifier"
local removed = exports['av_group']:removeMember(resource, identifier, group)
if removed then
    print("Player removed from group")
else
    print("Something went wrong...")
end

deleteGroup(resource, group)

parameters:

  • resource string: The resource name the group belongs to.

  • group string: The group identifier.

returns:

  • deleted boolean

local resource = "av_boosting"
local group = "group_identifier"
local deleted = exports['av_groups']:deleteGroup(resource, group)
print(deleted)

setGroupState(resource,group,status)

Sets the current status for the group, this is just in case you want to display a status in your own UI like "Waiting", "In progres", etc.

parameters:

  • resource string: The resource name the group belongs to.

  • group string: The group identifier.

  • status string: The status to display.

returns:

  • updated boolean

local resource = "av_boosting"
local group = "group_identifier"
local status = "Working"
local updated = exports['av_groups']:setGroupState(resource, group, status)
if updated then
    print("Group status got updated")
else
    print("Something went wrong")
end

Last updated 3 months ago