AV Scripts
StoreDiscord
  • Documentation
  • Guides
    • Dealerships
      • Installation
      • Admin Panel
        • All Vehicles
        • Dealerships
        • Auctions
      • Dealership Panel
        • Overview
        • Auctions
        • Employees
        • Orders
        • Payments
        • Showroom
        • Warehouse
        • Pre Owned
        • Settings
      • Buy/Sell Vehicles
      • Catalogue
      • 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
  1. LAPTOP PACK V3
  2. Drugs

Exports

All drugs used for server exports needs to be previously registered in server/editable/_drugs.lua > Config.Drugs table, otherwise you won't be able to see them in the APP.

getLab()

If player is inside a lab it will return the lab identifier or false if is outside.

local lab = exports['av_drugs']:getLab()
if lab then
    print(lab)
else
    print("Player isn't inside a lab")
end

getStrain

returns strain name or false if not found.

params:

  • playerId number

local strain = exports['av_drugs']:getStrain(playerId)
if strain then print(strain) end

getDrug

returns a specific drug info.

if no drug name is specified it will return all drugs table or false if nothing found.

params:

  • playerId number

  • drug string or false (optional)

local drugInfo = exports['av_drugs']:getDrug(playerId, drug)
if drugInfo then
    print(json.encode(drugInfo, {indent = true}))
    --[[
    example without defining drug name:
    {
        "drug1": {
            "income": 0,
            "sold": 0,
            "label": "Drug Label",
            "name": "drug1",
            "xp": 0
        },
        "drug2": {
            "xp": 0,
            "label": "Drug Label",
            "name": "drug2"
        }
    }
]]--
end

addZoneRep

Adds reputation for a specific strain and drug in a zone, all param values are needed or it will return false, returns true if rep was added.

params:

  • zone string

  • strain string

  • drug string

  • bags number

local zone = "DTVINE"
local strain = "AV Scripts"
local drug = "drug1"
local bags = 5
local added = exports['av_drugs']:addZoneRep(zone,strain,drug,bags)
if added then print("Bags added for strain") end

addXP

Add drug XP to a specific player, returns true if added

If the drug doesn't exist in the Player table it will add it, if is a custom drug from your own script make sure to register it first in Config.Drugs.

params:

  • playerId number

  • drugName string

  • xp number

local added = exports['av_drugs']:addXP(playerId,drugName,xp)
if added then print("Drug XP was added to player") end

removeXP

Remove drug XP from a specific player, returns true if removed.

params:

  • playerId number

  • drugName string

  • xp number

local removed = exports['av_drugs']:removeXP(playerId,drugName,xp)
if removed then print("Removed XP from player") end

Last updated 7 months ago

Zone names can be found here:

https://docs.fivem.net/natives/?_0x98CD1D2934B76CC1