# Home

## Welcome to Fuksus Resources documentation!

At this documentation file you can search for guidelines, error fixes and find answers to other questions about [**Fuksus Resouces**](https://docs.fuksus.store/) scripts.\
\
If you still face difficulties or need help installing resources, you are always welcome to write to our [**Discord** **support server**](https://discord.com/invite/XdNwNF4AsK) where we will solve every issue as soon as possible.


# Terms of Service

When buying and participating in use of any of our products, you agree to our latest Terms of Service.

1. The reselling or redistributing of any script bought or provided by **Fuksus Resources** is strictly prohibited.
2. If you are caught redistributing or reselling any script made by **Fuksus Resources**, you will be blacklisted and not let back in, as well as reported.
3. All sales are final. There are no refunds of any sort.
4. Being a customer does not exclude you from being removed due to breaking the Terms of Service.

{% hint style="info" %}
We have a full right to change any Terms of Service or information listed here at any given time.
{% endhint %}


# Installation

Installing this resource is straight forward, just like other resources!

## Step 1

Check if your **es\_extended** version is **legacy.**

{% hint style="warning" %}
Make sure your server's artifacts are updated to **4752 or higher**!
{% endhint %}

## Step 2

Place **fuksus-houserobberies** in your resources folder.

## Step 3

**Configure** and **translate** your resource.

{% content-ref url="/pages/Voa8hRICMYX7sus3v6rC" %}
[Configuration](/fuksus-houserobberies/configuration)
{% endcontent-ref %}


# Configuration

Here you will find all the configurations you will need.

<details>

<summary>Files that you can configure</summary>

`fuksus-houserobberies/shared/config.lua`

`fuksus-houserobberies/shared/houses.lua`

`fuksus-houserobberies/shared/locale.lua`

`fuksus-houserobberies/shared/functions.lua`

`fuksus-houserobberies/ui/app.js`

`fuksus-houserobberies/ui/index.html`

</details>

{% content-ref url="/pages/YYdyD8gw27SSS0rvb2y8" %}
[Adding houses](/fuksus-houserobberies/configuration/adding-houses)
{% endcontent-ref %}

{% content-ref url="/pages/PQdwAryIQCqjnO5mpIv6" %}
[Translating](/fuksus-houserobberies/configuration/translating)
{% endcontent-ref %}

{% content-ref url="/pages/DWitvtzBp3dILdn3RI5y" %}
[Functions](/fuksus-houserobberies/configuration/functions)
{% endcontent-ref %}

{% content-ref url="/pages/U1l8qJfJuaLIgcinPD4J" %}
[General config](/fuksus-houserobberies/configuration/general-config)
{% endcontent-ref %}

{% content-ref url="/pages/OTqs1A7t2HbKbM3R04lD" %}
[Police event](/fuksus-houserobberies/configuration/police-event)
{% endcontent-ref %}


# Adding houses

You can add more houses editing **houses.lua** file.

```javascript
Houses = {
    -- House information
    {
        doors = {
            outside = {
                 -- This is your outside door
                coords = vec3(1348.352, -547.0417, 73),
                text = Locale[Config.locale]['rob_house']
            },
            inside = {
                -- This is your inside door
                coords = vec3(-786.8663, 315.7642, 216.5),
                text = Locale[Config.locale]['leave_house']
            },
        },
        -- You can add containers as much as you want
        containers = {
            {
                -- Your stealable containers position
                coords = vec3(-788.8879, 320.5846, 217.0374),
                -- You can set custom text here
                text = 'Press ~INPUT_CONTEXT~ to search drawer.',
                -- Maximum items that can be generated
                maxItems = 5,
                searching = false,
                items = {}
            },
        },
        -- All the items that could be found in house
        -- The higher the rarity the more often the item will be generated
        houseItems = {
            -- Item name, minimum and maximum values of the item.
            {name = 'phone', min = 1, max = 2, metadata = {}, rarity = 10},
            {name = 'water', min = 1, max = 2, metadata = {}, rarity = 2}
        },
        -- Time till the alarm triggers in seconds
        robTime = 3000,
    },
}
```

{% hint style="danger" %}
Make sure the rarity **doesn't go above 10** or else the **server might hitch** when generating new items to be found !
{% endhint %}


# Translating

All the notifications translations can be found in **locale.lua**

```javascript
Locale = {
    ['en'] = {
        ['rob_house'] = 'Press ~INPUT_CONTEXT~ to rob the house.',
        ['leave_house'] = 'Press ~INPUT_CONTEXT~ to leave the house.',
        ['open_shop'] = 'Press ~INPUT_CONTEXT~ to open the shop.',
        ['not_enough_lockpicks'] = 'You don\'t have enough lockpicks.',
        ['somebody_lockpicking'] = 'Someone is already lockpicking.',
        ['allready_opened'] = 'The container is already opened.',
        ['not_enough_space'] = 'You don\'t have enough space.',
        ['not_enough_police'] = 'There are not enough police in the area.',
        ['house_blip'] = 'Robbable house',
    }
}
```


# Functions

You can change notification and help text drawing here.

{% code title="Client side" %}

```javascript
functions = {}

functions.showNotification = function(type, message)
    SetNotificationTextEntry('STRING')
    AddTextComponentString(message)
    DrawNotification(type, false)
end

functions.displayHelpText(text)
    AddTextEntry('helpText', text)
    DisplayHelpTextThisFrame('helpText', false)
end
```

{% endcode %}

{% code title="Server side" %}

```
functions = {}
-- You can set your sound resource here
functions.playSound = function(source, coords)
    exports['ultra-3dsound']:playSound(source,'./burgal.mp3', coords,  vec3(0,0,0))
end

functions.stopSound = function(source)
    exports['ultra-3dsound']:stopSound(source)
end
```

{% endcode %}


# General config

```javascript
Config = {}

Config.locale = 'en'

-- Marker style configuration
Config.marker = {
    door = {
        color = { r = 0, g = 255, b = 0, a = 100 },
        type = 1,
        scale = { x = 1.0, y = 1.0, z = 1.0 },
        bob = false,
        rotate = false,
        face = true
    },
    container = {
        color = { r = 0, g = 255, b = 0, a = 100 },
        type = 0,
        scale = { x = 0.35, y = 0.35, z = 0.35 },
        bob = false,
        rotate = false,
        face = true
    } ,
    shop = {
        color = { r = 0, g = 255, b = 0, a = 100 },
        type = 3,
        scale = { x = 0.35, y = 0.35, z = 0.35 },
        bob = false,
        rotate = false,
        face = true
    }
}

-- All the shop locations
Config.shops = {
    {
        coords = vec3(1353.349, -552.6725, 73.96558),
        text = Locale[Config.locale]['open_shop']
    },
}

-- Items that you can sell in shop
Config.shopItems = {
    {
        name = 'water',
        price = 10
    }
}

-- Money shop gives you when you sell an item
Config.moneyAccount = 'black_money' -- 'black_money' or 'money' or 'bank'

-- Blip configuration
Config.blip = {
    sprite = 40,
    color = 2,
    label = Locale[Config.locale]['house_blip']
}

-- Minimum amount of alert jobs online to rob a house
Config.minAlertJobs= 1 
-- Display blips on houses
Config.displayBlips  = true
-- Start robbing keybind 
Config.startRob = 38
-- Draw distance for markers 
Config.drawDistance = 3
-- Job name for police 
Config.alertJobs= 'police' or {'police', 'sheriff'}
-- Item name of the lockpick 
Config.lockpickItem = 'lockpick'
-- Default routing bucket
Config.defaultDimension = 0
-- Alarm play time outside
Config.alarmPlayTime = 10 -- Seconds
```


# Police event

When timer runs out an event is triggered **fuksus-hr:alertPolice.** This event is only sent to players who have the police job you configured in **Config.policeJob.**

```javascript
RegisterNetEvent('fuksus-hr:alertPolice', function()
    -- Your code for alerting the police
end)
```


# Installation

Installing this resource is straight forward, just like other resources!

## Step 1

Check if your **es\_extended** version is **legacy.**

{% hint style="warning" %}
Make sure your server's artifacts are updated to **4752 or higher**!
{% endhint %}

## Step 2

Place **fuksus-crafting** in your resources folder.

## Step 3

Insert the provided **CraftingLevels.sql**.

### Step 4

**Configure** and **translate** your resource.

{% content-ref url="/pages/rrdNWUDjidv2FBl1NIqN" %}
[Configuration](/fuksus-crafting/configuration)
{% endcontent-ref %}


# Configuration


# Adding tables

Adding more crafting tables is easy !

To start adding crafting tables you need to open **shared/craftingbenches.lua.**

```lua
{
        coords = vec4(0, 0, 0, 0),
        model = `gr_prop_gr_bench_04b`,
        shared = false,
        near = {
            enabled = false,
            maxDistance = 5.0,
        },
        blip = {
            label = 'Crafting table',
            id = 566,
            colour = 31,
            scale = 0.8
        },
        job = {
            police = 1
        },
        recipes = {
            {
                level = 0,
                title = 'Water',
                description = 'Repairing is easy',
                requiredItems = {
                    {name = 'burger', count = 1}
                },
                giveItem = {name = 'water', count = 1},
                time = 50,
                giveXp = 100
            },
        }
    },
```

Copy the first entry and edit it as you like it. If the value has ? then it is optional

* coords: `vector4`
* model?: `string`
* shared: `bool`&#x20;
  * If set to <mark style="color:green;">true</mark> then all the players can check what is being crafted and cancel or get the items that are crafted
* near: `table`
  * enabled: `bool`
  * maxDistance: `number`
    * If enabled is set to <mark style="color:green;">true</mark> then the player needs to be in the defined distance for the items to craft
* blip?: `table`
  * label: `string`
  * id: `number`
  * colour: `number`
  * scale: `number`
* job?: `table`
  * jobName: `string`
    * minJobGrade: `number`
* recipes: `table`
  * recipe: `table`
    * level: `number`
    * title: `string`
    * description: `string`
    * requiredItems: `table`
      * name: `string`
      * count: `number`
    * giveItem: `table`
      * name: `string`
      * count: `number`
    * time: `number`
    * giveXp?: `number`


# Translating

UI's translation can be found in **ui/locale/en.json**

```json
{
    "crafting_recipes": "Crafting recipes",
    "availible_recipes": "availible crafting recipes.",
    "add_to_table": "Add to Crafting table",
    "not_enough_items": "Lack of items for craft",
    "crafting_table": "Crafting table",
    "table_recipes": "recipes.",
    "add_recipe": "Add recipe",
    "add_recipe_text": "If you want to start making an item, add the recipe to the crafting table",
    "claim_production": "Claim production",
    "cancel_production": "Cancel production",
    "craft_item": "Craft item",
    "crafting": "Crafting...",
    "crafted": "Crafted",
    "modal_header": "Are you sure ?",
    "modal_text": "Do you really wanto to cancel this production? This process cannot be undone.",
    "modal_cancel": "Cancel",
    "modal_confirm": "Confirm"
}
```

Notifications and other can be found in **shared/locale.lua**

```lua
Locale = {
    ['en'] = {
        ['open_crafing'] = '~INPUT_CONTEXT~ open crafting menu',
        ['no_required_job'] = 'You dont have the required job for this crafting bench',
        ['not_enough_items'] = 'You dont have the required items for this recipe',
        ['not_enough_space'] = 'You dont have enough space in your inventory',
        ['need_to_be_near'] = 'You need to be near to the crafting table to craft your recipes',
        ['not_enough_level'] = 'You dont have the specified level to get this item'
    }
}
```


# Functions

**client/functions.lua**

```lua
Functions = {}

Functions.showNotification = function(type, message)
    SetNotificationTextEntry('STRING')
    AddTextComponentString(message)
    DrawNotification(type, false)
end

Functions.displayHelpText = function(text)
    AddTextEntry('helpText', text)
    DisplayHelpTextThisFrame('helpText', false)
end
```

**server/functions.lua**

```lua
Functions = {}

Functions.getItems = function()
    return ESX.Items()
end

Functions.getPlayer = function(source)
    return ESX.GetPlayerFromId(source)
end

Functions.canCarryItem = function(player, item, amount)
    return player.canCarryItem(item, amount)
end

Functions.getIdentifier = function(player)
    return player.identifier
end

Functions.addInventoryItem = function(player, item, amount)
    player.addInventoryItem(item, amount)
end

Functions.removeInventoryItem = function(player, item, amount)
    player.removeInventoryItem(item, amount)
end

Functions.getInventoryItem = function(player, item)
    local data = player.getInventoryItem(item)
    if not data then return nil end
    return {
        name = data.name,
        count = data.count
    }
end

Functions.getPlayerJob = function(player)
    return {
        job = player.job.name,
        grade = player.job.grade
    }
end
```


# General config

{% hint style="warning" %}
If you use **ox\_inventory** we strongly recommend changing **Config.imageLocation** to **nui://ox\_inventory/web/images/**
{% endhint %}

**shared/config.lua**

```lua
Config = {}

Config.locale = 'en'
Config.drawDistance = 30.0 -- For object
Config.markerDistance = 5.0 -- For marker

Config.imageLocation = '../../images/'

Config.exp = {
    exponent = 1.3, -- How much xp next level requires, levels xp is calculated by this formula basexp * (level ^ exponent)
    basexp = 1250, -- How much xp is need for the firts level
    addXpForCraft = 100 -- This is default value to add xp after crafting you can change each recipes value in the config
}

Config.saveTime = 15 -- How often save players xp and level in minutes

Config.marker = {
    type = 0,
    scale = {
        x = 0.5,
        y = 0.5,
        z = 0.5
    },
    color = { r = 0, g = 255, b = 0, a = 100 },
    offset = {
        x = 0.0,
        y = 0.0,
        z = 0.5
    },
    face = true,
    bobUpDown = true,
    spin = false
}
```


# Installation

Installing this resource is straight forward, just like other resources!

## Step 1

Check if your **es\_extended** version is **legacy.**

{% hint style="danger" %}
Make sure your server's artifacts are updated to 4752 or higher!
{% endhint %}

## Step 2

Place **fuksus-market** in your resources folder.

## Step 3

Import the provided **SQL** file to your database **fuksus-market.sql**

## Step 4

Configure and translate resource according to needs.&#x20;

{% content-ref url="/pages/5MQg0RfgIuU1SBldOS2G" %}
[Configuration](/players-marketplace/configuration)
{% endcontent-ref %}


# Configuration


# Translating

General config - `config.lua`

```lua
Config.Locale = {
    ['item'] = 'Item',
    ['weapon'] = 'Weapon',
    ['other'] = 'Other',
}
```

UI locale config - `fuksus-market/web/dist/config.json`

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "marketplace": "Marketplace",
    "my-listings": "My listings",
    "search": "Search",
    "type": "Type",
    "item": "Item",
    "select-item": "Select item",
    "select-item-desc": "To see availabe offers, select an item first",
    "inventory": "Inventory",
    "inventory-desc": "Your items",
    "add-listing": "Add listing",
    "add-listing-desc": "Create new listing",
    "select-to-sell": "Select an item from the inventory you want to sell",
    "unit-price": "Unit price",
    "quantity": "Quantity",
    "add-button": "Create listing",
    "your-listing": "Your listings",
    "your-listing-desc": "Your active listings",
    "price": "Price",
    "actions": "Actions",
    "market-value": "Item value in the market",
    "market-value-desc": "Min and max price for unit in the market",
    "min-price": "Lowest price",
    "max-price": "Highest price",
    "no-sales": "No sales",
    "seller": "Seller",
    "buy-button": "Buy for",
    "cancel-button": "Cancel",
    "max": "Max",
    "delete-action": "Delete",
    "all-items": "All items",
    "weapons": "Weapons",
    "items": "Items",
    "money-symbol": "$",
    "listings": "listings",
    "all-offers": "All listings for this item"
}
</code></pre>


# General config

General config - `config.lua`

```lua
Config = {}

Config.ESX = exports["es_extended"]:getSharedObject() -- ESX exports

Config.ox_inventory = exports.ox_inventory -- Ox inventory exports

Config.oxTarget = false -- If you are using ox target then set this to true, otherwise set it to false

Config.interactionKey = 38 -- Default interaction key = 38 ("E")

Config.accountType = 'bank' -- Set which account will be used for transactions (Default 'bank')

Config.blacklistedItems = { -- Blacklisted items that cannot be sold in the market
    'money',
    'black_money'
}

Config.Types = { -- Item categories
    weapon = 'Weapon',
    item = 'Item',
    other = 'Other'
}

Config.ped = 'mp_m_shopkeep_01'

Config.Locale = {
    ['item'] = 'Item',
    ['weapon'] = 'Weapon',
    ['other'] = 'Other',
}

Config.locations = {
    vec4(-511.478, -240.077, 35.848, 121.287),
    vec4(-446.503, -912.237, 29.393, 136.857),
    vec4(221.820, -1376.198, 30.529, 145.584),
    vec4(243.046158, -1396.654908, 30.509888, 93.543304)
}


-- OX TARGET SETTINGS ALSO YOU CAN CUSTOMIZE IT IN THE CLIENT/BLIPS.LUA --

Config.targetSize = vec3(0.5, 0.5, 2.0) -- Size of the target
Config.showTarget = false -- Show the target
Config.targetRotation = 0 -- Rotation of the target
```


