Configuration

nn_drugsale Configuration Guide

This document explains all configuration options available in config.lua and how they are used throughout the nn_drugsale system. Use this as a reference for customizing the script to your server's needs.


General Settings

Config.DialogueCooldown = 1
Config.InteractionDistance = 3.0
Config.OnDutyDuration = 300000
Config.InteractionTimeout = 30
Config.MinPolice = 1
  • DialogueCooldown (number): Cooldown (in seconds) between dialogue interactions.

  • InteractionDistance (number): Distance (in meters) for NPC interactions.

  • OnDutyDuration (number): Duration (in ms) a player stays "on duty" for drug selling.

  • InteractionTimeout (number): Timeout (in seconds) for NPC interaction.

  • MinPolice (number): Minimum police required online to start selling drugs.


Drug Types

  • label: Display name for the drug.

  • image: Inventory image filename.

  • basePrice, minPrice, maxPrice: Pricing for the drug.

  • amount, minAmount, maxAmount: Default and allowed sale amounts.

  • category: Drug category (e.g., "weed", "hard").

  • rarity: Rarity level (e.g., "common").

  • animation: Table with animation dict, name, duration, and scenario for use.

Customization Example:

Location-Based NPC Type Detection

  • Override NPC types in specific map areas by adding coordinates and type.


Notifications

  • Customize notification messages and styles for on/off duty, errors, etc.


Commands

  • Change the chat commands for on duty, testing dialogue, and ending dialogue.


Phone App Configuration

  • Enable/disable specific phone apps.


Reputation System

  • minReputation, maxReputation: Limits for reputation.

  • changes: How much reputation changes for each action.

  • responseTimeLimit: Time (ms) for response bonuses/penalties.


Drug Test Chance

  • Set the chance (percentage) that an NPC will like the drugs.


Gang System

  • detectionMethod: 'qb-gangs', 'qb-gangmenu', 'custom', or 'jobs'.

  • customGangDetection: Custom function for gang detection.

  • gangNames: Display names for gangs.

  • showGangNameInAlerts: Show gang name in alerts.

  • showGangTerritories: Show all gang-dominated territories to gang members.

  • gangJobs: List of jobs considered as gangs (if using 'jobs').


Snitcher System

  • probability: Chance an NPC is a snitcher.

  • postDealNotification: Settings for police notification after a deal.

  • policeNotification: Police alert messages and blip settings.

  • behavior: What happens if a snitcher likes/dislikes the drug.

  • bigOffer: Enable/disable big offers for snitchers, set multiplier and amount range.

  • policeNotificationLocations: List of possible police notification locations.

  • meetingLocations: List of possible meeting locations for deals.

  • meetingTime: Meeting time intervals and scaling.

  • snitcherDialogue: Dialogue and blip settings for snitchers.


Goods System

  • enabled: Enable/disable the goods system.

  • categories: Define categories for goods.

  • rarities: Define rarity levels and their properties.

  • available: List and configure available goods (drugs).


Dialogue Configuration

  • Config.Dialogue: Contains all dialogue trees, questions, answers, and voice lines for NPC interactions. You can fully customize the dialogue system here.


Contact Message System

  • minInterval, maxInterval: Time (in seconds) between contact messages.

  • counterOffer: Min/max percent for counter offer acceptance.


Dealer System

  • available: List of dealers, their names, models, cut, speed, and locations.

  • delivery: Dealer arrival time, spawn distance, and stay duration.

  • auto_selling: Enable/disable, set check interval, min/max quantity per cycle.

  • withdrawal: Set withdrawal threshold and deposit method (cash/bank).


Customization Examples

Add a New Drug

Change Police Requirement

Adjust Dealer Cut

Enable/Disable Phone Apps


Tip: After making changes, restart the resource for them to take effect.

For more advanced configuration, refer to the comments in config.lua or reach out for support.

Last updated