# SickScripts

Detailed documentation for SickScripts. Useful information for using the scripts.

**Developing For Fivem For 2+ years**

**Developer For:**

1. **Project ALPHA**

**Coding Languages:**

1. **LUA (most used)**
2. **JSON**
3. **HTML**

**Developer For:**

1. **Project ALPHA**


# Useful Links

Various Links for SickScripts

{% embed url="<https://store.sickscripts.com/>" %}
Tebex
{% endembed %}

{% embed url="<https://www.twitch.tv/sickjuggalo666>" %}
Twitch
{% endembed %}

{% embed url="<https://discord.gg/YCsBGB58eg>" %}
Discord
{% endembed %}

{% embed url="<https://ko-fi.com/sickjuggalo666>" %}
Kofi
{% endembed %}

{% embed url="<https://github.com/sickjuggalo666>" %}
GitHub
{% endembed %}


# Newest ESX

When Updating to newer ESX versions they removed the CB for getSharedObject. This was to utilize the much faster export, but with that many people have scripts that are locked and impossible for you to update to the export! Below will be a few Steps to follow to help you get updated to newest ESX while still using your older scripts!      &#x20;

There will be two files that we will need to edit!\
&#x20; 1\. client/common.lua

2. server/common.lua                                                                                                                                                  &#x20;

![](https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/ftHr0xaN5qnZOjxVjawV/image.png)![](https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/A17gRybnyqASRMFW6hol/image.png)

In both of these files you will find this snippet of code:

{% code title="client/common.lua 9-12" lineNumbers="true" %}

```lua
AddEventHandler("esx:getSharedObject", function()
	local Invoke = GetInvokingResource()
	print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
```

{% endcode %}

{% code title="server/common.lua 16-19" lineNumbers="true" %}

```lua
AddEventHandler("esx:getSharedObject", function()
	local Invoke = GetInvokingResource()
	print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
```

{% endcode %}

As is these will just print that the getSharedObject event has been depricated and to use the new export! These two snippets we will change by pasting the bellow snippet inside both events! Examples below:

{% code title="CallBack The Object" %}

```lua
cb(ESX)
```

{% endcode %}

Final product for both Events should look like:

{% code title="client/common.lua 9-12" lineNumbers="true" %}

```lua
AddEventHandler("esx:getSharedObject", function(cb) --make sure the cb is there!
    cb(ESX)
end)
```

{% endcode %}

{% code title="server/common.lua 16-19" lineNumbers="true" %}

```lua
AddEventHandler("esx:getSharedObject", function(cb) --make sure the cb is there!
    cb(ESX)
end)
```

{% endcode %}

![](https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/FYTpwDvZ2ymmkvs3Uymn/image.png)

Little Video to help SEE what you need to do better!!

{% embed url="<https://streamable.com/raig4l>" %}


# SickDirtyCops

Dirty Cops will hand out info, buy/sell items, and help you practice for those Robberies!

The Dirty cop Only Spawns during set configed times. After the close time the ped becomes inactive and wonders off. When its opening time again he will show up and wait. It will pick from a random location in the config and spawn there. To keep it more interesting!&#x20;

<figure><img src="https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/ocyAePgTV5GQMEKuZJMb/6.png" alt=""><figcaption><p>Robbery Checks</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/uM1XSRgwjldC5iJOyUna/3.png" alt=""><figcaption><p>MiniGame Testing</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/ng8qedFnvsOaiDJjiG7q/5.png" alt=""><figcaption><p>DropBoxes</p></figcaption></figure>


# Robbery Trigger

Here I will show some examples of ways to use the event to let the menu know that they Robbery is open or if it has recently been robbed!

{% tabs %}
{% tab title="Server Trigger" %}

```
TriggerClientEvent('SickDirtyCops:UpdateRobberyChecks', source, BOOLEN)
```

{% endtab %}

{% tab title="Client Trigger" %}

```
TriggerEvent('SickDirtyCops:UpdateRobberyChecks', BOOLEN)
```

{% endtab %}
{% endtabs %}


# Installation

## Dependencies:

{% hint style="info" %}
💥 ESX or QBCore

💥 MF-Inventory/Ox\_Inventory. This is used for drop boxes. Think illegal spots for crime to transfer goods. (More Inventories Being Added!)

💥 OX\_Target&#x20;

💥 OX\_LIbs

💥 Item checks and money checks for most parts of the script.

💥 Uses (GKSPhone/YFlip-Phone) for emails on heist info, But is open for you to change if needed! (Other Phones will be supported soon)
{% endhint %}

{% hint style="danger" %}
Make sure to check over the config as there are a few important options!
{% endhint %}

## Phones

Currently there is only 2 scripted phones set up. More can easily be added or changed to how you would like them to be used if you choose to use them!

\
GKSPhone \
YFlip-Phone

{% embed url="<https://scripts.teamsgg.dev/package/5950013>" %}
YFlip-Phone
{% endembed %}

{% embed url="<https://fivem.gkshop.org/category/script>" %}
GKSPhone
{% endembed %}


# Config

{% tabs %}
{% tab title="ESX" %}
{% code title="Base ESX Config" %}

```lua
Config = {}
Config.CodeAmount = 5000
Config.Framework = 'ESX' -- 'ESX' or 'QBCore'

Config.SickTrapHouses = false
Config.Price = 5 -- price for checking cops AND making inventory
Config.TruckPrice = 5000 -- price to check info on the truck heist
Config.RemoveItem = true
Config.Inventory = 'ox' -- mf,ox,qs
Config.Phone = 'gks' --y-phone or gks

Config.TruckAccount = 'cash' --cash for QBCore
Config.TruckUSB = 'greenusb' -- item for truck heist check (Open for you to change to what ever)
Config.TruckUSBLabel = 'Green USB' -- label for the usb so menu will read better

Config.PoliceJobName = {
	'police'
}


Config.NotificationType = { --['okokNotify' / 'mythic' / 'ox' / 'chat' / 'custom' ]
    client = 'ox',
    server = 'ox'
}

Config.CashAccount = 'money' --cash for QBCore
Config.GreenDongle = 'greendongle' -- item needed to open the Menu
Config.GreenDongleLabel = 'greendongle' -- Now it will show label instead of item

Config.InventoryOptions = {
    inventoryType = "inventory",
    inventorySubType = "housing",
    inventoryLabel = "drop_box",
    maxWeight = 100.0,
    maxSlots = 10,
    OxLabel = "Drop Box"
}

Config.Peds = {
    [1] = {
        Name = "Zeus Almighty",
        TargetName = 'illegal_shop1',
        SpawnName = 'IG_RoccoPelosi',
        OpenTime = 0, -- Open Time
        CloseTime = 24, -- Close Time
    }
}

Config.Locations = { -- NEW option for random locations!
    [1] = {
        coords = vector3(-1042.5310, -828.3828, 9.8815),
        h = 127.6541,
    },
    [2] = {
        coords = vector3(-1033.1675, -836.6893, 9.8819),
        h = 141.4699,
    }
}

Config.TruckInfo = {
    TruckPrice = 5000,
    TruckLocation = vector3(569.46, -3127.42, 18.77)
}

Config.RobberyList = {
    [1] = {
        Header = "Fleeca Banks",
        icon = 'fa-solid fa-bank',
        minCops = 3,
        bank = true,
    },
    [2] = {
        Header = "Store robbery",
        icon = 'fa-solid fa-store',
        minCops = 2,
        bank = false, -- some just need to be here to help script function without error
    },
    [3] = {
        Header = "Pacific Bank",
        icon = 'fa-solid fa-bank',
        minCops = 5,
        bank = true,
    },
    [4] = {
        Header = "House Robbery",
        icon = 'fa-solid fa-house',
        minCops = 1,
        bank = false, -- some just need to be here to help script function without error
    },
    [5] = {
        Header = "Truck Heist",
        icon = 'fa-solid fa-truck',
        minCops = 2,
        bank = false,
    },
}

Config.SellShops = {
    {
        item = 'emerald',
        label = 'Emerald',
        price = math.random(100,175),
        currency = 'money'
    }, -- item = string, label = string, price = number, currency = string
    --[[{
        item = 'diamond',
        label = 'Diamond',
        price = math.random(400,800),
        currency = 'money'
    },]]

}

Config.BuyShop = {
    {
        item = 'thermite',
        label = 'Thermite',
        price = 10,
        currency = 'money',
        maxAmount = 10
    }, -- item = string, label = string, price = number, currency = string
    {
        item = 'c4',
        label = 'C4',
        price = 20,
        currency = 'money',
        maxAmount = 10
    },
    {
        item = 'hacking_laptop',
        label = 'Hacking Laptop',
        price = 16,
        currency = 'money',
        maxAmount = 10
    },
    {
        item = 'transponder',
        label = 'Transponder',
        price = 25,
        currency = 'money',
        maxAmount = 10
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="QBCore" %}
{% code title="Base QBCore Config" %}

```lua
Config = {}
Config.CodeAmount = 5000
Config.Framework = 'QBCore'  -- this is auto caught on server side when script starts. will auto set this for what ever core it finds
Config.MenuType = 'ox_libs' -- ox or zf
Config.SickTrapHouses = false
Config.Price = 5 -- price for checking cops AND making inventory
Config.TruckPrice = 5000 -- price to check info on the truck heist
Config.RemoveItem = true
Config.Inventory = 'ox' -- mf,ox,qs
Config.Phone = 'y-phone' -- 'gks' or 'y-phone'
Config.Target = 'ox_target'

Config.TruckAccount = 'cash'
Config.TruckUSB = 'greenusb'
Config.TruckUSBLabel = 'Green USB'

Config.PoliceJobName = {
	'police'
}


Config.NotificationType = { --['okokNotify' / 'mythic' / 'ox' / 'chat' / 'custom' ]
    client = 'ox',
    server = 'ox'
}

Config.CashAccount = 'cash'
Config.GreenDongle = 'greendongle' -- item needed to open the Menu
Config.GreenDongleLabel = 'greendongle' -- Now it will show label instead of item

Config.InventoryOptions = {
    inventoryType = "inventory",
    inventorySubType = "housing",
    inventoryLabel = "drop_box",
    maxWeight = 100.0,
    maxSlots = 10,
    OxLabel = "Drop Box"
}

Config.Peds = {
    [1] = {
        Name = "Zeus Almighty",
        TargetName = 'illegal_shop1',
        SpawnName = 'IG_RoccoPelosi',
        OpenTime = 0, -- Open Time
        CloseTime = 24, -- Close Time
    }
}

Config.Locations = { -- NEW option for random locations!
    [1] = {
        coords = vector3(-1042.5310, -828.3828, 9.8815),
        h = 127.6541,
    },
    [2] = {
        coords = vector3(-1033.1675, -836.6893, 9.8819),
        h = 141.4699,
    }
}

Config.TruckInfo = {
    TruckPrice = 5000,
    TruckLocation = vector3(569.46, -3127.42, 18.77)
}

Config.RobberyList = {
    [1] = {
        Header = "Fleeca Banks",
        icon = 'fa-solid fa-bank',
        minCops = 3,
        bank = true,
    },
    [2] = {
        Header = "Store robbery",
        icon = 'fa-solid fa-store',
        minCops = 2,
        bank = false, -- some just need to be here to help script function without error
    },
    [3] = {
        Header = "Pacific Bank",
        icon = 'fa-solid fa-bank',
        minCops = 5,
        bank = true,
    },
    [4] = {
        Header = "House Robbery",
        icon = 'fa-solid fa-house',
        minCops = 1,
        bank = false, -- some just need to be here to help script function without error
    },
    [5] = {
        Header = "Truck Heist",
        icon = 'fa-solid fa-truck',
        minCops = 2,
        bank = false,
    },
}

Config.SellShops = {
    {
        item = 'emerald',
        label = 'Emerald',
        price = math.random(100,175),
        currency = 'money'
    }, -- item = string, label = string, price = number, currency = string
    --[[{
        item = 'diamond',
        label = 'Diamond',
        price = math.random(400,800),
        currency = 'money'
    },]]

}

Config.BuyShop = {
    {
        item = 'thermite',
        label = 'Thermite',
        price = 10,
        currency = 'money',
        maxAmount = 10
    }, -- item = string, label = string, price = number, currency = string
    {
        item = 'c4',
        label = 'C4',
        price = 20,
        currency = 'money',
        maxAmount = 10
    },
    {
        item = 'hacking_laptop',
        label = 'Hacking Laptop',
        price = 16,
        currency = 'money',
        maxAmount = 10
    },
    {
        item = 'transponder',
        label = 'Transponder',
        price = 25,
        currency = 'money',
        maxAmount = 10
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Notifications

{% tabs %}
{% tab title="Client Notifications" %}

```lua
function Cnotify(noty_type, message)
    if noty_type and message then
        if Config.NotificationType.client == 'esx' then
            ESX.ShowNotification(message)
        elseif Config.NotificationType.client == 'okokNotify' then
            if noty_type == 1 then
                exports['okokNotify']:Alert("Dongle", message, 10000, 'success')
            elseif noty_type == 2 then
                exports['okokNotify']:Alert("Dongle", message, 10000, 'info')
            elseif noty_type == 3 then
                exports['okokNotify']:Alert("Dongle", message, 10000, 'error')
            end
        elseif Config.NotificationType.client == 'mythic' then
            if noty_type == 1 then
                exports['mythic_notify']:SendAlert('success', message, { ['background-color'] = '#ffffff', ['color'] = '#000000' })
            elseif noty_type == 2 then
                exports['mythic_notify']:SendAlert('inform', message, { ['background-color'] = '#ffffff', ['color'] = '#000000' })
            elseif noty_type == 3 then
                exports['mythic_notify']:SendAlert('error', message, { ['background-color'] = '#ffffff', ['color'] = '#000000' })
            end
        elseif Config.NotificationType.client == 'chat' then
            TriggerEvent('chatMessage', message)        
        elseif Config.NotificationType.client == 'other' then
            --add your own notification.       
        end
    end
end
```

{% endtab %}

{% tab title="Server Notifications" %}

```lua
function Snotify(source, noty_type, message) -- Not Needed as is but maybe future update
    if source and noty_type and message then
        if Config.NotificationType.server == 'esx' then
            TriggerClientEvent('esx:showNotification', source, message)        
        elseif Config.NotificationType.server == 'okokNotify' then
            if noty_type == 1 then
                TriggerClientEvent('okokNotify:Alert', source, 'Dongle', message, 10000, 'success')
            elseif noty_type == 2 then
                TriggerClientEvent('okokNotify:Alert', source, 'Dongle', message, 10000, 'info')
            elseif noty_type == 3 then
                TriggerClientEvent('okokNotify:Alert', source, 'Dongle', message, 10000, 'error')
            end
        elseif Config.NotificationType.server == 'mythic' then
            if noty_type == 1 then
                TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text = message, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' } })
            elseif noty_type == 2 then
                TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = message, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' } })
            elseif noty_type == 3 then
                TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'error', text = message, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' } })
            end
        elseif Config.NotificationType.server == 'other' then
            --add your own notification.
        end
    end
end
```

{% endtab %}
{% endtabs %}

## Events/Exports

{% hint style="info" %}
These Events can be triggered to set the Robbery Status of Banks that will show in the menu letting Players know if the bank is ready to be robbed or not!
{% endhint %}

{% tabs %}
{% tab title="Server Event" %}
{% code overflow="wrap" %}

```lua
TriggerClientEvent('dongle:UpdateRobberyChecks', source, BOOLEN) --BOOLEN = (true or false)
```

{% endcode %}
{% endtab %}

{% tab title="Client Event" %}
{% code overflow="wrap" %}

```lua
TriggerEvent('dongle:UpdateRobberyChecks', BOOLEN) --BOOLEN = (true or false)
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Buy/Sell Shop

{% tabs %}
{% tab title="Sell Shop" %}
{% code lineNumbers="true" %}

```lua
Config.SellShops = {
    {
        item = 'emerald',
        label = 'Emerald',
        price = math.random(100,175),
        currency = 'money'
    },
    --[[{
        item = 'diamond',
        label = 'Diamond',
        price = math.random(400,800),
        currency = 'money'
    },]]

}


item = string, 
label = string, 
price = number, 
currency = string
```

{% endcode %}
{% endtab %}

{% tab title="Buy Shop" %}
{% code lineNumbers="true" %}

```lua
Config.BuyShop = {
    {
        item = 'thermite',
        label = 'Thermite',
        price = 10,
        currency = 'money',
        maxAmount = 10
    },
    {
        item = 'c4',
        label = 'C4',
        price = 20,
        currency = 'money',
        maxAmount = 10
    },
}

item = string, 
label = string, 
price = number, 
currency = string,
maxAmount = number
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}

```lua
Examples = {
    item = 'c4', -- This will be the item you are buying/selling 
    label = 'Cool Custom Label For the C4', -- Label if you choose to put a different name
    price = 210,  -- price for the item above
    currency = 'black_money', -- can be { 'bank', 'money', 'black_money' }
    maxAmount = 10 -- maxAmount that can be bought each storm
}
```

{% endhint %}


# Updates

## Criminal Notification

A new feature now will send a notification to the players in the city. It has a chance check first so it wont always send! Then it checks that the players job is NOT police and will send the notification! This will show minimal info but just enough to give a hint where the Dirty Cop is!

{% code title="server/Sutils.lua" lineNumbers="true" %}

```lua
RegisterNetEvent('SickDirtyCops:NotifyCrimsOfLocation') -- New Event to notify players of Dirty cop location when it moves
AddEventHandler('SickDirtyCops:NotifyCrimsOfLocation', function(street)
    local chance = math.random(0,100) -- chance for the notification to be sent
    if chance < 15 then
        local xPlayers = ESX.GetExtendedPlayers() -- get extended players
        for _, xPlayer in pairs(xPlayers) do
            if not xPlayer.getJob()[Config.PoliceJobName] then -- if players job is not a police job then send message
                if not SentMessage then -- to prevent double messages
                    local NotifData = {
                        title = "Dirty Cop",
                        message = ("Aye I Just picked a new spot! This is to keep cops out of our business! But the new location? Street: %s"):format(street),
                        img= '/html/static/img/icons/messages.png',
                        duration = 7000,
                    }
                    exports["gksphone"]:SendNotification(xPlayer.source, NotifData) -- change to what ever you would like
                    SentMessage = true -- to prevent double messages
                end
            end
        end
        SentMessage = false -- to prevent double messages
    end
end)
```

{% endcode %}


# Custom Events

Adding your own custom events/triggers into Dirty Cops Is SUPER easy. Below I will show you step by step how to add a Function and target option!

## Target Option:

{% code title="client/Cutils.lua" lineNumbers="true" %}

```lua
{
  name = 'ox:option9',
  icon = 'fa-solid fa-money-bill',
  label = 'Test Function',
  canInteract = function(entity, distance, coords, name, bone)
  if distance < 2 then
       return true
  else
       return false
  end
end,
   onSelect = function()
      TestFunction() -- 'YOUR TEST FUNCTION' 
   end
 }
```

{% endcode %}

## Adding the Function:

{% code title="client/Cutils.lua" lineNumbers="true" %}

```stylus
function TestFunction()
    -- Do anything you want here
end
```

{% endcode %}


# Sick2Step

Welcome to Sick2Step a very easy to use system that allows players to add 2 step systems to their vehicles!


# SetUp

{% hint style="success" %}
SQL:&#x20;

`ALTER TABLE` owned\_vehicles`ADD COLUMN`twostep `INT(11) NOT NULL DEFAULT '0';`
{% endhint %}

## Items:

If you are using Ox\_inventory I have provided the needed code to add to items.lua. If you are not using Ox\_inventory then use the provided sql to add the item to your DataBase!

{% tabs %}
{% tab title="Not Using Ox\_Inventory" %}

```sql
INSERT INTO `items` VALUES (`name`,`label`,`weight`)
('2step', '2Step Module', 10),
('2step_checker', '2Step Module Checker', 10);
```

{% endtab %}

{% tab title="Using Ox\_Inventory" %}

```lua
['2step_checker'] = {
	label = '2Step Module Checker',
	weight = 1,
	stack = true,
	close = true,
	description = 'Check A Vehicle for 2Step Modules',
	client = {
		export = 'Sick2Step.2step_checker'
	},
},
['2step'] = {
	label = '2Step Module',
	weight = 1,
	stack = true,
	close = true,
	description = 'Bang Bang',
	client = {
		export = 'Sick2Step.2step'
	},
},
```

{% endtab %}
{% endtabs %}


# Usage

How to Use Sick2Step!

## Items use:

While sitting in a vehicle use the item and it will check if the vehicle already has a module. If not then it will add the vehicle to the db saying that it has one so it is saved.

## Commands:

Using the commands you can enable/disable the 2Step System! If you hold LSHIFT while RPMs are lower it will pop as well. When high RPM and slowing down it will pop as well.

```
/2step
```

{% hint style="danger" %}
When getting in/out of the vehicle the 2step is auto turned off and will need to be reactivated
{% endhint %}


# SickTrapHouses

{% embed url="<https://www.youtube.com/embed/jaciin8PNO0>" %}
[**SickTrapHouses**](https://store.sickscripts.shop)
{% endembed %}

## Gangs

**SickTrapHouses** helps gang members move drugs while they are stored in the Trap Houses. Each gang comes with tons of Config options that you can change to fit more of your servers! Ranging from custom gang names to ranks for certain things. The Config has a ton and allows for you to change a TON of the script from a **SINGLE** file! This brings more rivalry between gangs as knowing the enemy has something I can get makes it that much more fun!

Traphouses are now configed and saved to Database automatically! No need to run an sql when creating a new gang!

## Key Codes

Each Trap house has a unique KeyCode that comes preset but in game your members can change the KeyCode for security! This is a level of security that also helps lock cops out of the traps. These keyCodes are the keys to your stashes that generate an income for you, be careful.

{% hint style="danger" %}
These codes can be stolen and if the rival gang finds your trap houses they can change your KeyCode and lock you out of your own Traps. This will help lead gangs to interact and be more protective of their home turfs.
{% endhint %}

## Drugs

Drugs held in the traphouses are sold on timer that you can easily change to your liking! All items are configed with custom amounts and cash amounts. Each item has a configed account allowing you to add any type of currency to the items.

{% hint style="info" %}
SickDirtyCops:

This Will be linked to my DirtyCops script meaning when you will be able to bring an item or some amount of money that will send you a RANDOM KeyCode that you will have to figure out where it goes!
{% endhint %}


# Installation

Here you will find the different ways to install the script depending on your inventory/framework! These exports will probably be used for a few of my scripts!

{% tabs %}
{% tab title="OX\_Inventory" %} <mark style="color:green;">Nothing is needed to make this work with ox\_inventory. Out of box this is the best way to use the script and will provide the most uses!</mark>
{% endtab %}

{% tab title="QB\_Inventory" %}

## <mark style="color:red;">Here we need to add a few exports that are not default in QB Inventory.</mark>&#x20;

{% code title="qb\_inventory/server/main" %}

```lua
exports('AddToStash',AddToStash)
exports('RemoveFromStash',RemoveFromStash)
exports('GetStashItems',GetStashItems)
```

{% endcode %}

{% code title="Add item to stash" fullWidth="true" %}

```lua
exports.qb_inventory:AddToStash(stashID, slot, otherslot, itemName, amount, info)
```

{% endcode %}

* <mark style="color:red;">stashID</mark> = the ID of the stash to add the item to
* <mark style="color:red;">slot</mark> = the desired slot
* <mark style="color:red;">otherslot</mark> = the slot that the item is added to if item is not unique
* <mark style="color:red;">itemName</mark> = the item you want to add
* <mark style="color:red;">amount</mark> = the amount you want to add
* <mark style="color:red;">info</mark> = any info/metadata for the item (optional)

{% code title="Remove item from Stash" %}

```lua
exports.qb_inventory:RemoveFromStash(stashId, slot, itemName, amount)
```

{% endcode %}

* <mark style="color:red;">stashId</mark> = the stash ID you want to add the item to
* <mark style="color:red;">slot</mark> = the slot to add the item to (not sure its needed)
* <mark style="color:red;">itemName</mark> = the item to be added
* <mark style="color:red;">amount</mark> = the amount of the item to be added

{% code title="Get Stash Items" %}

```lua
exports.qb_inventory:GetStashItems(stashId)
```

{% endcode %}

* <mark style="color:red;">stashId</mark> = the stash to get the items from
  {% endtab %}
  {% endtabs %}


# Events

## T1ger Gangs

T1ger Gangs is now fully supported for many things. Mainly Gang Name check and rank checks! This means instead of using base ESX or QBCore Jobs you can use T1ger Gangs. Players will be able to have a legal job while keeping their gang lives seperate!

Few Things are needed in the `Config` in order for this to fully work!

## SQL

{% hint style="info" %}
The SQL for Trap houses is no longer needed as the script will check the config and if the house is not already created it will create it according to the Configed Gang Names and Configed Key Codes! Example Below
{% endhint %}

```lua
gangName = 'Ballas', -- Gang name linked to T1ger Gangs
code = 6666, -- this is now how its added instead of SQL or messing with your DB!
```

## Config

{% hint style="danger" %}
Make sure you add the T1ger Gang Name to this table&#x20;

`GangName = [Gang Name]`
{% endhint %}

```lua
Config.Gangs = {
    {name = 'police', GangName = 'Police', rank = 0}, -- Police needs to be here if you want them to be able to access Trap Houses. if not simply remove them from the table!
    {name = 'ballas', GangName = 'Ballas', rank = 0}, -- Rank is for keeping lower ranks from changing the KeyCode
    {name = 'families', GangName = 'Families', rank = 0},
    {name = 'vagos', GangName = 'Vagos', rank = 0}
}
```

## Adding New Items

```lua
[1] = {
    name = 'weed', -- item name
    amount = 1, -- how many at one time you want sold?
    moneyName = 'black_money',  -- you can put any ITEM here!!! money / black_money for cash
    moneyAmount = math.random(100,300),  -- Equation = { amount * moneyAmount = TotalAmount} E.X = { 1 * 100 = 100 }, { 2 * 100 = 200 }
},
```

* Name = The Name of the input item (item to be exchanged)
* amount = The amount of the above item to be removed
* moneyName = any thing can be your money item or ANY item!! this is the item given in exchange for the above item!
* moneyAmount = The amount of the 'moneyName' to give! math.random DO work here!


# SickWarrants

{% embed url="<https://github.com/sickjuggalo666/sickwarrants>" %}
SickWarrants
{% endembed %}

A WARRANT system for FiveM. Cops can set personal or vehicular warrants. Citizens can go to set locations you pick and use the event to check for warrants they may have. Cops only can delete active warrants. Bounties can be set by certain jobs.

{% embed url="<https://www.youtube.com/embed/d8ClNcEsm2I>" %}

{% hint style="danger" %}
`Make sure to go into your DataBase and insert the SQL that was provided in the downloaded files!`
{% endhint %}

Make sure to add ensure sickwarrants server.cfg!

Finally we will **boot up/restart** the server to make sure that the DB table is set and ready to be read from! Once the server is fully booted up and running you can fly in and start setting warrants on people or possibly even running from the warrants! 😏


# Events

{% tabs %}
{% tab title="Event" %}

```lua
TriggerEvent('sickwarrants:warrantMenu')
```

{% endtab %}

{% tab title="Export" %}

```lua
exports['sickwarrants']:warrantMenu()
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
It is known that export may not work. If so contact us and we will get it patched ASAP
{% endhint %}


# Examples

## Config

```lua
Config = {}

Config.CheckVersion = true -- do you wanna stay up to date? will print in server console

Config.MenuType = 'ox_libs'


Config.jobsAuth = {
    ['police'] = true,
    ['bcso'] = true,
}

Config.BountyJobs = {
      ['bondsman'] = true,
      ['police'] = true
}

Config.NotificationType = { --['okokNotify' / 'mythic' / 'esx' / 'chat' / 'custom' ]
    client = 'okokNotify', 
    server = 'okokNotify'
}
```

## Notifications

{% tabs %}
{% tab title="Client" %}

```lua
function Cnotify(noty_type, message)
    if noty_type and message then
        if Config.NotificationType.client == 'esx' then
            ESX.ShowNotification(message)
        elseif Config.NotificationType.client == 'okokNotify' then
            if noty_type == 1 then
                exports['okokNotify']:Alert("Warrants", message, 10000, 'success')
            elseif noty_type == 2 then
                exports['okokNotify']:Alert("Warrants", message, 10000, 'info')
            elseif noty_type == 3 then
                exports['okokNotify']:Alert("Warrants", message, 10000, 'error')
            end
        elseif Config.NotificationType.client == 'mythic' then
            if noty_type == 1 then
                exports['mythic_notify']:SendAlert('success', message, { ['background-color'] = '#ffffff', ['color'] = '#000000' })
            elseif noty_type == 2 then
                exports['mythic_notify']:SendAlert('inform', message, { ['background-color'] = '#ffffff', ['color'] = '#000000' })
            elseif noty_type == 3 then
                exports['mythic_notify']:SendAlert('error', message, { ['background-color'] = '#ffffff', ['color'] = '#000000' })
            end
        elseif Config.NotificationType.client == 'chat' then
            TriggerEvent('chatMessage', message)        
        elseif Config.NotificationType.client == 'other' then
            --add your own notification.       
        end
    end
end
```

{% endtab %}

{% tab title="Server" %}

```lua
function Snotify(source, noty_type, message) -- Not Needed as is but maybe future update
    if source and noty_type and message then
        if Config.NotificationType.server == 'esx' then
            TriggerClientEvent('esx:showNotification', source, message)        
        elseif Config.NotificationType.server == 'okokNotify' then
            if noty_type == 1 then
                TriggerClientEvent('okokNotify:Alert', source, 'Warrants', message, 10000, 'success')
            elseif noty_type == 2 then
                TriggerClientEvent('okokNotify:Alert', source, 'Warrants', message, 10000, 'info')
            elseif noty_type == 3 then
                TriggerClientEvent('okokNotify:Alert', source, 'Warrants', message, 10000, 'error')
            end
        elseif Config.NotificationType.server == 'mythic' then
            if noty_type == 1 then
                TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text = message, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' } })
            elseif noty_type == 2 then
                TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = message, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' } })
            elseif noty_type == 3 then
                TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'error', text = message, style = { ['background-color'] = '#ffffff', ['color'] = '#000000' } })
            end
        elseif Config.NotificationType.server == 'other' then
            --add your own notification.
        end
    end
end
```

{% endtab %}
{% endtabs %}


# SickCarBombs

{% embed url="<https://www.youtube.com/watch?t=2s&v=ofA_AJpswKw>" %}
New Video
{% endembed %}

{% embed url="<https://www.youtube.com/watch?t=1s&v=u9PTopufXJA>" %}
\[[YouTube](https://www.youtube.com/watch?v=u9PTopufXJA)]
{% endembed %}

**SickCarBombs** Allows your players to use Different IEDs to get different results. With 5 IEDs preinstalled and ready to use players will be sure to have fun.&#x20;

1. Timer IED
2. Speed IED
3. Seat Timer IED
4. Instant IED
5. Remote Detonation IED


# Items

To get started we just need to add a few items to our DB or if using Ox\_Inventory put them in your items.lua! Below are the needed items for this to work:

<pre class="language-sql" data-title="Database SQL" data-line-numbers><code class="lang-sql"><strong>INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES 
</strong>    ('ied_timer', 'Timer Explosive Device', 1, 0, 1),
    ('ied_speed', 'Speed Explosive Device', 1, 0, 1),
    ('ied_remote', 'Remote Explosive Device', 1, 0, 1),
    ('ied_delayed', 'Delayed Explosive Device', 1, 0, 1),
    ('ied_instant', 'Instant Explosive Device', 1, 0, 1),
;
</code></pre>

{% code title="ox\_inventory/data/items.lua" lineNumbers="true" %}

```lua
['ied_timer'] = {
    label = 'Timer IED',
    weight = 1,
    stack = true,
    close = true,
},

['ied_speed'] = {
    label = 'Speed IED',
    weight = 1,
    stack = true,
    close = true,
},

['ied_remote'] = {
    label = 'Remote IED',
    weight = 1,
    stack = true,
    close = true,
},

['ied_delayed'] = {
    label = 'Delayed IED',
    weight = 1,
    stack = true,
    close = true,
},

['ied_instant'] = {
    label = 'Instant IED',
    weight = 1,
    stack = true,
    close = true,
},
```

{% endcode %}


# Config

## SmartFires

Added Support for SmartFires. Uses exports to start a fire at the location of the explosion. If you choose to use this option set the Config option to `true`

```lua
Config.SmartFires = true -- to start fires at explosions
```

## Speed

```lua
Config.Speed = 'MPH' -- 'MPH' or 'KPH'
```

## Items

If you choose to change the items used this can be done in the config!

{% code title="Config.IEDItem" lineNumbers="true" %}

```lua
Config.IEDItem = {
    timer = 'ied_timer',
    speed = 'ied_speed',
    seat = 'ied_delayed',
    instant = 'ied_instant',
    remote = 'ied_remote'
}
```

{% endcode %}

## Remote Detonation Options

{% code lineNumbers="true" %}

```lua
Config.TriggerKey = 47 -- for remote bombs
Config.TriggerKeyLabel = 'G' -- label for textUI
```

{% endcode %}

## Notifications

{% code lineNumbers="true" %}

```lua
function CNotify(type,message) -- can change to any if you want
    if type == 1 then -- 3 types, (1,2,3)
        lib.notify({
            title = 'Car Bomb', -- title for notifications
            description = message, -- Message comes from locals file
            type = 'success' -- type goes with type
        })
    elseif type == 2 then
        lib.notify({
            title = 'Car Bomb',
            description = message,
            type = 'inform'
        })
    elseif type == 3 then
        lib.notify({
            title = 'Car Bomb',
            description = message,
            type = 'error'
        })
    end
end
```

{% endcode %}


# SickLockers

{% @github-files/github-code-block %}

## Dependencies

\~ Ox\_libs

\~ Ox\_target

\~ ESX

## Menu Options

\~ Chief can access any inventory that has been created so long as they know the name or case number for the locker/evidence storage!

\~ Lower rank officers can use this to store personal goods on them or if they go off duty they can leave their weapons in a safe place!

\~ Deletion is in there but will not work at this time until i figure a smooth way to delete they inventories! If you have ideas PLEASE let me know!

\~ You can use multiple locations with job based menus and rank based chief menus!

\~ Each case has a unique id that can be pulled up from anywhere really!

## Utilization

\~ Uses OX\_libs for context and Dialog

\~ Uses OX\_Inventory for storage/lockers

\~ Webhooks for Creating and Deleting Inventories!

{% hint style="info" %}
\~ it’s known that it seems like the stashs don’t stay. It’s more of an illusion as you will think you are creating a new one but it will open the one already made. Figuring a way to skip that.

\~ removed stateBags as it seemed some issues but found a way to remove requirement for 1.9.2

\~ will be compatible with older esx versions out of box as it no longer uses state bags and I learned how to check for esx export and if nil use event.

\~ job lockers for other jobs set in config

\~ cleaner config with more options
{% endhint %}

{% hint style="warning" %}
If you need help with anything or have ideas for this or other scripts please join the Discord with the link below! Discord also has other scripts I have made and will be adding more as we go on! Thank you all again!

[Discord](https://discord.gg/YCsBGB58eg)
{% endhint %}


# Config

{% hint style="danger" %}
The Config has changed slightly with new options and changes to the way other options used to work.&#x20;
{% endhint %}

{% code lineNumbers="true" %}

```lua
Config = {}

Config.Framework = 'ESX' -- 'ESX' or 'QBCore'

Config.Target = 'ox_target' -- 'ox_target', 'qb-target'

Config.SickDirtyCopsHeist = true -- COMING SOON

Config.inventory = 'ox' -- 'ox' / 'qb'

Config.location = {
    {
        UsePed = true, -- Do you want to use a ped?
        coords = vector3(465.6510, -998.3225, 23.9148),
        h = 95.5823,
        size = vec3(3, 2, 3), -- size of the box zone
        rotation = 90, -- Rotation of box zone
        cop = true,  -- is this a police job? allows evidence lockers
        job = {['police'] = 0, ['ambulance'] = 0 }, -- Jobs now are accessable by more than one job and the chief options are only available for the rank with the job
        TargetLabel = 'Open Evidence', -- easier to label for each job
        ped = 's_m_m_armoured_01' -- ped is now location/job based
    },
    {
        UsePed = true,
        coords = vector3(335.5984, -570.5597, 43.2493),
        h = 60.4760,
        job = {['ambulance'] = 0},
        cop = false,
        TargetLabel = 'Open Ambulance Lockers',
        ped = 'S_M_M_Doctor_01'
    }, 
    {
        UsePed = true,
        coords = vector3(-214.3525, -1365.2156, 30.2748),
        h = 159.3064,
        job = {['mechanic'] = 0},
        cop = false,
        TargetLabel = 'Open Mechanic Lockers',
        ped = 'S_M_Y_XMech_02_MP'
    }
}

Config.NotificationType = {
    client = 'ox_libs'
}
```

{% endcode %}

## Inventories

Ox is the main supported inventory but for QBCore users the option to use QB-Inventory is there.&#x20;

```lua
Config.inventory = 'ox' -- 'ox' / 'qb'
```

## Job Config

{% hint style="danger" %}
The old rank and job system has been redone to make for a smoother use and allowing for other jobs to access the same inventories!

There is a difference between <mark style="color:red;">`job`</mark> and <mark style="color:red;">`targetJobs`</mark>
{% endhint %}

{% tabs %}
{% tab title="Target Jobs" %}

```css
targetJobs = {['police'] = 0, ['ambulance'] = 0 }
```

Target Jobs are the jobs that have access to the target options to open the menus. If rank is not above the number set they will not be able to open the menu. Otherwise they will have same access as normal but if it is a Cop job then they will be able to see the evidence portion as well!
{% endtab %}

{% tab title="Job Access" %}

```css
job = {['police'] = 0, ['ambulance'] = 0 }
```

These are the jobs that can open the menu. The corresponding number is for the rank of the Chief options. Any rank above the set number will have access to the Chief options. This is also for any extra job that you put in.
{% endtab %}
{% endtabs %}


# Events

If you choose to open the menu from an outside source or other spot not defined in script use

```lua
TriggerEvent('SickEvidence:openInventory')
```


# QBCore Users

If you are using QBCore we need to handle the zones/peds a bit differently as qb-target isn't the best at handling the zones outside of their script. With that we need to make edits to our qb-target to make this work

By Setting `Config.Target`  to `qb-target`  it will inform the script that we are using that target system and make it skip parts like creating peds at certain locations. This is handled now IN `qb-target`  itself.&#x20;

Head to `qb-target/init.lua` and scroll down until you find `Config.Peds` this is where we will now place our peds and edit the target to your liking.&#x20;

{% code lineNumbers="true" %}

```lua
Config.Peds = {
	[1] = { -- This MUST be a number (UNIQUE), if you make it a string it won't be able to delete peds spawned with the export
		model = 's_m_m_armoured_01', -- This is the ped model that is going to be spawning at the given coords
		coords = vector4(445.4416, -996.6559, 30.6896, 0.0636), -- This is the coords that the ped is going to spawn at, always has to be a vector4 and the w value is the heading
		minusOne = true, -- Set this to true if your ped is hovering above the ground but you want it on the ground (OPTIONAL)
		freeze = true, -- Set this to true if you want the ped to be frozen at the given coords (OPTIONAL)
		invincible = true, -- Set this to true if you want the ped to not take any damage from any source (OPTIONAL)
		blockevents = true, -- Set this to true if you don't want the ped to react the to the environment (OPTIONAL)
		animDict = 'abigail_mcs_1_concat-0', -- This is the animation dictionairy to load the animation to play from (OPTIONAL)
		anim = 'csb_abigail_dual-0', -- This is the animation that will play chosen from the animDict, this will loop the whole time the ped is spawned (OPTIONAL)
		flag = 1, -- This is the flag of the animation to play, for all the flags, check the TaskPlayAnim native here https://docs.fivem.net/natives/?_0x5AB552C6 (OPTIONAL)
		scenario = 'WORLD_HUMAN_AA_COFFEE', -- This is the scenario that will play the whole time the ped is spawned, this cannot pair with anim and animDict (OPTIONAL)
		target = { -- This is the target options table, here you can specify all the options to display when targeting the ped (OPTIONAL)
			useModel = false, -- This is the option for which target function to use, when this is set to true it'll use AddTargetModel and add these to al models of the given ped model, if it is false it will only add the options to this specific ped
			options = { -- This is your options table, in this table all the options will be specified for the target to accept
				{ -- This is the first table with options, you can make as many options inside the options table as you want
				num = 1, -- This is the position number of your option in the list of options in the qb-target context menu (OPTIONAL)
				type = "client", -- This specifies the type of event the target has to trigger on click, this can be "client", "server", "command" or "qbcommand", this is OPTIONAL and will only work if the event is also specified
				event = "SickEvidence:openInventory", -- This is the event it will trigger on click, this can be a client event, server event, command or qbcore registered command, NOTICE: Normal command can't have arguments passed through, QBCore registered ones can have arguments passed through
				icon = 'fas fa-door-open', -- This is the icon that will display next to this trigger option
				label = 'Open Locker', -- This is the label of this option which you would be able to click on to trigger everything, this has to be a string
				targeticon = 'fas fa-door-open', -- This is the icon of the target itself, the icon changes to this when it turns blue on this specific option, this is OPTIONAL
				canInteract = function(entity, distance, data) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONAL
					return true
				end,
				job = 'police', -- This is the job, this option won't show up if the player doesn't have this job, this can also be done with multiple jobs and grades, if you want multiple jobs you always need a grade with it: job = {["police"] = 0, ["ambulance"] = 2},
				}
			},
			distance = 2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
		},
	},
	[2] = { -- This MUST be a number (UNIQUE), if you make it a string it won't be able to delete peds spawned with the export
		model = 'IG_BallasOG', -- This is the ped model that is going to be spawning at the given coords
		coords = vector4(425.7189, -985.5151, 30.7109, 1.2687), -- This is the coords that the ped is going to spawn at, always has to be a vector4 and the w value is the heading
		minusOne = true, -- Set this to true if your ped is hovering above the ground but you want it on the ground (OPTIONAL)
		freeze = true, -- Set this to true if you want the ped to be frozen at the given coords (OPTIONAL)
		invincible = true, -- Set this to true if you want the ped to not take any damage from any source (OPTIONAL)
		blockevents = true, -- Set this to true if you don't want the ped to react the to the environment (OPTIONAL)
		animDict = 'abigail_mcs_1_concat-0', -- This is the animation dictionairy to load the animation to play from (OPTIONAL)
		anim = 'csb_abigail_dual-0', -- This is the animation that will play chosen from the animDict, this will loop the whole time the ped is spawned (OPTIONAL)
		flag = 1, -- This is the flag of the animation to play, for all the flags, check the TaskPlayAnim native here https://docs.fivem.net/natives/?_0x5AB552C6 (OPTIONAL)
		scenario = 'WORLD_HUMAN_AA_COFFEE', -- This is the scenario that will play the whole time the ped is spawned, this cannot pair with anim and animDict (OPTIONAL)
		target = { -- This is the target options table, here you can specify all the options to display when targeting the ped (OPTIONAL)
			useModel = false, -- This is the option for which target function to use, when this is set to true it'll use AddTargetModel and add these to al models of the given ped model, if it is false it will only add the options to this specific ped
			options = { -- This is your options table, in this table all the options will be specified for the target to accept
				{ -- This is the first table with options, you can make as many options inside the options table as you want
					num = 1, -- This is the position number of your option in the list of options in the qb-target context menu (OPTIONAL)
					type = "client", -- This specifies the type of event the target has to trigger on click, this can be "client", "server", "command" or "qbcommand", this is OPTIONAL and will only work if the event is also specified
					event = "SickEvidence:openInventory", -- This is the event it will trigger on click, this can be a client event, server event, command or qbcore registered command, NOTICE: Normal command can't have arguments passed through, QBCore registered ones can have arguments passed through
					icon = 'fas fa-door-open', -- This is the icon that will display next to this trigger option
					label = 'Open Locker', -- This is the label of this option which you would be able to click on to trigger everything, this has to be a string
					targeticon = 'fas fa-door-open', -- This is the icon of the target itself, the icon changes to this when it turns blue on this specific option, this is OPTIONAL
					canInteract = function(entity, distance, data) -- This will check if you can interact with it, this won't show up if it returns false, this is OPTIONAL
						return true
					end,
					gang  = 'ballas', -- This is the job, this option won't show up if the player doesn't have this job, this can also be done with multiple jobs and grades, if you want multiple jobs you always need a grade with it: job = {["police"] = 0, ["ambulance"] = 2},
				}
			},
			distance = 2.5, -- This is the distance for you to be at for the target to turn blue, this is in GTA units and has to be a float value
		},
	},
}
```

{% endcode %}

Copy this into your table.. if its an empty table you can use the whole table I provided above.

{% hint style="danger" %}
If you already have peds on the `Config.Peds` then make sure to change the index number to match what you have already!\
\
Also make sure `Config.Target = 'qb-target'` in SickLockers otherwise you will have duplication issues and errors from other systems. <br>
{% endhint %}

{% hint style="info" %}
Adding new peds for lockers is SUPER easy. Simply copy a job table and change the variables to match the new job you have set.&#x20;
{% endhint %}

## Lockers Config

Also when using QB-Target make sure the `Config.locations`also has the job set in there. This is where the script checks and compares the configed job to the Player Job along with Rank.&#x20;

### Example:

{% code title="QBCore/shared/jobs.lua" lineNumbers="true" %}

```lua
    swat = {
        label = 'Bay City SWAT Unit',
        type = 'leo',
        defaultDuty = true,
        offDutyPay = false,
        grades = {
            ['0'] = { name = 'SWAT Corporal', payment = 130 },
            ['1'] = { name = 'SWAT Sergeant', payment = 150 },
            ['2'] = { name = 'SWAT Commander', isboss = true, payment = 185 },
        },
    },
```

{% endcode %}

Above we have created a job for `Swat`in our core. This will now be active and usable in game. Next step will be to add this job to the Lockers Config so that they will work together!

{% code title="Lockers/shared/main.lua" lineNumbers="true" %}

```lua
    {
        UsePed = true,
        coords = vector3(-214.3525, -1365.2156, 30.2748),
        h = 159.3064,
        job = 'swat',
        AllowedRank = 0,
        cop = true,
        TargetLabel = 'Open Swat Lockers',
        ped = 's_m_m_armoured_01'
    },
```

{% endcode %}

Here we have added the `Swat`job into the Lockers Config. From here the script will now function as intended.

<figure><img src="https://567770182-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLtqBlfJzl9GeXJ2SRptE%2Fuploads%2Fw0ENNOTeZrZqgWqDYwHn%2Fimage%20(1).png?alt=media&amp;token=e8510850-7e85-47d3-ac22-2c2c27c5bdbb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://567770182-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLtqBlfJzl9GeXJ2SRptE%2Fuploads%2FbfBDP7PF2Cr9oKPJF8Ow%2Fimage.png?alt=media&amp;token=a7f27294-1783-473a-9a09-658e24e0ee2d" alt=""><figcaption></figcaption></figure>


# SickMoneyWash

&#x20;SickMoneyWash is a simple solution to washing dirty money! A Few Features that will add more to the job and not make it so bland. Amounts washed can not exceed the amount you have on you!

{% hint style="info" %}
Dependencies:

* Ox\_libs
* Ox\_target
* Ox\_inventory
* ESX
  {% endhint %}


# Usage

Each Spot will have a check! You must complete a step before accessing some spots!&#x20;

Target is Disabled until you are done with animations to help prevent spamming&#x20;

Multiple checks for `if amount > money then` to make sure you aren't using an amount more than what you actually have! This also helps preventing players from starting a wash cycle and dropping the money. Server side checks right before payout make sure you actually have the amount in your Pockets. If not it will not continue if you do have the amount it will process the dirty money into clean money while applying a tax or "fee". Checks for money when washing to make sure you have that amount before starting the cycle.&#x20;

When first entering Money wash you will need to make sure to kick on the power to make the target points for the other steps!


# Config

```lua
Config = {}

Config.T1gerKeys = true

Config.LaundryPin = 6669

Config.UseEntrance = true -- set to false if you dont want to use the TP door to money wash

Config.CutItem = 'shear'

Config.WashItem = 'dye' 

Config.PackItem = 'plastic_wrap'

Config.Percentage = 5

Config.Blip = {
    [1] = {
        enabled = false,
	    coords = vector3(244.5052, 374.24737, 105.73813),
        BlipSpirte = 605,
        BlipColor = 4,
        BlipSize = 0.7,
        BlipLabel = "Laundry",
    }
}

Config.tax = {
    Percentage = 0.9,
}

Config.TargetLocs = {
    ["Enter"] = {
        coords = vector3(244.5396, 374.3640, 105.7381),
    },
    ["Exit"] = {
        coords = vector3(1138.0, -3198.96, -39.67),
    },
    ["cuttingZone"] = {
        coords = vector3(1122.2744, -3197.8213, -40.3933),
    },
    ["packageZone"] = {
        coords = vector3(1120.12, -3197.88, -40.92),
    },
    ["washingZone"] = {
        coords = vector3(1122.3478, -3193.7756, -40.3620),
    },
    ["powerBox"] = {
        coords = vector3(1115.3292, -3193.651, -40.99671),
    }
}

Config.MoneyWash = {
	["Enter"] = {
        coords = vector4(244.5396, 374.3640, 105.7381, 337.4070),
    },
	["Exit"] = {
        coords = vector4(1138.0, -3198.96, -39.67, 11.64),
    }
}

Config.Laundry = {
    cuttingZone = {
        coords = vector3(1122.24, -3197.88, -40.4),
        heading = 179.46,
    },
    packageZone = {
        coord = vector3(1120.12, -3197.88, -39.92),
        heading = 180.93,
    },
    washingZone = {
        coord = vector3(1122.32, -3194.6, -40.4),
        heading = 346.76,
	}
}
```


# SickTeleport

SickTeleport system is the FIRST official Project ALPHA | SickScripts Asset. This was created custom for Project ALPHA and given approval to realase for you all to enjoy! This is a system similar to Rust. You can predefine set locations like 'SafeZones' Or 'Food Markets' And players can teleport to them if they are away. There is a section for Donators that can set 'HOME' Locations like bases or other MLOs to teleport to. Each teleport has a timer that doesn't allow teleporting to quickly to prevent abuse.

### Home Locations

Can change the location of the Home but will overwrite already defined one. Can change the Name of the Home but will overwrite already defined name.

### Bonus Feature

If you choose you can use the built in particle effects for donators. Only set donators can get the effects and only set guns will make them actually appear. Each particle can be set in the Config but be warned some particles are either to small or just wont simply show with the way we use them here. This is not a bug.

### Predefined Locations

Some locations have come default in the Config. These can be changed/removed. Each timer is 60 seconds unless redefined in Config.

{% embed url="<https://youtu.be/Rds27h9VU64>" %}


# Installation

### Usable Items

```lua
Config.UsableItems = {
    'location_setter'
}
```

In the Config.lua you can change the items used to teleport to anything you wish. If you are creating a new item I have provided a small template to help you get going. Any item in here will be able to access the menu including `water` if you set that.&#x20;

{% hint style="info" %}
Example item:

```lua
--[[ ( ( -EXAMPLE ITEM FOR OX- ) )

	['location_setter'] = {
		label = 'Teleporter',
		weight = 115,
		description = 'Go Somewhere'
	},

]]
```

{% endhint %}

### SQL

To use and create home locations you need to create the database table. Here will store WHO the home location is for the Set Home Location and the Set Home Name. These variables are all changed by using the script.&#x20;

{% code title="sql.sql" %}

```sql
CREATE TABLE IF NOT EXISTS `sickteleports` (
  `citizenid` varchar(60) NOT NULL,
  `hashome` varchar(5) DEFAULT '0',
  `homelocations` varchar(250) DEFAULT NULL,
  `homeName` tinytext DEFAULT 'Home',
  PRIMARY KEY (`citizenid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;
```

{% endcode %}

In case you ever need a back up one I will leave one here:

```sql
INSERT INTO `sickteleports` (`citizenid`, `hashome`, `homelocations`, `homeName`) VALUES
	('WKI50V48', '1', '{"x":-1063.014404296875,"y":-861.290771484375,"z":4.86802625656127}', 'SickScripts');
```


# Default Locations

In the Config there is a table containing the Default Locations that you can set. These are the locations available when ever the menu is opened by both Donators and Citizens. These can be changed/deleted to fit your server needs.

```lua
Config.DefaultLocations = {
    [1] = {
        label = 'Los Santos',
        coords = {x=64.6316,y=-1336.1709,z=29.3015},
        heading = 266.1323,
    },
    [2] = {
        label = 'Los Santos 2',
        coords = {x=77.5215,y=-1353.1078,z=29.4189},
        heading = 222.8532,
    }
}
```


# Donators

Here you can set CitizenIds that have Donated to your servers or you feel like rewarding players for special activities.  These Ids are used in both the Home Locations AND the Particles System.

```lua
Config.Donators = {
    'WKI50V48',
}
```


# Config

There are a couple new options to use for Particles. This should make it easier for you to add many weapons quicker! You can still of course use the default way of per weapon if you choose to have it on say 1 of 1 weapons!

<figure><img src="https://567770182-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLtqBlfJzl9GeXJ2SRptE%2Fuploads%2FrUcdBx617xHNc64YdTjt%2Fimage.png?alt=media&amp;token=93368bf3-d0ee-4190-839a-5b1945e63675" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Beware you can only use ONE option below.&#x20;

If both are false you will use default WeaponsTable
{% endhint %}

## <mark style="color:red;">Weapon Groups</mark>

With the weapon groups you can group all weapons that have the same class. Meaning all weapons classed as pistol will be able to use the particles. This makes it easier to add many weapons while still limiting some like Rocket Launchers.&#x20;

```lua
Config.WeaponGroups = {
    ['GROUP_RIFLE'] = {
        asset = 'scr_fbi3',
        Particle = "scr_indep_fireworks",
    },
    ['GROUP_PISTOL'] = {
        asset = 'scr_fbi3',
        Particle = "scr_indep_fireworks",
    }
}
```

## <mark style="color:red;">Ammo Types</mark>

With ammo types you can limit this to just certain ammos. These are default GTA Ammos and are mainly based on the weapon group. You can use WeaponGroups to accomplish the same thing basically but is an option if you prefer.&#x20;

```lua
Config.AmmoTypes = {
    ['AMMO_RIFLE'] = {
        asset = 'scr_fbi3',
        Particle = "scr_fbi3_elec_sparks",
    },
}
```

## <mark style="color:red;">Weapon Table</mark>

The Weapons table is where you can set the different weapons you want and the particles you want associated with that weapon. This is the default way the script is used!

```lua
Config.Weapons = { -- only used if config.UseGroupTypes and Config.UseAmmoType is false
    ["WEAPON_PISTOL"] = {
        WeaponItem = "WEAPON_PISTOL",
        asset = 'scr_fbi3',
        Particle = "scr_indep_fireworks",
    },
    ["WEAPON_GLOCK"] = {
        WeaponItem = "WEAPON_GLOCK",
        asset = 'scr_fbi3',
        Particle = "scr_indep_fireworks",
    },
    ["WEAPON_ASSAULTRIFLE"] = {
        WeaponItem = "WEAPON_ASSAULTRIFLE",
        asset = 'scr_indep_fireworks',
        isColored = true,
        Particle = "scr_indep_firework_burst_spawn",
        color = {6, 241, 53} -- color only works on certain particles finding new system for color
    },
}
```


# SickHolograms

<figure><img src="https://567770182-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLtqBlfJzl9GeXJ2SRptE%2Fuploads%2FleEXCoOKx3nguBL4SxTm%2FSickHolograms.png?alt=media&amp;token=f33cf094-3099-469e-9482-dc4061269ce6" alt=""><figcaption></figcaption></figure>

* [SickScripts | Dead Horizon Assets](https://sickscripts-store.tebex.io/category/dead-horizon-assets) -- GET IT HERE!
* [SickScripts | Discord](https://discord.gg/HNgs7ZhkJT) -- FOR SUPPORT! I’m happy to help with custom styles (colors, fonts), map-wide setups, or hooking into your interaction system.


# Config

```lua
Config.ProximityCheckInterval = 500  -- ms when none visible
Config.ScreenUpdateInterval   = 33   -- ms (~30fps) while visible

Config.DefaultColor = { r = 145, g = 255, b = 176 }
Config.DefaultGlow  = 18
Config.DefaultScale = 1.0
Config.DefaultAnim  = "float" -- float | bounce | spin | none

Config.Holograms = {
  {
    id = "safezone_gate", -- id (string, unique)
    coords = vec3(312.42, -1356.88, 32.50), -- coords (vec3)
    radius = 15.0, -- radius (number, meters)
    text = "🛡️ SAFE ZONE — No PvP",  -- text (string; supports emojis + \n)
    color = { r = 120, g = 255, b = 180 }, -- color ({r,g,b}) optional
    glow = 20, -- glow (px) optional
    scale = 1.8, -- scale (1.0 = default) optional
    animation = "float", -- animation (float|bounce|spin|none) optional
  },
}
```

## Trader (With Prompt)

```lua
{
  id = "trader_1",
  coords = vec3(24.75, -1345.67, 29.50),
  radius = 12.0,
  text = "🛒 General Trader\nPress [E] to interact",
  animation = "bounce",
}
```

## Faction Marker (themed)

```lua
{
  id = "faction_rot",
  coords = vec3(1850.45, 3692.31, 34.27),
  radius = 18.0,
  text = "☣️ Children of the Rot\n\"The Flesh Decays, The Soul Ascends.\"",
  color = { r = 180, g = 255, b = 140 },
  glow = 22,
  scale = 1.0,
  animation = "spin",
}
```


# Performance

* Proximity checks throttled when none visible (`Config.ProximityCheckInterval`)
* \~30fps screen updates only while visible (`Config.ScreenUpdateInterval`)
* NUI messages send only deltas (position changes)
* UI unmounts entirely when idle (zero React overhead)

Tested with many holograms active without hitching.

## Troubleshooting

### Nothing appears in-game

* Are you within `radius` of the coords?
* Is `ensure SickHolograms` in `server.cfg` and the UI built?
* Check F8 for NUI errors

### Emojis look odd

* Try Windows emoji or Noto Color Emoji on Linux build hosts.


# FAQ

**Can I make certain signs bigger?**\
\- Yes, set `scale` per hologram (e.g., `1.8`).

**Multi-line and emojis?**\
\- Yes. Use `\n` for new lines. Emojis are native.

**Turn off animation?**\
\- Set `animation = "none"`.

**Framework support?**\
\- Framework-agnostic; client-only.


# SickFines-PEFCL

## Dependencies:

{% hint style="info" %}
Links for Dependencies:

[Ox\_Libs](https://github.com/overextended/ox_lib/releases/tag/v3.1.4)

[Ox\_target](https://github.com/overextended/ox_target/releases/tag/v1.7.2)

[Ox\_inventory](https://github.com/overextended/ox_inventory/releases/tag/v2.27.1)

[PEFCL](https://github.com/project-error/pefcl/releases/tag/v1.0.11)
{% endhint %}

## Items:

<pre class="language-lua"><code class="lang-lua">['ticket'] = {
<strong>    label = 'Ticket',
</strong>    weight = 100,
    stack = false
}
</code></pre>

{% hint style="danger" %}
Make sure to add this to ox\_inventory/data/items.lua

Or change the item in SickFines/server/server.lua
{% endhint %}


# Events

{% hint style="success" %}
Invoices are sent Directly to the Bank
{% endhint %}

Using PEFCL (Project Error Financial) you can send the invoice directly to the bank where you will need to pay it or after the time it will attempt to keep paying it until it is settled!

```lua
Bank:createInvoice(src, {
    to = PlayerName,                        -- {this is PLAYERS name}
    toIdentifier = target.identifier,       -- {the Target Players ID}
    from = OfficerName,                     -- {this is YOUR name}
    fromIdentifier = xPlayer.identifier,    -- {YOUR ID}
    amount = amount,                        -- {Amount sent from Client}
    message = reason,                       --{ Reason Sent from Client}
    receiverAccountIdentifier = xPlayer.identifier {-- if you dont want personal rewards for tickets put this as { Job } and it will send the money to the job not player!}
})
```

{% hint style="success" %}
Tickets are sent to Officer and to an Inventory created to store these!
{% endhint %}

Tickets can be handed over to Player if you choose to do that or kept for records. There is already a Records system built in that will help you keep track of who does what ticket. This helps if you do something like a quota or bonuses for doing more tickets. As long as officer puts their name they will have a good recording.

```lua
local info = {
    amount = amount,
    PlayerName = PlayerName,
    OfficerName = OfficerName,
    date = date
}

if Inventory:CanCarryItem(src, 'ticket', 1) then    -- if officer can carry ticket
    Inventory:AddItem(src, 'ticket', 1, info )      -- add item
else                                                -- else if not can carry
    Inventory:AddItem('police_tickets', 'ticket', 1, info)      -- add item to storage
end

Inventory:AddItem('police_tickets', 'ticket', 1, info)  -- ALWAYS add a copy to storage
```

{% hint style="success" %}
Webhooks are set up for admin to monitor who does what with the tickets. Easier to maintain
{% endhint %}

On Server sided lua there is a part for your WebHook! Server side is also where you can check the invoice to decide if you want pd or the person sending the ticket to get the money. There are notes in there to make sure you understand what is happening there!

```lua
local Discord_url = '' -- server side to protect your webhooks

local function LetEmKnow(message, footer)
    local embed = {
        {
            ["color"] = 3085967,
            ["title"] = "**Sick Ticket System**",
            ["description"] = message,
            ["footer"] = {
                ["text"] = 'New Ticket',
            },
            ["author"] = {
            ["name"] = 'Made by | SickJuggalo666',
            ['icon_url'] = 'https://i.imgur.com/arJnggZ.png'
            }
        }
    }
   PerformHttpRequest(Discord_url, function(err, text, headers) end, 'POST', json.encode({username = "Sick Ticket System", embeds = embed}), { ['Content-Type'] = 'application/json' })
end
```

{% hint style="success" %}
This is where the other copy goes AUTOMATICALLY after creation
{% endhint %}

```lua
Citizen.CreateThread(function()
    for k, v in pairs(Config.Jobs) do
        local tickets = {
            id = v.id,
            label = v.label,
            slots = v.slots,
            maxWeight = v.maxWeight,
            groups = { [v.name] = v.rank }
        }

        Inventory:RegisterStash(tickets.id, tickets.label, tickets.slots, tickets.maxWeight, nil, tickets.groups)
        print(('Creating Inventory for %s, Label: %s, Slots: %s, MaxWeight: %s, Groups: %s'):format(tickets.id,tickets.label,tickets.slots,tickets.maxWeight,tickets.groups))
    end
end)
```

{% tabs %}
{% tab title="Client Notification" %}

```lua
function CNotify(noty_type,message)
    if noty_type and message then
        if Config.Notifications.Client == 'esx' then
            ESX.ShowNotification(message)

        elseif Config.Notifications.Client == 'okok' then
            if noty_type == 1 then
                exports['okokNotify']:Alert('Fines', message, 2500, 'success')
            elseif noty_type == 2 then
                exports['okokNotify']:Alert('Fines', message, 2500, 'info')
            elseif noty_type == 3 then
                exports['okokNotify']:Alert('Fines', message, 2500, 'error')
            end

        elseif Config.Notifications.Client == 'YOUR_NOTIFICATIONS_HERE' then

        end
    end
end
```

{% endtab %}

{% tab title="Server Notification" %}
None Currently!
{% endtab %}
{% endtabs %}


# SickTraders

## Config

```lua
Config.Zones = {
    ['TrillianChemicalContainment'] = {
        label = 'Trillian Chemical Containment',
        blipCoords = vector3(695.58105, 135.68014, 83.877861),
        BlipSpirte = 770,
        BlipColor = 4,
        BlipSize = 0.7,
        BlipLabel = "Trillian Chemical Containment",
        coords = {
            [1]= {
                UsePed = true, -- Do you want to use a ped?
                coords = vector3(695.60876, 133.03575, 79.960525),
                h = 191.94412,
                size = vec3(3, 2, 3), -- size of the box zone
                rotation = 90, -- Rotation of box zone
                TargetLabel = 'Arms Dealer', -- easier to label for each faction
                ped = 's_m_m_armoured_01',
                menu = 'weapons' -- weapons, med, or food
            },
            [2]= {
                UsePed = true, -- Do you want to use a ped?
                coords = vector3(660.3627, 105.0548, 79.7542),
                h = 348.7023,
                size = vec3(3, 2, 3), -- size of the box zone
                rotation = 90, -- Rotation of box zone
                TargetLabel = 'Chef', -- easier to label for each faction
                ped = 'CSB_Chef',
                menu = 'food'
            },
            [3]= {
                UsePed = true, -- Do you want to use a ped?
                coords = vector3(723.7529, 151.4593, 79.7542),
                h = 150.1906,
                size = vec3(3, 2, 3), -- size of the box zone
                rotation = 90, -- Rotation of box zone
                TargetLabel = 'Dr. FeelGood', -- easier to label for each faction
                ped = 'S_M_M_Doctor_01',
                menu = 'med'
            }
        }, 
        Weaponmenu = {
            {
                title = 'Weapon Pistol',
                description = 'A new Pistol To kill the Zombies!',
                icon = 'gun',
                iconColor = 'red',
                args = {
                    weapon = 'WEAPON_PISTOL',
                    price = 5000,
                    ammo = 'ammo-9', -- (or false if not giving ammo)
                    ammoAmount = 50,
                    shop = 'Trillian Chemical Containment',
                },
                onSelect = function(args)
                    TriggerServerEvent('SickTraders:trade', args)
                end,
                metadata = {
                    {label = 'Price', value = '$5000'},
                    {label = 'Ammo', value = 'x50 Rounds'},
                }
            },
        },
        Foodmenu = {
            {
                title = 'Burger',
                description = 'A Juicy Burger',
                icon = 'gun',
                iconColor = 'red',
                args = {
                    food = 'burger',
                    price = 5,
                    amount = 1,
                },
                onSelect = function(args)
                    TriggerServerEvent('SickTraders:tradeFood', args)
                end,
                metadata = {
                    {label = 'Price', value = '$5'},
                }
            },
        },
        Medmenu = {
            {
                title = 'Tylenol',
                description = 'Won\'t do much againt the virus but will kill them pesky back aches',
                icon = 'pill',
                iconColor = 'red',
                args = {
                    med = 'tylenol',
                    price = 500,
                    amount = 1,
                },
                onSelect = function(args)
                    TriggerServerEvent('SickTraders:Medtrade', args)
                end,
                metadata = {
                    {label = 'Price', value = '$500'},
                }
            },
        }
    },
}
```


# Traders

## New Traders

{% hint style="danger" %}
When Adding new traders to the config there is an important step to do before you are ready to use the trader system!
{% endhint %}

```lua
if Zone == 'TrillianChemicalContainment' then -- (When creating new traders in the config make sure 
    local Cfg = Config.Zones[Zone] -- this zone MATHCES the configed zone's name!)
    if menu == 'weapons' then -- weapons, food, med or if you add a custom menu
        lib.registerContext({
            id = 'weapons'..Zone,
            title = Cfg.label,
            options = Cfg.Weaponmenu
        })
        lib.showContext('weapons'..Zone)
    elseif menu == 'food' then
        lib.registerContext({
            id = 'food'..Zone,
            title = Cfg.label,
            options = Cfg.Foodmenu
        })
        lib.showContext('food'..Zone)
    elseif menu == 'med' then
        lib.registerContext({
            id = 'med'..Zone,
            title = Cfg.label,
            options = Cfg.Medmenu
        })
        lib.showContext('med'..Zone)

    --[[elseif menu == 'CUSTOM' then -- Example for adding more make sure menu matches a menu in config otherwise it will not open
        lib.registerContext({
            id = 'CUSTOM'..Zone,
            title = Cfg.label,
            options = Cfg.CUSTOMmenu
        })
        lib.showContext('CUSTOM'..Zone)]]
    end
end
```


# SickFoodStands

## Config

The Config contains everything you will ever need to change or add! The options are endless and adding more food stands is as simple as copy paste and the changing of some items!

Three Different Menus are in use:

1. Civilian menu for browsing while waiting to order!
2. Toppings to either just play an anim like you are adding toppings or there is an option to make it give you the item!
3. Cooking menu is locked behind a job and the only reason ESX is currently needed for this script!

## Civilian Menu

Civilian Menu is used for browsing what the shop has to offer! Make sure if you change shop items to add them here as well! Price is just for visual but should be set to what the shops want them sold for!

```lua
menu = {
    coords = vec3(238.1508, -818.6410, 30.1500), --Civilian menu location
    size = vec3(1,1,1), -- Size for BoxZones
    rotation = 90,-- Rotation for BozZones
    label = 'See the Menu', -- target label
    options = {
        {
            title = 'Hot Dog', -- item label
            description = 'Hot off the grill. \n Price: $5', --change price here just visual
            icon = 'hand', -- item icon
            disabled = true, -- this is so you can't click on it
        },
        {
            title = 'Hamburger',
            description = 'No cheese please. \n Price: $5', --change price here just visual
            icon = 'circle',
            disabled = true,
        },
        {
            title = 'CheeseBurger',
            description = 'Yummm Cheese! \n Price: $5', --change price here just visual
            icon = 'bars',
            disabled = true
        }
    }
},
```

## Toppings Menu

Toppings could just be an animation that playes and you RP adding items to your burgers/hotdogs OR you could add items to give!

```lua
ToppingsMenu = {
    coords = vec3(241.8199, -815.2133, 30.0147), -- Coords for Toppings menu
    size = vec3(1,1,1), -- size of BoxZone
    rotation = 90, -- rotation of BoxZone
    label = 'Get Toppings', -- target label
    options = {
        {
            title = 'Ketchup',
            description = 'Everyone loves Ketchup!',
            icon = 'hand',
            args = {
                item = 'ketchup',
                remove = false
            },
            onSelect = function(args)
                lib.hideContext(false)
                if lib.progressCircle({
                    duration = 5000,
                    position = 'bottom',
                    useWhileDead = false,
                    canCancel = true,
                    disable = {
                        car = true,
                        move = true,
                        combat = true
                    },
                    anim = {
                        dict = 'anim@gangops@facility@servers@bodysearch@',
                        clip = 'player_search'
                    }
                }) 
                then 
                    --TriggerServerEvent('SickFoodStands:GetItem',args, 1)-- you could add an item we just thought it was better as just an animation
                else 
                    print('Do stuff when cancelled') 
                end    
            end,
        },
        {
            title = 'Mustard',
            description = 'Some like it some don\'t!',
            icon = 'circle',
            args = {
                item = 'mustard',
                remove = false
                },
            onSelect = function(args)
                lib.hideContext(false)
                if lib.progressCircle({
                    duration = 5000,
                    position = 'bottom',
                    useWhileDead = false,
                    canCancel = true,
                    disable = {
                        car = true,
                        move = true,
                        combat = true
                    },
                    anim = {
                        dict = 'anim@gangops@facility@servers@bodysearch@',
                        clip = 'player_search'
                    }
                }) 
                then 
                    --TriggerServerEvent('SickFoodStands:GetItem',args, 1)-- you could add an item we just thought it was better as just an animation
                else 
                    print('Do stuff when cancelled') 
                end    
            end,
        },
        {
            title = 'Pickle Relish',
            description = 'What Good is a Glizy with out some Reli?',
            icon = 'bars',
            args = {
                item = 'relish',
                remove = false
            },
            onSelect = function(args)
                lib.hideContext(false)
                if lib.progressCircle({
                    duration = 5000,
                    position = 'bottom',
                    useWhileDead = false,
                    canCancel = true,
                    disable = {
                        car = true,
                        move = true,
                        combat = true
                    },
                    anim = {
                        dict = 'anim@gangops@facility@servers@bodysearch@',
                        clip = 'player_search'
                    }
                }) 
                then 
                    --TriggerServerEvent('SickFoodStands:GetItem',args, 1)-- you could add an item we just thought it was better as just an animation
                else 
                    print('Do stuff when cancelled') 
                end    
            end,
        }
    }
}
```

## Cook Menu

Cooking menu is where the shops will make the items to sell! Make sure you look over the options here as there is alot to it!

```lua
coords = vec3(240.3483, -818.4785, 30.4268), --Coords for Cooking menu
size = vec3(1,1,1),
rotation = 90,
job = 'police', -- What job can use this menu?
label = 'Open Cooking',
options = {
    {
        title = 'Hot Dog',
        description = 'Whip up a Glizy',
        icon = 'hand',
        args = {
        item = 'hotdog', --This is the item added make sure its an actual item
        remove = true,
        item1 = 'water',
        item2 = 'hotdog'
        },
        onSelect = function(args)
        lib.hideContext(false)
            local input = lib.inputDialog('Food Stand', {{type = 'number', label = 'Enter Amount', description = 'How Many do you want?', icon = 'hashtag'}})
            if not input or input[1] == '' then return end
            local count = input[1] -- this is the count sent from the input dialog
            if count > 10 then -- you can change max count here
                lib.notify({
                    title = 'Food Stand',
                    description = 'You can\'t take that many!',
                    type = 'error'
                })
                return
            end
            if lib.progressCircle({
                duration = 5000,
                position = 'bottom',
                useWhileDead = false,
                canCancel = true,
                disable = {
                    car = true,
                    move = true,
                    combat = true
                },
                anim = {
                    dict = 'anim@gangops@facility@servers@bodysearch@',
                    clip = 'player_search'
                }
            }) 
            then 
                local inventory1 = exports.ox_inventory:Search('count', 'hotdog') -- stupid af
                local inventory2 = exports.ox_inventory:Search('count', 'water') -- stupid af
                if inventory1 >= count then 
                    if inventory2 >= count then -- but only way to do it
                        TriggerServerEvent('SickFoodStands:GetItem',args, count)-- args.item = item, count = count of how many
                    else
                        lib.notify({
                            title = 'Food Stand',
                            description = 'You need more Buns',
                            type = 'error'
                        })
                    end
                else
                    lib.notify({
                        title = 'Food Stand',
                        description = 'You need more HotDogs',
                        type = 'error'
                    })
                end
            else 
                print('Do stuff when cancelled') 
            end    
        end,
        metadata = {
            {label = 'Item 1', value = 'Hot Dog Bun'}, --metadata for needed items
            {label = 'Item 2', value = 'Hot Dog'}
        },
    },
    {
        title = 'Hamburger',
        description = 'The staple in any daily diet',
        icon = 'circle',
        args = {
        item = 'burger',
        remove = true,
        item1 = 'meat',
        item2 = 'buns'
        },
        onSelect = function(args)
        lib.hideContext(false)
        local input = lib.inputDialog('Food Stand', {{type = 'number', label = 'Enter Amount', description = 'How Many do you want?', icon = 'hashtag'}})
            if not input or input[1] == ' ' then return end
            local count = input[1]
            if count > 10 then
                lib.notify({
                    title = 'Food Stand',
                    description = 'You can\'t take that many!',
                    type = 'error'
                })
                return
            end
            if lib.progressCircle({
                duration = 5000,
                position = 'bottom',
                useWhileDead = false,
                canCancel = true,
                disable = {
                    car = true,
                    move = true,
                    combat = true
                },
                anim = {
                    dict = 'anim@gangops@facility@servers@bodysearch@',
                    clip = 'player_search'
                }
            }) 
            then 
                local inventory1 = exports.ox_inventory:Search('count', 'meat') -- stupid af
                local inventory2 = exports.ox_inventory:Search('count', 'buns') -- stupid af
                if inventory1 >= count then 
                    if inventory2 >= count then -- but only way to do it
                        TriggerServerEvent('SickFoodStands:GetItem',args, count)-- args.item = item, count = count of how many
                    else
                        lib.notify({
                            title = 'Food Stand',
                            description = 'You need more Meat',
                            type = 'error'
                        })
                    end
                else
                    lib.notify({
                        title = 'Food Stand',
                        description = 'You need more Buns',
                        type = 'error'
                    })
                end
            else 
                print('Do stuff when cancelled') 
            end    
        end,
        metadata = {
            {label = 'Item 1', value = 'Hamburger Bun'},
            {label = 'Item 2', value = 'Meat'}
        },
    },
    {
        title = 'CheeseBurger',
        description = 'Yummm Cheese!',
        icon = 'bars',
        args = {
        item = 'cheeseburger',
        remove = true,
        item1 = 'cheese',
        item2 = 'burger'
        },
        onSelect = function(args)
        lib.hideContext(false)
        local input = lib.inputDialog('Food Stand', {{type = 'number', label = 'Enter Amount', description = 'How Many do you want?', icon = 'hashtag'}})
            if not input or input[1] == '' then return end
            local count = input[1]
            if count > 10 then
                lib.notify({
                    title = 'Food Stand',
                    description = 'You can\'t take that many!',
                    type = 'error'
                })
                return
            end
            if lib.progressCircle({
                duration = 5000,
                position = 'bottom',
                useWhileDead = false,
                canCancel = true,
                disable = {
                    car = true,
                    move = true,
                    combat = true
                },
                anim = {
                    dict = 'anim@gangops@facility@servers@bodysearch@',
                    clip = 'player_search'
                }
            }) 
            then 
                TriggerServerEvent('SickFoodStands:GetItem',args, count)
            else 
                print('Do stuff when cancelled') 
            end    
        end,
        metadata = {
            {label = 'Item 1', value = 'Hamburger Bun'},
            {label = 'Item 2', value = 'Hamburger'},
            {label = 'Item 3', value = 'Cheese'},
        },
    }
},
```


# SickUpNAtom


# General info

## Config

```lua
Config = {}

Config.OrderTimer = 280
Config.ShopAccount = 'money' -- bank, money, black_money
Config.BlipCoords = {
    {
        BlipName = "Up n\' Atom", 
        BlipID = 269, 
        BlipScale = 1.0, 
        x = 85.9631,
        y = 284.8619, 
        z = 110.6538, 
        BlipColor = 49
    },
}

Config.JobPickUp = {
    coords = vector3(2434.5593, 5011.3726, 46.8275),
    blipData = {
        enable = true,
        label = 'Food Pickup',
        sprite = 280,
        display = 4,
        scale = 0.8,
        color = 5,
        route = true
    }
}

Config.Notifications = {
    client = 'ox',
    server = 'ox'
}

Config.Veh = {
    [1] = {
        model = 'rumpo',
        coords = {x = 121.8951, y = 297.4249, z = 109.7900},
        heading = 159.2774
    }
}

Config.Registers = {
    [1] = {
        name = 'register_1',
        coords = vector3(89.7878, 287.7055, 110.2055),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        icon = 'fas-fa-burger',
        label = 'Open Register!',
    }
}

Config.DrinkStation = {
    [1] = {
        name = 'drinkStation_1',
        coords = vector3(93.3012, 286.8039, 110.2094),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        icon = 'fas-fa-burger',
        label = 'Grab a Fresh Drink!',
    }
}

Config.Fries = {
    [1] = {
        name = 'fries_1',
        coords = vector3(92.1997, 292.0820, 110.2094),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        name = 'atom_frier',
        icon = 'fas-fa-burger',
        label = 'Cook Up Some Fries!',
        name2 = 'chicken_frier',
        icon2 = 'fas-fa-burger',
        label2 = 'Make Fried Chicken!',
    }
}

Config.Stoves = {
    [1] = {
        name = 'stove_1',
        coords = vector3(94.6233, 291.7034, 110.2094),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        icon = 'fas-fa-burger',
        label = 'Cook Up Some Food!',
    }
}

Config.Storages = {
    [1] = {
        name = 'fridge',
        coords = vector3(94.5751, 288.7962, 110.2094),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        icon = 'fas-fa-burger',
        label = 'Open Fridge!',
        id = 'atom_fridge',
        label = 'Up n\' Atom Fridge',
        slots = 50,
        weight = 100000,
    },
    [2] = {
        name = 'deep_freeze',
        coords = vector3(89.0101, 292.5507, 110.2095),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        icon = 'fas-fa-burger',
        label = 'Open Freezer!',
        id = 'atom_freezer',
        label = 'Up n\' Atom Freezer',
        slots = 50,
        weight = 100000,
    },
    [3] = {
        name = 'foodWarmer_1',
        coords = vector3(91.1882, 288.3933, 110.2094),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        icon = 'fas-fa-burger',
        label = 'Open Warmer!',
        id = 'atom_warmer',
        label = 'Up n\' Atom Warmer',
        slots = 15,
        weight = 50000,
    }
}

Config.BossMenu = {
    [1] = {
        job = 'upnatom', -- this job not only allows access to BossMenu but is the job read by script
        rank = 2,
        coords = vector3(81.5861, 296.2689, 110.2495),
        size = vec3(1, 2, 3),
        rotation = 30,
        debug = false,
        name = 'atom_boss_menu',
        icon = 'fas-fa-burger',
        label = 'Open Boss Menu!',
        name2 = 'atom_order_menu',
        icon2 = 'fas-fa-burger',
        label2 = 'Place An Order',
    }
}

Config.Menu = {
    [1] = {
        item = 'cooked_burger',
        title = 'Cooked Burger',
        description = 'Make a fresh meat patty',
        icon = 'circle',
        itemNeeded = 'meat',
        items = { 
            {
                item = 'meat', 
                amount = 1 
            }
        }
    },
    [2] = {
        item = 'footlong_chiliDog',
        title = 'HotDog',
        description = 'Make a Hot Dog',
        icon = 'circle',
        items = {            
            {
                item = 'hotdog', 
                amount = 1 
            }
        }
    },
    [3] = {
        item = 'fried_egg',
        title = 'Fried Egg',
        description = 'Make a Fried Egg',
        icon = 'circle',
        items = {            
            {
                item = 'egg', 
                amount = 1 
            }
        }
    },
    [4] = {
        item = 'pancakes',
        title = 'Pancakes',
        description = 'Make Some Buttery Pancakes',
        icon = 'circle',
        items = {            
            {
                item = 'pancakes', 
                amount = 1 
            }
        }
    },
    [5] = {
        item = 'eggs_benidict',
        title = 'Eggs Benidict',
        description = 'Make Eggs Benidict',
        icon = 'circle',
        items = {            
            {
                item = 'eggs', 
                amount = 1 
            }
        }
    }
}

Config.Shop = {
    [1] = {
        item = 'meat',
        title = 'Uncooked Meat',
        description = 'Get Uncooked Meat',
        icon = 'circle',
        price = 10
    },
    [2] = {
        item = 'hotdog',
        title = 'HotDogs',
        description = 'Get Fresh HotDogs From the Farm!',
        icon = 'circle',
        price = 10
    },
    [3] = {
        item = 'eggs',
        title = 'Fresh Eggs',
        description = 'Nothing Fresher than these!',
        icon = 'egg',
        price = 10
    },
    [4] = {
        item = 'bacon',
        title = 'Uncooked Bacon',
        description = 'Mmmm that smell!',
        icon = 'circle',
        price = 10
    }
}
```

## Inventories

{% hint style="info" %}
Inventories are automatically built first time the script is started. The Script will print if it is creating the inventories then each time script is started it checks those inventories and if they already exist does nothing!
{% endhint %}


# Ordering

Every restruant needs to fill its own inventories to make sure they have the food to provide to customers. UpNAtom comes with 2 options for this!&#x20;

1. Simple ordering like Buns, Cheese, Pancake Mix, Soda Bibs and more can be checked off in a menu. After a configed amount of time the items are 'Delivered' and deposited into the Freezer.
2. Items like meats, eggs, bacon and more will need to be picked up from a location set in the config. A van is provided that you will need to hang on to!&#x20;

When Buying products from the Farmers Market it will check you have the van and load the items into the truck. When you are done return to the store and go to the spot configed. From here the items will be removed from the trunk and added to the fridge.

{% hint style="danger" %}
If for some reason you lose the vehicle or it is destroyed the shipment will not be completed and will have to wait for a restart to try again. Plate is set by script and that SPECIFIC plate is checked for items and such. No Vehicle means No Order!
{% endhint %}


# Job Info

UpNAtom comes with lots of things to it. Ranging from Drink stations to Friers.

## Job Options

1. Grill to make eggs, pancakes, burgers and more.
2. Frier for Fried Chicken, Fries, Fried Deserts and more.
3. Fridge/Freezer for storing food.
4. Drink Stations with Small, Medium, and Large Sizes.
5. Registers
6. Cleaning
7. Boss Menu

## Drink Station

The Drink station is ran of a Bib system similar to real resturaunts. Each time the drink is used a portion or the supply is removed. Once it is depleted you will no longer be able to sell that type until you refill the supply!

```json
{
    "id": 1,
    "description": "Crispppp",
    "progress": 96,
    "item": "sprite",
    "title": "Sprite",
    "type": "small",
    "icon": "fas-fa-circle"
},
```

{% hint style="danger" %}
Drinks are ran of a JSON to save the progress and to safe on DataBase Calls! Examples are there to help you on making sure you add/remove items correctly!
{% endhint %}

## Registers

Registers are also ran of a JSON file to help make sure that each register is independent when it comes to paying

```json
[
    {
        "currentAmount": 0,
        "name": "register_1"
    },
    {
        "currentAmount": 0,
        "name": "register_2"
    },
    {
        "currentAmount": 0,
        "name": "register_3"
    }
]
```

Accepted Payment Types:

1. Cash
2. Bank

## Friers

The Friers are there to help you make fried chicken for sandwiches and fries for sides. Some Fried Deserts will be included!

## Stove

The Stove will assist in making fresh eggs, cooked burgers, crispy hash browns and buttery pancakes! Each needs an item set in config and has a small skill check after the progress bar, this is to show you actually made it and if you fail the check you will have 'burnt' the item and will have lost it!&#x20;

## Storages

There are 3 pre set storages for the resturaunt to store uncooked meats and buns or fresh cooked meals ready for sale!

{% hint style="info" %}

1. Freezer for Meats and other items
2. Fridge for cheeses, buns, lettuce and more
3. Warmer to place fresh cooked meals in so that the service people can sell the food!
   {% endhint %}

## Cleaning

\*\*Coming Soon\*\*


# Boss Menu

One of the most important steps is the boss men. In order for this to work I made an edit to esx\_society! Super easy to do and a small walk through will be provided!

## ESX\_SOCIETY

Here I will show the small edits to esx\_society that will make you able to use this portion. This also makes it easier for you to use in other scripts instead of base events!

In esx\_society client.lua Search for:

```lua
AddEventHandler('esx_society:openBossMenu', function(society, close, options)
	OpenBossMenu(society, close, options)
end)
```

Above or Below this handler add this snippet of code:

```lua
exports('openBossMenu',function(society, close, options)
	OpenBossMenu(society, close, options)
end)
```

From here you can now use this export in any script Example usage:

```lua
exports.esx_society:openBossMenu(JOB, BOOLEAN, options)
```

```lua
exports.esx_society:openBossMenu(job, true, {
    withdraw = true, 
    deposit = true, 
    wash = false, 
    employees = true, 
    grades = true
})
```


# SickJail

{% embed url="<https://www.youtube.com/embed/razYYRyOq1s>" %}
(Video is VERY outdated and from the start of this project. Just an EXAMPLE of whats to come!)
{% endembed %}

**Welcome to SickJail. SickJail is a VERY interactive jail system for your Cities!**

**There are lots of different things you are able to do with it.**

**Ranging from Gang system to legal jobs.**

**There is a ton of options built in to the jail to give your players more to do while they do hefty sentences!**

## SQL:

There are a few things you will need to do before using the script!

{% hint style="info" %}
Make sure you do this before starting the script! This stores the info you will need while Jail is running
{% endhint %}

```sql
CREATE TABLE IF NOT EXISTS `sickPrisonGangs` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `identifier` varchar(60) DEFAULT NULL,
    `gang` varchar(250) DEFAULT NULL,
    `reputation` smallint(6) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=304 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

ALTER TABLE users ADD COLUMN 'jail' int(15) NOT NULL DEFAULT 0;
```

## Items:

Add all items to Ox\_Inventory/data/items.lua

{% code lineNumbers="true" %}

```lua
Items = {
    
	['prison_meal'] = {
		label = 'Prison Meal',
		weight = 150,
		stack = true,
		close = true,
		description = 'Yummm prison food'
	},

    ['ingredients'] = {
		label = 'Ingredients',
		weight = 150,
		stack = true,
		close = true,
		description = 'Idk you figure it out'
	},

    ['marlborocig'] = {
		label = 'Marlboro Cig',
		weight = 150,
		stack = true,
		close = true,
		description = 'Mmmm the burn in your lungs!'
	},

    ['mud'] = {
		label = 'Mud',
		weight = 150,
		stack = true,
		close = true,
		description = 'A NASTY susbstance'
	},

    ['hooch'] = {
		label = 'Hooch',
		weight = 150,
		stack = true,
		close = true,
		description = 'Still Nasty but better'
	},

    ['rotten_oranges'] = {
		label = 'Rotten Oranges',
		weight = 150,
		stack = true,
		close = true,
		description = 'These were left out a little long'
	},

    ['drugbag'] = {
		label = 'Drug Bag',
		weight = 150,
		stack = true,
		close = true,
		description = 'The Ole Prison Wallet'
	},

	['plastic'] = {
		label = 'Plastic Pieces',
		weight = 150,
		stack = true,
		close = true,
		description = 'I\'m sure you can find a use'
	},

	['wood'] = {
		label = 'Drug Bag',
		weight = 150,
		stack = true,
		close = true,
		description = 'Setting fires, making shanks'
	},
	
	['shovel'] = {
		label = 'Shovel',
		weight = 150,
		stack = true,
		close = true,
		description = 'Digging you know'
	},

	['cup_of_noodles'] = {
		label = 'Cup Of Noodles',
		weight = 150,
		stack = true,
		close = true,
		description = 'Yummmm the Best Ever'
	},
}
```

{% endcode %}

{% tabs %}
{% tab title="Legal Jobs" %}
There is a range of legal jobs you are able to do for money or items that can be used to obtain items not so easily gotten in prison! Adds more to the feel of being in prison but actually being a model inmate!

1. Cook (Kitchen Position where you cook meals and turn them in for Money or Items)&#x20;
2. Electrician (Fix the boxes around the yard to earn Money)&#x20;
3. Infirmary (Some Crazy inmate made a mess, it sucks but clean it up for a Reward!)&#x20;
4. Trash (Check Barrels and run trash bags and get money and maybe a random item hidden!)&#x20;
5. Toilets (Clean the toilets in the unit these people are messy!
   {% endtab %}

{% tab title="Gang Jobs" %}
Gang jobs will be choosen randomly. Some are easy some are more difficult! Do more work for the Gangs and find your self rewarded with more options and better items!

1. Hooch (Grab the stuff needed to mix and head to the cell and whip up a batch, the Gangs will love this!)&#x20;
2. Shiv (Someone hid a Shiv on the yard, find it and there is a nice reward!)&#x20;
3. Snitches (We all know what snitches get, so go handle it!)
4. Bunks (Everyone out a yard so search the bunks there was talk of a shipment coming in)
   {% endtab %}
   {% endtabs %}

## Other Info:

{% hint style="danger" %}
Inventory: \
\
Inventory is automatically taken when entering Prison and returned to player upon release! This makes entering and exiting prison that much smoother for server owners and players!
{% endhint %}

{% hint style="danger" %}
Target:&#x20;

\
Every thing is ran off Ox\_Target. All Jobs, tasks, peds and even Jail Menu! Global Player option for police to open the menu from the closest player! All Targets have an InJail Check that will not let you interact unlesss you are in jail!
{% endhint %}


# Events/Exports

## Jail Check Exports

{% tabs %}
{% tab title="In Jail" %}
Used To Check if Currently in Jail

```lua
local inJail = exports['SickJail']:GetJailTime() 
if inJail then 
    print('You are in jail') 
else 
    print('Yay you are NOT in Jail!') 
end
```

{% endtab %}

{% tab title="Send  Back To Jail" %}
Used To Send Player Back to jail if in jail

```lua
local inJail = exports['SickJail']:GetJailTime() 
if inJail then 
    exports['SickJail']:DeathJailLogin() 
else 
    print('Don't send to jail') 
end
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
All Exports are **Client Side** only!
{% endhint %}

## Send To Jail Export/Event

### <mark style="color:red;">Export</mark>

{% code title="Send To Jail Export" %}

```lua
exports('SendPlayerToJail',SendPlayerToJail)
```

{% endcode %}

Example Usage

```lua
local player = GetPlayerServerId(CLOSEST_PLAYER)
local time = 5 -- Amount of time for jail
local reason = String -- optional (Defaults to 'MDT Sentence') Mainly for webhooks
exports.SickJail:SendPlayerToJail(player,time,reason or nil)
```

Good for usage in MDTs and other scripts!&#x20;

### <mark style="color:red;">Event</mark>

The Event Usage isn't as recommended but can be used as well. Its the same usage for Client side as the export (Meaning it accepts the same Arguments) but triggers the Server event instead of the Export.&#x20;

{% tabs %}
{% tab title="Client" %}

```lua
TriggerServerEvent("SickJail:jailPlayer", player, jailTime, reason)
```

Example Usage

```lua
local player = GetPlayerServerId(CLOSEST_PLAYER)
local time = 5 -- Amount of time for jail
local reason = String -- optional (Defaults to 'MDT Sentence') Mainly for webhooks
TriggerServerEvent("SickJail:jailPlayer", player, jailTime, reason)
```

{% endtab %}
{% endtabs %}


# Examples

{% tabs %}
{% tab title="ESX Ambulance Job" %}

```lua
CreateThread(function()
    local text, timeHeld\n
    while earlySpawnTimer > 0 and isDead do
        Wait(0)
        text = _U('respawn_available_in', secondsToClock(earlySpawnTimer))\n
        DrawGenericTextThisFrame()
        BeginTextCommandDisplayText('STRING')
        AddTextComponentSubstringPlayerName(text)
        EndTextCommandDisplayText(0.5, 0.8)
    end\n
    while bleedoutTimer > 0 and isDead do
    Wait(0)
    text = _U('respawn_bleedout_in', secondsToClock(bleedoutTimer))
    if not Config.EarlyRespawnFine then
        text = text .. _U('respawn_bleedout_prompt')
        if IsControlPressed(0, 38) and timeHeld > 120 then
        
            local inJail = exports['SickJail']:GetJailTime()
            if inJail then
                exports['SickJail']:DeathJailLogin()
                break
            else
                RemoveItemsAfterRPDeath()
                break
            end
        end
    elseif Config.EarlyRespawnFine and canPayFine then
        text = text .. _U('respawn_bleedout_fine', ESX.Math.GroupDigits(Config.EarlyRespawnFineAmount))
        if IsControlPressed(0, 38) and timeHeld > 120 then
            local inJail = exports['SickJail']:GetJailTime()
            if inJail then
                exports['SickJail']:DeathJailLogin()
                break
            else
                TriggerServerEvent('esx_ambulancejob:payFine')
                RemoveItemsAfterRPDeath()
                break
            end
        end
    end
    if IsControlPressed(0, 38) then
        timeHeld += 1
    else
        timeHeld = 0
    end
    DrawGenericTextThisFrame()
    BeginTextCommandDisplayText('STRING')
    AddTextComponentSubstringPlayerName(text)
    EndTextCommandDisplayText(0.5, 0.8)
    if bleedoutTimer < 1 and isDead then
        RemoveItemsAfterRPDeath()
    end
end)
```

{% endtab %}

{% tab title="Wasabi Ambulance" %}

```lua
CreateThread(function()
    local text, timeHeld
    while earlySpawnTimer > 0 and isDead do
        Wait()
        text = (Strings.respawn_available_in):format(secondsToClock(earlySpawnTimer))
        DrawGenericTextThisFrame()
        SetTextEntry('STRING')
        AddTextComponentString(text)
        DrawText(0.5, 0.8)
    end
    while bleedoutTimer > 0 and isDead do
        Citizen.Wait()
        text = (Strings.respawn_bleedout_in):format(secondsToClock(bleedoutTimer)) .. Strings.respawn_bleedout_prompt
        if IsControlPressed(0, 38) and timeHeld > 60 then
            local inJail = exports['SickJail']:GetJailTime()
            if inJail then
                exports['SickJail']:DeathJailLogin()
                break
            else
                StartRPDeath()
                break
            end
        end
        if IsControlPressed(0, 38) then
            timeHeld = timeHeld + 1
        else
            timeHeld = 0
        end
        DrawGenericTextThisFrame()
        SetTextEntry('STRING')
        AddTextComponentString(text)
        DrawText(0.5, 0.8)
    end
    if bleedoutTimer < 1 and isDead then
        local JailTime = exports['SickJail']:GetJailTime()
        if JailTime then		
            exports['SickJail']:JailLogin()
        else
            StartRPDeath()
        end
    end
end)
```

{% endtab %}
{% endtabs %}

## Built In Medic System:

{% tabs %}
{% tab title="GetHelp Function ESX Abmulance Job" %}

```lua
function GetHelp()       
    TriggerEvent("esx_ambulancejob:revive") -- put any healing triggers here!
end 
```

{% endtab %}

{% tab title="GetHelp Function Wasabi Abmulance Job" %}

<pre class="language-lua"><code class="lang-lua"><strong> function GetHelp()  
</strong><strong>   TriggerServerEvent('SickJail:dkajsod', GetPlayerServerId(PlayerId()))
</strong>    Citizen.Wait(1000)
end  
</code></pre>

```lua
RegisterServerEvent('SickJail:dkajsod')
AddEventHandler('SickJail:dkajsod', function(id)
    exports.wasabi_ambulance:RevivePlayer(id)
end)
```

{% endtab %}
{% endtabs %}

## Send To Jail

Example of sending players to jail and what is needed!

```lua
local input = lib.inputDialog('Jail Menu', {'Player', 'Time', 'Reason'})  -- Lib Input

if not input then -- if no input then close
    lib.hideContext(false)
    return 
end
local player = tonumber(input[1]) -- Players Server ID (E.X. = 1)
local jailTime = tonumber(input[2]) -- The amount of jail time for the player
local reason = input[3] -- What is the reason/charges for sending to jail
if jailTime <= 0 then -- checks you dont try to put less than zero in the time
    lib.notify({
        title = 'Jail',
        description = 'Jail needs to be Greater than 0 Months!',
        type = 'error'
    })
    return
end
TriggerServerEvent("sickJail:jailPlayer", player, jailTime, reason) -- Server Event for jailing players!
```

{% hint style="info" %}

<pre class="language-lua"><code class="lang-lua"><strong>TriggerServerEvent("sickJail:jailPlayer",player,jailTime,reason) 
</strong><strong>-- Server Event for jailing players!
</strong></code></pre>

{% endhint %}

```
(player) is the players ID you are sending
(jailTime) is the amouunt of time to send the player
(reason) is the reason for being sent. This can be anything and is mainly for Webhooks
```


# Jobs

There are a few different jobs you can do and as I further the script I will be adding more jobs into the script to allow players more things to do while in prison and also help them access other parts of the Prison! Jobs will pay out money or Cigarettes. Money can be used to buy items from the kitchen Commissary! Cigarettes are used to trade gangs for illegal items. Each job has a set amount of tasks you must complete before you are able to turn in and get your reward.

{% hint style="info" %}
More Jobs Will be added in the Future!
{% endhint %}

{% hint style="info" %}
Future Features:

1. Crafting&#x20;
2. Plate Making Job&#x20;
3. Drug Mixing&#x20;
4. Drug Baking
   {% endhint %}

## Legal Jobs

Legal Prison Jobs will always reward you with money. This is able to be set in Config to give items as well or just the money!

{% tabs %}
{% tab title="Electrician" %}
Electric boxes around the yard have been tampered with and are now malfunctioning. Go find the boxes and repair them!

Each Electric box can only be fixed once this avoids spamming or just standing at one box getting all of your tasks done! Target will also be disabled and reenabled after the progbar!
{% endtab %}

{% tab title="Toilets" %}
Everyones favorite job! Scrubbing the cell blocks toilets! Someone has got to do it so why not you? You get paid for this Too!
{% endtab %}

{% tab title="Cook" %}
Make different prison meals to turn in for pay! You will need supplies gathered from inside the kitchen and use the grill there to cook up the food you choose! The meals are turned in when you go to get paid!
{% endtab %}

{% tab title="Infirmary" %}
Someone left a huge mess in the infirmary. Your job is to go clean up the mess to earn your pay! Each mess can only be cleaned once and target will not be active during cleaning!
{% endtab %}

{% tab title="Trash" %}
There is a guy on the yard who will give you a job to collect trash bags from around the yard! Every trash can only be searched once and target is disabled while doing animation. No Spamming or Exploiting here!
{% endtab %}
{% endtabs %}

## Illegal Jobs

Gangs Only accept one item as trade and payouts: `Cigarettes`

{% tabs %}
{% tab title="Hooch" %}
If you don't know what this is it is Prison Alcohol. Strong stuff too. You need to get the supplies and head to the cell and mix up a batch for the Gangs!
{% endtab %}

{% tab title="Snitch" %}
A bus just rolled in and someone that snitched on the gang has landed on the yard. Take them out to be paid!
{% endtab %}

{% tab title="Cells" %}
Searching cells will reward you with hidden items! Good way to find Drugs while in prison!
{% endtab %}

{% tab title="Shiv" %}
A Shiv is a sharp object used to shank(stab) people in prison. Someone slipped up and told the gangs of their hidding spots. Go Search the spot and retrieve the Shiv!
{% endtab %}
{% endtabs %}

## Gangs

There are Three Main Gangs

1. Ballas
2. Families
3. Vagos

Each Gang Has its own Gang Shop all set in config! The gangs only trade for cigarettes also setable in the Config! Each Item Has a Gang Rep Amount that you need in order to get certain Items!

{% hint style="danger" %}
You Can only Join **ONE** Gang at a time and its set for life!
{% endhint %}


# Drug Bag

Drug Bag is a useful item for while you are in prison and trying to smuggle stuff out! You Can not only open and fill your Drug Bags your are also able to toss them over the fence and use Target to open and destroy the bag! Has minimal slots and minimal weight to prevent lots of items in the drug bags or items that dont seem to "fit"!

```lua
local DrugBag = {
    id = 'drug_bag: '..name,          
    invLabel = "Drug Baggie",                 
    invWeight = 500.0,                            
    invSlots = 5,                 
}
Inventory:RegisterStash(DrugBag.id, DrugBag.invLabel, DrugBag.invSlots, DrugBag.invWeight, false)
```

These will be available from the Gangs! Probably on a higher Rep Level too


# Prison Break

Built into SickJail is a prison break system. You will need a Configed Item in order to play one of the Configed Mini games before you are tped out of the prison to a random location!

Working on more to the break out!

```lua
{
    Codesign Keymaster: ['cd_keymaster'], 
    mHacking: ['mHacking'], -- support for these will be limited
    Modfreaks lockpick v1: ['lockpick'], -- support for these will be limited
    ModFreaks Lockpick v2: ['lockpickV2'] -- support for these will be limited
}
```

{% hint style="warning" %}
Will Add more as we come across more or if you have ideas let me know!
{% endhint %}

## Notifications

Built in Police notifications with Codesign Dispatch support out of box!

Built in Webhooks also allow your police/server owners keep track of who has been sent for how long!

```lua
local Discord_url = '' -- Put Discord URL Here!
SendToDiscord = function(color, name, message, footer)
    local embed = {
          {
              ["color"] = 3085967,
              ["title"] = "**".. name .."**",
              ["description"] = message,
              ["footer"] = {
                  ["text"] = 'Made by | SickJuggalo666',
              },
              ["author"] = {
                ["name"] = 'Jail Warden',
                ['icon_url'] = 'https://i.imgur.com/arJnggZ.png'
              }
          }
      }
  
    PerformHttpRequest(Discord_url, function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embed}), { ['Content-Type'] = 'application/json' })
end
```

```lua
function PrisonEscape()
    local data = exports['cd_dispatch']:GetPlayerInfo()
    TriggerServerEvent('cd_dispatch:AddNotification', {
        job_table = {'police', }, 
        coords = data.coords,
        title = '10-99 - Prison Break',
        message = 'A '..data.sex..' Was reported by Warden to be unaccounted for!', 
        flash = 1,
        unique_id = data.unique_id,
        sound = 1,
        blip = {
            sprite = 431, 
            scale = 1.2, 
            colour = 3,
            flashes = true, 
            text = '911 - Prison Break',
            time = 5,
            radius = 0,
        }
    })
    --TriggerServerEvent('sickJail:PoliceNotifySV') -- server side police notify
end
```


# Stashes

Inside the Prison are **THREE** Hidden stashes. These stashes can be used to store items for later Prison Sentences!

{% hint style="danger" %}
Be Careful as other inmates can find these stashes and possibly take your items! The Risk of being in prison!
{% endhint %}

```lua
local stash1 = {
    id = 'jailStash1',        
    invLabel = "Jail Stash",                 
    invWeight = 1000.0,                            
    invSlots = 10                    
}
Inventory:RegisterStash(stash1.id, stash1.invLabel, stash1.invSlots, stash1.invWeight, nil, false)

local stash2 = {
    id = 'jailStash2',        
    invLabel = "Jail Stash",                 
    invWeight = 1000.0,                            
    invSlots = 10                    
}
Inventory:RegisterStash(stash2.id, stash2.invLabel, stash2.invSlots, stash2.invWeight, nil, false)

local stash3 = {
    id = 'jailStash3',        
    invLabel = "Jail Stash",                 
    invWeight = 1000.0,                            
    invSlots = 10                    
}
Inventory:RegisterStash(stash3.id, stash3.invLabel, stash3.invSlots, stash3.invWeight, nil, false)
```


# SickReports

Welcome to SickReports. A Simple System for Admins and players to use to help keep track of bugs/players and other general info. Everything is saved in a JSON file For Easier access instead of Database queries saves and deletes. Currently Delete sets the report inactive in the JSON file which will prevent it from being in the menu but will need to be removed manually until I sort that out better!

## Config

```lua
Config = {}

Config.wasabi_ambulance = true -- if false put your event below. uses Player.source for WHO to revive

Config.ReviveEvent = 'esx_ambulancejob:revive' -- only if not using wasabi_ambulance!

Config.Notifications = {
    client = 'ox',
    server = 'ox'
}

Config.CommandInfo = {

    ['open'] = {

        command = 'openReport',

    },

    ['adminOpen'] = {

        command = 'adminReports'

    }
    
}

Config.AllowedGroups = {

    ["admin"] = true,
    -- add more if you wish to add other groups
    -- ["mod"] = true
}
```

{% hint style="info" %}
Dependencies:

\~ Ox\_libs\
\~ ESX For Admin Groups
{% endhint %}


# Options

## Admins

Using the Configed Command Admins can open a menu to see active reports and to interact with the report/player.

Some Examples Below:

{% hint style="info" %}
\~ Bring the Player from the report to the Admin\
\~ Teleport to the scene if needed\
\~ Revive a player from the menu during a sit\
\~ Delete/Set Inactive a Report
{% endhint %}

Admins Will Receive a message stating there is a new report available and what the command is to open the reports!


# SickSafeZones

SickSafeZones is a script that allows Server owners to use this to prevent players from using weapons in 'Green Zones' or 'Safe Zones'. Lots to the script so lets get started:

{% hint style="info" %}
Dependencies:

* Ox\_Libs
* Ox\_Inventory
* ESX or QBCore
* Ox\_Target
* xSound

{% endhint %}


# Info

The Config is pretty simple and easy to use!

{% code lineNumbers="true" %}

```lua
Config = {}
Config.ESX = true -- this is LEGIT ONLY for the airdrop usable item. I could have made it a command but having the item i feel is better. If not i can change!
Config.Notifications = 'ox' -- ox or custom (Change in both Server/Client Utils.lua)
Config.UseZoneMusic = true
-- ### SAFE ZONE INFO

Config.Zones = {
    [1] = {
        name = 'The Lawless Coalition',
        points = {
            vec(741.7549, 169.6226, 85.3060),
            vec(742.7230, 168.8449, 85.3060),
            vec(742.7230, 168.8449, 85.3060),
            vec(753.2601, 157.8367, 85.3060),
            vec(758.5970, 140.8634, 85.3060),
            vec(752.3124, 128.2491, 85.3060),
            vec(730.3325, 96.1845, 85.3060),
            vec(706.8033, 64.4220, 85.3060),
            vec(639.3295, 92.4176, 85.3060),
            vec(677.2900, 196.5964, 85.3060),
        },
        thickness = 10,
        debug = true,
    },
    --[[[2] = {
        name = 'The Lawless Coalition',
        points = {
            vec(1734.9298, 3758.7937, 33.00),
            vec(1688.0013, 3731.7791, 33.00),
            vec(1663.1671, 3774.9126, 33.00),
            vec(1705.8721, 3804.2649, 33.00)
        },
        thickness = 10,
        debug = true,
    }]]
}

Config.MusicInfo = {
    [1] ={
        name = 'safezone1',
        link = 'https://www.youtube.com/watch?v=YUoHI2gDf7k',
        volume = 0.4,
        coords = vector3(696.2985, 130.9088, 83.8779),
        distance = 75
    },
    --[[[2] ={
        name = 'safezone2',
        link = 'https://www.youtube.com/watch?v=d_uqlELD4qw',
        volume = 0.3,
        coords = vector3(1699.2564, 3771.0712, 34.524211),
        distance = 37
    },]]
}

Config.BlackList = {
    [1] = {
        name = 'WEAPON_MINISMG'
    },
    [2] = {
        name = 'WEAPON_ASSAULTRIFLE'
    },
    [3] = {
        name = 'WEAPON_APPISTOL'
    },
    [4] = {
        name = 'WEAPON_PISTOL'
    }
}


-- ### AIR DROP INFO
Config.LootTables = {
    [1] = {
        items = { -- Item you get list | Types: 'item', 'weapon', 'account'
            { 'water', 5 },
            { 'bread', 10 },
        }
    },
    [2] = {
        items = {
            { 'WEAPON_PISTOL', 1 },
            { 'WEAPON_APPISTOL', 2 },
            { 'money', 5000 },
        }
    },
    [3] = {
        items = {
            { 'WEAPON_PISTOL', 1 },
        }
    },
    [4] = {
        items = {
            { 'money', 5000 },
        }
    },
    [5] = {
        items = {
            { 'WEAPON_PISTOL', 1 },
        }
    },
}

Config.Airdrops = {
    itemNeeded = 'airdrop_flare',
    FallSpeed = 10, -- Try modifying this to see how fast You want the Airdrop to go down | Lowering number, means slowing down airdrop fall speed | Default: 1
    DeletePrevious = true, -- Deletes Previous Airdrop if new is spawned
    UseFlareParticles = true,
}

-- ### SCRAP CAR LOOT INFO

Config.Cars = {
    [1] = {
        hash = `prop_rub_carwreck_9`,
        lootTable = 'prop_rub_carwreck_9',
        name = 'car',
        icon = 'fa-solid fa-capsule',
        label = 'Search',
        items = 'lockpick', -- or items = {lockpick = 1, hacing_device = 1} if they have one it will work
    }
}

Config.CarLoot = {
    ['prop_rub_carwreck_9'] = {
        items = { -- Item you get list | Types: 'item', 'weapon', 'account'
            { 'water', 5 },
            { 'bread', 10 },
        }
    }
}
```

{% endcode %}


# Music

Setting up music for your zones is as easy as setting the Config option to `true`

```lua
Config.UseZoneMusic = true
```

Next Find a dope link from YouTube that you would like playing while in the Zones

{% code lineNumbers="true" %}

```lua
Config.MusicInfo = {
    [1] ={
        name = 'safezone1',
        link = 'https://www.youtube.com/watch?v=YUoHI2gDf7k',
        volume = 0.4,
        coords = vector3(696.2985, 130.9088, 83.8779),
        distance = 75
    },
    --[[[2] ={
        name = 'safezone2',
        link = 'https://www.youtube.com/watch?v=d_uqlELD4qw',
        volume = 0.3,
        coords = vector3(1699.2564, 3771.0712, 34.524211),
        distance = 37
    },]]
}
```

{% endcode %}

Add more zones by just copying the table and changing variables.&#x20;


# AirDrops

A Part of the SafeZones is that with an item you are able to call in AirDrops. Each AirDrop has different LootTables. The Script will pick a random table to allow you to get items from. All Set in Config!

{% code title="AirDrop Options:" lineNumbers="true" %}

```lua
Config.Airdrops = {
    itemNeeded = 'airdrop_flare', -- item needed for AirDrop
    FallSpeed = 10, -- Try modifying this to see how fast You want the Airdrop to go down | Lowering number, means slowing down airdrop fall speed | Default: 10
    DeletePrevious = true, -- Deletes Previous Airdrop if new is spawned
    UseFlareParticles = true,
}
```

{% endcode %}

{% code title="LootTable Info:" lineNumbers="true" %}

```lua
Config.LootTables = {
    [1] = {
        items = { -- Item you get list | Types: 'item', 'weapon', 'account'
            { 'water', 5 },
            { 'bread', 10 },
        }
    },
    [2] = {
        items = {
            { 'WEAPON_PISTOL', 1 },
            { 'WEAPON_APPISTOL', 2 },
            { 'money', 5000 },
        }
    },
    [3] = {
        items = {
            { 'WEAPON_PISTOL', 1 },
        }
    },
    [4] = {
        items = {
            { 'money', 5000 },
        }
    },
    [5] = {
        items = {
            { 'WEAPON_PISTOL', 1 },
        }
    },
}
```

{% endcode %}


# ScrapCars

A New Part to this script is being able to search random scrap cars around the map. Each with their own LootTable that you can adjust anyway you want! A Cool feature is that once a car is searched its not searchable again until the script has restarted or a server restart happened! The cars can also be locked behind an item of your choosing. This means in order for the Option to show for searching they must have atleast on of the items. You can change add remove or do whatever you want with this part!

{% code title="ScrapCar Options:" lineNumbers="true" %}

```lua
Config.Cars = {
    [1] = {
        hash = `prop_rub_carwreck_9`, -- What model?
        lootTable = 'prop_rub_carwreck_9', -- LootTable for Config.CarLoot
        name = 'car', -- name of the target can change if you want
        icon = 'fa-solid fa-capsule', -- icon for target https://fontawesome.com/
        label = 'Search', -- label if you choose to change it
        items = 'lockpick', -- or items = {lockpick = 1, hacing_device = 1} if they have one it will work
    }
}
```

{% endcode %}

{% code title="CarLoot:" lineNumbers="true" %}

```lua
Config.CarLoot = {
    ['prop_rub_carwreck_9'] = { -- must match lootTable in Config.Cars
        items = { -- Item you get list | Types: 'item', 'weapon', 'account'
            { 'water', 5 },
            { 'bread', 10 },
        }
    }
}
```

{% endcode %}


# SickApartmentSelect

SickApartmentSelect is a super simple script that works with PS-Housing and Multichar scripts that bypass PS-Housing starter apartment section. This will allow your players to still claim ONE free apartment in the city!

{% hint style="danger" %}
{% code title="Run The Following SQL:" %}

```sql
ALTER TABLE `players` ADD COLUMN IF NOT EXISTS pickedApart smallint(5) NOT NULL DEFAULT 0;
```

{% endcode %}
{% endhint %}

After creating your character you are granted ONE free apartment in the city! These Apartments need to be picked by you from the guy at the job center! There are a few to pick from so find one you like!

<figure><img src="https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/r2JRIqxFoHHQurHY67i8/image%20(1).png" alt=""><figcaption></figcaption></figure>

After selecting the one you would like a window will open to ask you to verify you actually want this one.&#x20;

<figure><img src="https://content.gitbook.com/content/LtqBlfJzl9GeXJ2SRptE/blobs/DNKGWr7j3UMLl3Cex7qd/image%20(2).png" alt=""><figcaption></figcaption></figure>

After confirming you want the Apartment it will fly you straight to it! You will get your first look at your new place!&#x20;


