Creating a drug

A drug can be created either in Config.lua under the Config.Drugs = {} table or by creating another file in the shared folder named NewJob.lua (following ExampleDrug.lua)

ExampleDrug.lua
ExampleStep1 = {
    Restricted = {
      BlackListedJobs = nil, -- Array of blacklisted jobs
      WhiteListedJobs = nil, -- Array of whitelisted jobs
      ShouldHaveJob2 = false, -- If the player should have an illegal job (job2)
      MinimumPolice = 4, -- Minimum police online
      TimeLimit = { -- The example below enables this step from 14:00 to 2:00 AM
        StartHours =  14,
        StartMinutes = 00,
        EndHours = 2,
        EndMinutes = 00,
        BypassIfPoliceOnline = false, -- Bypass the time limit if minimum police
      },
    },
    Blip = {
      Enable = true,
      BlipForEveryLocation = false,
      Sprite = 51,
      Color = 3,
      Scale = 0.6,
      Display = 4,
      Label = 'Example drug',
      Locations = {
        vector3(376.94, 3565.68, 32.48)
      },
    },
    Locations = {
      vector3(376.94, 3565.68, 33.48)
    },
    Model = nil,
    -- Model = {
    --   Hash = 452618762,
    --   Rotation = vector3(0.0, 0.0, 0.0),
    --   PlaceOnGround = true,
    --   Freeze = true,
    -- },
    Interaction = { -- KmF_Interaction Integration
      Distance = 5.0,
      Label = 'Example Drug Interaction',
      Offset = {
        label = 0.4,
        target = 0.4,
      },
      Icon = 'fa-solid fa-leaf',
      Key = 'E',
      Duration = 500,
    },
    Animation = {
      Scenario = false,
      Dict = 'anim@amb@business@weed@weed_inspecting_lo_med_hi@',
      Name = 'weed_spraybottle_crouch_idle_02_inspector',
      Flag = 49,
      Prop = nil,
      DisabledControls = {
        Mouse = false,
        Player = true,
        Vehicle = true
      },
    },
    Time = {
      Base = 5000,
      Random = true,
      Min = 1000,
      Max = 2000,
    },
    Rules = { -- Rules to respect to be able to work
      MinVehicleDistance = 6.0,
      MaxPlayerDistance = 3.5,
      AllowWorkInVehicle = false,
    },
    -- RequiredItems = {
    --   ['phone'] = { Remove = true, Amount = 1 },
    -- },
    RequiredItems = nil,
    Drop = {
      Items = {
        ['example_item'] = {
          Name = 'example_item',
          Base = 1,
          Random = false,
          Min = 1,
          Max = 3,
          Rarity = 84, -- %
        },
      },
      Amount = {
        Base = 1,
        Random = false,
        Min = 1,
        Max = 3,
      }
    },
    ProgressBar = { -- RProgress
      Enable = true,
      Settings = nil, -- or {} with custom settings
    },
    SkillCheck = { -- ox skillcheck
      Enable = false,
      Steps = 3,
      Random = true,
      Min = 1,
      Max = 3,
      Difficulty = {areaSize = 60, speedMultiplier = 1.2},
    },
    AutoWork = true, -- Work automatically if the inventory has capacity and not get cancelled
    CustomEvent = nil, -- nil or event name to trigger client side
    CustomFunction = nil, -- nil or function to trigger client side
  },

Parameters

Restricted

  • BlackListedJobs:

    • Type: Table or nil

    • Description: Jobs that are not allowed to perform this task.

    • Default: nil

  • WhiteListedJobs:

    • Type: Table

    • Description: Jobs that are allowed to perform this task.

    • Default: { 'ross' }

  • ShouldHaveJob2:

    • Type: Boolean

    • Description: Whether a secondary job is required.

    • Default: false

  • MinimumPolice:

    • Type: Integer

    • Description: Minimum number of police required online to perform the task.

    • Default: 4

  • TimeLimit:

    • StartHours:

      • Type: Integer

      • Description: Start hour for the task.

      • Default: 14

    • StartMinutes:

      • Type: Integer

      • Description: Start minutes for the task.

      • Default: 00

    • EndHours:

      • Type: Integer

      • Description: End hour for the task.

      • Default: 2

    • EndMinutes:

      • Type: Integer

      • Description: End minutes for the task.

      • Default: 00

    • BypassIfPoliceOnline:

      • Type: Boolean

      • Description: Whether to bypass time restrictions if police are online.

      • Default: false

Blip

  • Enable:

    • Type: Boolean

    • Description: Whether to enable the blip on the map.

    • Default: true

  • BlipForEveryLocation:

    • Type: Boolean

    • Description: Whether to create a blip for every location.

    • Default: false

  • Sprite:

    • Type: Integer

    • Description: Sprite ID for the blip.

    • Default: 51

  • Color:

    • Type: Integer

    • Description: Color ID for the blip.

    • Default: 3

  • Scale:

    • Type: Float

    • Description: Scale of the blip.

    • Default: 0.6

  • Display:

    • Type: Integer

    • Description: Display type for the blip.

    • Default: 4

  • Label:

    • Type: String

    • Description: Label for the blip.

    • Default: 'Raccolta Efedrina Blu'

  • Locations:

    • Type: Table

    • Description: Coordinates for the blip locations.

    • Default: { vector3(376.94, 3565.68, 32.48) }

Locations

  • Type: Table

  • Description: Coordinates for the job locations.

  • Default: { vector3(376.94, 3565.68, 33.48) }

Interaction

  • Distance:

    • Type: Float

    • Description: Interaction distance.

    • Default: 5.0

  • Label:

    • Type: String

    • Description: Label for the interaction.

    • Default: 'Raccogli Efedrina Blu'

  • Offset:

    • label:

      • Type: Float

      • Description: Offset for the label.

      • Default: 0.4

    • target:

      • Type: Float

      • Description: Offset for the target.

      • Default: 0.4

  • Icon:

    • Type: String

    • Description: Icon for the interaction.

    • Default: 'fa-solid fa-leaf'

  • Key:

    • Type: String

    • Description: Key to trigger the interaction.

    • Default: 'E'

  • Duration:

    • Type: Integer

    • Description: Duration of the interaction in milliseconds.

    • Default: 500

Animation

  • Scenario:

    • Type: Boolean

    • Description: Whether to use a scenario animation.

    • Default: false

  • Dict:

    • Type: String

    • Description: Animation dictionary.

    • Default: 'anim@amb@business@weed@weed_inspecting_lo_med_hi@'

  • Name:

    • Type: String

    • Description: Animation name.

    • Default: 'weed_spraybottle_crouch_idle_02_inspector'

  • Flag:

    • Type: Integer

    • Description: Animation flag.

    • Default: 49

  • Prop:

    • Type: nil or Table

    • Description: Prop to use in the animation.

    • Default: nil

  • DisabledControls:

    • Mouse:

      • Type: Boolean

      • Description: Whether to disable mouse controls.

      • Default: false

    • Player:

      • Type: Boolean

      • Description: Whether to disable player controls.

      • Default: true

    • Vehicle:

      • Type: Boolean

      • Description: Whether to disable vehicle controls.

      • Default: true

Time

  • Base:

    • Type: Integer

    • Description: Base time for the task in milliseconds.

    • Default: 5000

  • Random:

    • Type: Boolean

    • Description: Whether to randomize the time.

    • Default: true

  • Min:

    • Type: Integer

    • Description: Minimum time in milliseconds.

    • Default: 1000

  • Max:

    • Type: Integer

    • Description: Maximum time in milliseconds.

    • Default: 2000

Rules

  • MinVehicleDistance:

    • Type: Float

    • Description: Minimum distance from a vehicle.

    • Default: 6.0

  • MaxPlayerDistance:

    • Type: Float

    • Description: Maximum distance from a player.

    • Default: 3.5

  • AllowWorkInVehicle:

    • Type: Boolean

    • Description: Whether to allow work inside a vehicle.

    • Default: false

RequiredItems

  • Type: nil or Table

  • Description: Items required to perform the task.

  • Default: nil

Drop

  • Items:

    • blue_ephedrine:

      • Name:

        • Type: String

        • Description: Item name.

        • Default: 'blue_ephedrine'

      • Base:

        • Type: Integer

        • Description: Base amount.

        • Default: 1

      • Random:

        • Type: Boolean

        • Description: Whether the amount is random.

        • Default: false

      • Min:

        • Type: Integer

        • Description: Minimum amount.

        • Default: 1

      • Max:

        • Type: Integer

        • Description: Maximum amount.

        • Default: 3

      • Rarity:

        • Type: Integer

        • Description: Rarity percentage.

        • Default: 84

    • ruined_ephedrine:

      • Name:

        • Type: String

        • Description: Item name.

        • Default: 'ruined_ephedrine'

      • Base:

        • Type: Integer

        • Description: Base amount.

        • Default: 1

      • Random:

        • Type: Boolean

        • Description: Whether the amount is random.

        • Default: false

      • Min:

        • Type: Integer

        • Description: Minimum amount.

        • Default: 1

      • Max:

        • Type: Integer

        • Description: Maximum amount.

        • Default: 3

      • Rarity:

        • Type: Integer

        • Description: Rarity percentage.

        • Default: 15

    • super_ephedrine:

      • Name:

        • Type: String

        • Description: Item name.

        • Default: 'super_ephedrine'

      • Base:

        • Type: Integer

        • Description: Base amount.

        • Default: 1

      • Random:

        • Type: Boolean

        • Description: Whether the amount is random.

        • Default: false

      • Min:

        • Type: Integer

        • Description: Minimum amount.

        • Default: 1

      • Max:

        • Type: Integer

        • Description: Maximum amount.

        • Default: 3

      • Rarity:

        • Type: Integer

        • Description: Rarity percentage.

        • Default: 1

  • Amount:

    • Base:

      • Type: Integer

      • Description: Base amount.

      • Default: 1

    • Random:

      • Type: Boolean

      • Description: Whether the amount is random.

      • Default: false

    • Min:

      • Type: Integer

      • Description: Minimum amount.

      • Default: 1

    • Max:

      • Type: Integer

      • Description: Maximum amount.

      • Default: 3

ProgressBar

  • Enable:

    • Type: Boolean

    • Description: Whether to enable the progress bar.

    • Default: true

  • Settings:

    • Type: nil or Table

    • Description: Custom settings for the progress bar.

    • Default: nil

SkillCheck

  • Enable:

    • Type: Boolean

    • Description: Whether to enable skill checks.

    • Default: false

  • Steps:

    • Type: Integer

    • Description: Number of steps in the skill check.

    • Default: 3

  • Random:

    • Type: Boolean

    • Description: Whether the skill check is random.

    • Default: true

  • Min:

    • Type: Integer

    • Description: Minimum difficulty.

    • Default: 1

  • Max:

    • Type: Integer

    • Description: Maximum difficulty.

    • Default: 3

  • Difficulty:

    • areaSize:

      • Type: Integer

      • Description: Size of the skill check area.

      • Default: 60

    • speedMultiplier:

      • Type: Float

      • Description: Speed multiplier for the skill check.

      • Default: 1.2

AutoWork

  • Type: Boolean

  • Description: Whether to work automatically if the inventory has capacity and not get cancelled.

  • Default: true

CustomEvent

  • Type: nil or String

  • Description: Custom event to trigger client-side.

  • Default: nil

CustomFunction

  • Type: nil or Function

  • Description: Custom function to trigger client-side.

  • Default: nil

Last updated