# :knife: Knife game
Documentation relating to the jo_fivefingerfillet.

:::: tabs
::: tab BUY
[Buy the script](https://jumpon-studios.com/redm/knife-game)
:::

::: tab PREVIEW
<iframe width="560" height="315" src="https://www.youtube.com/embed/qdmJtWG-e-M?si=MZxhRbY13OigZpJk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
:::
::::

## 1. Installation
jo_fivefingerfillet is a standalone script. So you don't need a specific framework to use it. It's also mean it works with all framework (VORP, RedEM:RP, QBCore, …).

- Drag and drop the resource in your resources folder
  - jo_fivefingerfillet
- Add this ensure in your server.cfg
  - `ensure jo_fivefingerfillet`
- Congratulation, the Knife game, aka Five finger filler script is ready to be use !

## 2. Usage
Go near a table and enter the command `/fff` to start the game.<br>
By default, all table are not available but you can add them in the config file.

## 3. Config.lua file
The configuration file is `config.lua` in the resource root. **Do not edit this file directly** as your changes may be lost during updates. Instead, use `overwriteConfig.lua` to store your customizations.

- **`config.lua`** - Default configuration maintained by developers. **Do not modify this file.**
- **`overwriteConfig.lua`** - This is where you place only the values you want to override.

### How to customize the configuration

1. Open `jo_fivefingerfillet/overwriteConfig.lua`
2. Find the value you want to change in `config.lua` (e.g., `Config.language`)
3. Copy only that line into `overwriteConfig.lua`
4. Edit the copied value to your liking

The script loads `config.lua` first, then `overwriteConfig.lua` overwrites only the values you redefine. This ensures your customizations are preserved when updating the script.

`jo_fivefingerfillet/shared/config.lua`

```lua
-------------------------------
-- DOCUMENTATION : https://docs.jumpon-studios.com/
--------------------------------

-------------------------------------------
-- DON'T EDIT THIS FILE
-- TO OVERWRITE CONFIG VALUE, USE overwriteConfig.lua file instead
-------------------------------------------

Config = {}

Config.debug = false
-- Command to start the five finger fillet
Config.commandName = "fff"

-- Duration of One round
Config.roundDuration = 30000 --ms

-- Model of the knife
Config.modelKnife = `w_melee_knife03`
Config.knifeOffset = {
  position = vec3(0.046386, 0.01579, -0.01253),
  rotation = vec3(-81.59428, 0.152559, -22.22602)
}

-- List of keys
Config.keys = {
  start = "INPUT_JUMP",
  stop = "INPUT_FRONTEND_CANCEL",
  crossArm = "INPUT_FRONTEND_UP",
  lookOther = "INPUT_FRONTEND_LEFT",
}

Config.displayMessage = function(message) --clientside
  print(message)
end

--Valid table models for five finger fillet
Config.modelsTable = {
  [`p_table01x`] = { zOffset = 0.0 },
  [`p_table02x`] = { zOffset = 0.0 },
  [`p_table03x`] = { zOffset = 0.0 },
  [`p_table04x`] = { zOffset = 0.0 },
  [`p_table05x`] = { zOffset = 0.0 },
  [`p_table06x`] = { zOffset = 0.0 },
  [`p_table_cs34_sml`] = { zOffset = 0.15 },
}

Config.QTE = {
  UP = true,
  DOWN = true,
  LEFT = true,
  RIGHT = true
}

--Valid chair models
Config.modelsChair = {
  `p_windsorchair03x`,
  `p_chair06x`
}
```

`jo_fivefingerfillet/shared/lang.lua`

```lua
-------------------------------------------
-- DON'T EDIT THIS FILE
-- TO TRANSLATE THE SCRIPT, USE overwriteLang.lua file instead
-------------------------------------------
Lang = {}

Lang.nameGame = "Five finger fillet"
Lang.startGame = "Start game"
Lang.left = "Left"
Lang.crossArm = "Cross arm"
Lang.uncrossArm = "Uncross arm"
Lang.stop = "Stop"
Lang.pressToStart = "Press to start"
Lang.noTable = "No valid table around you"
Lang.noSeat = "No valid chair around the table"
Lang.lookOther = "Look opponent"
```
