# justBumpercar

In this documentation: \
\- We give a installation tutorial\
\- We go over most of the lines of the config.lua and explain them\
\- Give a tutorial on how to change the textures of the bumpercar track<br>

## Installation

Firstly, you need some requirements:\
\- ESX Legacy\
\- Server build 2545 or higher\
\
If you meet these requirements, you are ready to install!\
\
1\. Download the resource from keymaster\
2\. Extract the zip file\
You will get 2 folder:\
\- justBumpercar\
\- justBumpercar\_track\
\
justBumpercar is the script, justBumpercar\_track is the bumpercar track\
\
3\. Upload these 2 folders to your server\
4\. Add this to your server.cfg\
`start` justBumpercar\_track\
`start justBumpercar`

Restart your server, make some changes to the config if you wan to and you are ready to go!<br>

\ <br>

## Script configuration

### Config.Carcoords

```lua
Config.Carcoords = {
    vector4(-1685.5442, -865.8474, 8.1256, 139.4771),
    vector4(-1683.9551, -863.9872, 8.1684, 139.4758),
    vector4(-1682.4830, -862.2192, 8.2089, 140.5863),
    vector4(-1680.9841, -860.3946, 8.2498, 139.3796),
    vector4(-1679.4249, -858.6080, 8.2915, 138.8238),
    vector4(-1677.8967, -856.8317, 8.3321, 139.2377),
    vector4(-1676.3086, -854.9924, 8.3748, 139.4012),
    vector4(-1674.7029, -853.1580, 8.4172, 138.6620),
    vector4(-1673.1835, -851.3393, 8.4585, 139.8830),
    vector4(-1671.7090, -849.5728, 8.4986, 139.7024),
    vector4(-1670.1753, -847.8041, 8.5396, 138.9137),
    vector4(-1668.6086, -845.9679, 8.5817, 139.2648),
    vector4(-1667.0428, -844.1265, 8.6240, 139.3099),
    vector4(-1665.5162, -842.2900, 8.6664, 140.1711),
}
```

\
In the Config.Carcoords, you can add spawnpoints where the bumpercars are gonna spawn when the script starts in vector4. That means: X, Y, Z, Heading.

### Config.markerOptions

```lua
Config.markerOptions = { 
    loc = vector3(-1655.6290, -843.8392, 9.5400),
    id = 2,
    text = "Press ~b~[E]~s~ to open the menu",
    textType = "info",
    scale = {x = 0.5, y = 0.5, z = 0.25},
    color = {r = 0, g = 152, b = 247, a = 150}, -- a = alpha = the opacity 
    Bob = false, -- Bob up and down
    faceCam = false, -- (can't be true at the same time with keepRotating!!)
    keepRotating = true 
}
```

Here you can customize the marker to open the control menu. \
You can find additional information here: <https://docs.fivem.net/docs/game-references/markers/><br>

### Shop

We added a shop to the scripts, that activates when there are less then 2 players online. You can customize the whole shop at "Config.shopMarkerOptions".\ <br>

```lua
Config.alwaysEnableShop = false
Config.onlinePlayersForNoShop = 2

Config.ShopStyles = {
    ESXmenudefault = true,
    -- More coming soon
}
Config.shopMenuOptions = {
    coinName = "Bumpercoin",
    title = "Bumpercar shop",
    pos = "top-right",
    price = 3,
}
```

Right now we only have 1 shop style, but we are planning to add more!

### Config.roundTime

```lua
Config.roundTime = 65
```

How long does 1 round need to be? In seconds!\
The timer on the menu automatically changes its start time to this number.<br>

### Config.MasterItem

```lua
Config.MasterItem = "masterkey"
```

This item allows the player to always use the bumper cars. This is intended for people who work at the bumper cars, so that they do not have to constantly work with coins.

### Config.Jobname and grade

```lua
Config.Jobname = "bumpercar"
Config.GradeNumber = 1
```

Config.GradeNumber is only used for the control menu in this case. There is another line for the bossMenu!

### Config.CustomStrobo and settings

```lua
Config.CustomStrobo = false
Config.StroboRotation = 215
Config.StroboRotation2 = 35
Config.StroboLocations = {
    vector3(-1676.764, -875.0883, 11.2502289),
    vector3(-1684.72253, -868.4024, 11.2492638),
    
    vector3(-1662.99231, -842.5329, 11.8383675),
    vector3(-1654.9353, -849.2835, 11.8382168),
}
```

We added stroboscopes! Strobes are those flickering white lights at the funfair. You can use a custom one if you want. To do this you set "Config.CustomStrobo" to true and insert your code later in the config file

### Music settings

```lua
Config.musicPlayLoc = vector3(-1669.9351, -859.1660, 9.2566)
Config.musicRange = 60
```

The Config.musicPlayLoc is the base of where the music is played, the music range is for how long the music should last. If a player is out of range, the music gets softer as the players move further from the range<br>

### Notify function

```lua
function Notify(text)
    ESX.ShowNotification(text)
end

function NotifyServer(source, text)
    TriggerClientEvent('esx:showNotification', source, text)
end
```

Here, you can add you're own notify!\
A example is already given in the config file.<br>

### Stroboscope function

```lua
function strobo()
    Notify("Add a stroboscope in the config file!")
end
```

If you have a custom stroboscope, you can add it here.\
Make sure to set "Config.CustomStrobo" to true if you have a custom one, otherwise set it to false.\
\
Webhook

```lua
Webhook = {}
Webhook.enable = true
Webhook.link = ""
Webhook.name = "Bumpercars"
Webhook.icon = "https://imgur.com/rknSMSh"
```

We added a webhook option! in the Webhook.link just insert your webhook link<br>

### Translations

```lua
Translate = {}
Translate.invalidLink = "Invalid youtube link!"
Translate.moneySign = "€"
Translate.youPayed = "You payed "
Translate.notEnoughMoney = "Not enough money"
Translate.usedMasterkey = "Used masterkey!"
Translate.usedCoin = "Used a coin!"
Translate.needACoin = "You need at least 1 bumpercoin!"
Translate.started = "Started round" -- Also used for webhooks
Translate.stopped = "Round ended" -- Also used for webhooks
Translate.emergencyStop = "Emergency stop"
-- Debug
Translate.unknown = "Something unknown happend..." -- Just in case, so the script doesnt crash
Translate.carModelMissing = "Invalid car model specified"
Translate.openedMenu = "Opened menu"
Translate.settingSpeed = "Setting speed"
Translate.setSpeed = "Set car speed to: "
Translate.input = "Input: "
Translate.usedUsedMasterkey = " used masterkey"
Translate.userUsedCoin = " used bumpercoin"
Translate.spawningCars = "Spawned car"
Translate.requestModel = "requesting model..."
Translate.requestModelDone = "requesting model complete!"
-- Webhook
Translate.startedRound = "Started round at "
Translate.autoStoppedRound = "Round automatically stopped at "
Translate.manStoppedRound = "Round manually stopped at "
Translate.emergencyButton = "Emergency stopped at "
```

Last but not least, the translations! You can set you're own custom translation in here! This also includes the debug and webhook translations.\
**Warning**\
\&#xNAN;*Make sure to keep the space at the end of some sentences, as shown right now. If you don't, the last word may come attached to another word.*\ <br>

## Custom textures

In this tutorial we will explain you how to change the textures (paint) on the bumpercar track\
\
Requirements:\
\- Codewalker \
\- Any image editor that supports .dds files\
\
You can find these here if you dont have them.\
Codewalker: <https://discord.com/invite/BxfKHkk>\
Paint.net: <https://getpaint.net/download.html#download>\
\
Make sure you have the stream folder from the bumpercar track on your local PC\
\
1\. Open up codewalker RPF explorer and enable edit mode\
2\. Open/make a mods folder in you GTA V main directory\
3\. Drag one of the **.ytd** into your mod folder (botautobaan.ytd is the ytd for the bumpercar track it self, and hok.ytd is for the control room next to the track) and open it\
4\. Find the texture you want to edit inside the .ytd file\
5\. Save the texture to your PC as follow: Press File (top left), and then "Save\
&#x20;filename.dds As...\
\
&#x20;6\. Then, open the texture you just saved with a image designer, like paint.net or photoshop. (Make sure the editor supports .dds files)\
7\. Edit the texture just the way you like it and save it\
8\. Go back into codewalker RPF explorer\
9\. Press "Replace" (bottom-left) and choose the texture you just edited **(Make sure to use the SAME texture you just saved!)**\
10\. Press File (top-left) and there choose: Save filename.ytd\
11\. Drag and drop your just edited .ytd into the stream folder of the bumpercar track\
12\. If necessary, upload the stream folder onto your FiveM server again (make sure to replace it with the old one). Then, restart your server and you should have your own texture!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://justdevelopment.gitbook.io/home/products/justbumpercar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
