# Welcome!

## Welcome to Tynopia Documentation

Make sure to visit our [Discord-Server](https://discord.gg/dqsumwST58)!

## Catalogue

{% content-ref url="/pages/4WAjurgbthaO4k4mpsFd" %}
[Rocket Soccer](/reference/rocket-soccer)
{% endcontent-ref %}

{% content-ref url="/pages/Im4Jgf556ey4gO8OM69D" %}
[Sled Race](/reference/sled-race)
{% endcontent-ref %}

<figure><img src="https://3493880060-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeuO21OLu0WlVpRLjwqGC%2Fuploads%2Fgit-blob-a7c66e78c74bfbeea87f205cdddb1656ee3e9847%2Flogo_transparent.png?alt=media" alt=""><figcaption></figcaption></figure>


# Rocket Soccer

## Requirements

This script requires [GABZ Maze Arena Map](https://fivem.gabzv.com/package/5567774).

## Exports

Everything related to exports:

{% content-ref url="/pages/mq2rT8kigrBevlKk7TPF" %}
[Exports (API Communication)](/reference/rocket-soccer/exports-api-communication)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Every customer reveives premium support via. our [Discord-Server](https://discord.gg/dqsumwST58). Make sure to join before purchasing!
{% endhint %}


# Exports (API Communication)

All Functions only accessible at server side

{% hint style="info" %}
**Good to know:** You can use all functions as event or manupulation of the logic
{% endhint %}

## Functions

#### <mark style="color:red;">Send a notify</mark>

{% tabs %}
{% tab title="Example (1)" %}

```lua
exports["RocketSoccer"]:Notify(source, message)
```

{% endtab %}

{% tab title="Parameters (1)" %}

| Name          | Type   |
| ------------- | ------ |
| source        | int    |
| message       | string |
| {% endtab %}  |        |
| {% endtabs %} |        |

#### <mark style="color:red;">Start a round</mark>

{% tabs %}
{% tab title="Example (2)" %}

```lua
exports["RocketSoccer"]:StartRound(sourceOrange, sourceBlue)
```

{% endtab %}

{% tab title="Parameters (2)" %}

| Name         | Type |
| ------------ | ---- |
| sourceOrange | int  |
| sourceBlue   | int  |
| {% endtab %} |      |

{% tab title="Manipulation (2)" %}
{% hint style="info" %}
If the return of the function is <mark style="background-color:orange;">**false**</mark>, the round will not start, but if it is <mark style="background-color:green;">**true**</mark>, it will.
{% endhint %}
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Stop a round</mark>

{% tabs %}
{% tab title="Example (3)" %}

```lua
exports["RocketSoccer"]:StopRound()
```

{% endtab %}

{% tab title="Manipulation (3)" %}
If the return of the function is <mark style="background-color:orange;">**false**</mark>, the round will not stop, but if it is <mark style="background-color:green;">**true**</mark>, it will.
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Get a player name</mark>

{% tabs %}
{% tab title="Example (4)" %}

```lua
exports["RocketSoccer"]:GetPlayerName(source)
```

{% endtab %}

{% tab title="Parameters (4)" %}

| Name         | Type |
| ------------ | ---- |
| source       | int  |
| {% endtab %} |      |

{% tab title="Manipulation (4)" %}
Change the return of the function to a different name (this will be displayed in the DUI)
{% endtab %}

{% tab title="Return (4)" %}
The respective player name (Changeable by "[Manipulation](#manipulation-4)")
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Check if player is allowed to join the queue</mark>

{% tabs %}
{% tab title="Example (5)" %}

```lua
exports["RocketSoccer"]:IsPlayerAllowed(source)
```

{% endtab %}

{% tab title="Parameters (5)" %}

| Name   | Type |
| ------ | ---- |
| source | int  |

{% endtab %}

{% tab title="Manipulation (5)" %}
If <mark style="background-color:green;">true</mark> is returned, the player can be added to the respective queue.

Note that you have to add the player to the queue yourself:&#x20;

```lua
queue[team][source] = true
```

{% endtab %}

{% tab title="Return (5)" %} <mark style="background-color:green;">true</mark> or <mark style="background-color:orange;">false</mark>
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Add a player to the queue</mark>

{% tabs %}
{% tab title="Example (6)" %}

```lua
exports["RocketSoccer"]:AddPlayerToQueue(source, team, force, player)
```

{% endtab %}

{% tab title="Parameters (6)" %}

| Name         | Type                                                                                                              |
| ------------ | ----------------------------------------------------------------------------------------------------------------- |
| source       | int                                                                                                               |
| team         | string (<mark style="background-color:blue;">blue</mark> or <mark style="background-color:orange;">orange</mark>) |
| force        | boolean                                                                                                           |
| player       | int (discord user id)                                                                                             |
| {% endtab %} |                                                                                                                   |

{% tab title="Manipulation (6)" %}
The return is **only** relevant for further processing of the function.

The actual logic is:

```lua
queue[team][source] = true / false
```

{% endtab %}

{% tab title="Return (6)" %} <mark style="background-color:green;">true</mark> or <mark style="background-color:orange;">false</mark>
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Check if player is in the queue of a team</mark>

{% tabs %}
{% tab title="Example (7)" %}

```lua
exports["RocketSoccer"]:IsPlayerInQueue(source)
```

{% endtab %}

{% tab title="Parameters (7)" %}

| Name         | Type |
| ------------ | ---- |
| source       | int  |
| {% endtab %} |      |

{% tab title="Manipulation (7)" %}
Change the return of the function to change the logic:

<mark style="background-color:green;">true</mark> / <mark style="background-color:orange;">false</mark>
{% endtab %}

{% tab title="Return (7)" %} <mark style="background-color:green;">true</mark> or <mark style="background-color:orange;">false</mark>
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Remove a player from the queue</mark>

{% tabs %}
{% tab title="Example (8)" %}

```lua
exports["RocketSoccer"]:RemovePlayerFromQueue(source, player)
```

{% endtab %}

{% tab title="Parameters (8)" %}

| Name         | Type                  |
| ------------ | --------------------- |
| source       | int                   |
| player       | int (discord user id) |
| {% endtab %} |                       |

{% tab title="Manipulation (8)" %}
The following line is the deciding logic which a player removes.

Modify these lines to detect manipulation

```lua
queue.blue[source] = nil
queue.orange[source] = nil
```

{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Get the current round</mark>

{% tabs %}
{% tab title="Example (9)" %}

```lua
exports["RocketSoccer"]:GetCurrentRound()
```

{% endtab %}

{% tab title="Return (9)" %}
If no round is started, the return value is <mark style="color:yellow;">nil</mark>

Otherwise the <mark style="color:purple;">round model</mark> is returned

```lua
{
    type = 0, -- 0 = Starting - 1 = In Game
    time = Settings.Round.Wait,
    url = Settings.Logo,
    ball = object,
    players = {
        orange = {
            source = playerOrange,
            ped = GetPlayerPed(playerOrange),
            vehicle = carOrange,
            name = Settings.API.GetPlayerName(playerOrange),
            score = 0
        },
        blue = {
            source = playerBlue,
            ped = GetPlayerPed(playerBlue),
            vehicle = carBlue,
            name = Settings.API.GetPlayerName(playerBlue),
            score = 0
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Spawn a vehicle</mark>

{% tabs %}
{% tab title="Example (10)" %}

```lua
exports["RocketSoccer"]:CreateVehicle(model, vector)
```

{% endtab %}

{% tab title="Parameters (10)" %}

| Name         | Type                                                                                               |
| ------------ | -------------------------------------------------------------------------------------------------- |
| model        | int / string                                                                                       |
| vector       | table ([vector3](https://docs.fivem.net/docs/scripting-reference/runtimes/lua/functions/vector3/)) |
| {% endtab %} |                                                                                                    |

{% tab title="Manipulation (10)" %}
Change the following line to return a different variable on return.

*This can help if there are problems with an anticheat.*

Note that the correct data type must be returned (see [Return](#return-10)[ Tab](#return-10)).

```lua
return CreateVehicle(model, vector, true, false)
```

{% endtab %}

{% tab title="Return (10)" %}
An entity of the type [Vehicle](https://docs.fivem.net/docs/scripting-manual/networking/ids/#entities) is returned
{% endtab %}
{% endtabs %}

#### <mark style="color:red;">Spawn a object</mark>

{% tabs %}
{% tab title="Example (11)" %}

```lua
exports["RocketSoccer"]:CreateObject(model, vector)
```

{% endtab %}

{% tab title="Parameters (11)" %}

| Name         | Type                                                                                               |
| ------------ | -------------------------------------------------------------------------------------------------- |
| model        | int / string                                                                                       |
| vector       | table ([vector3](https://docs.fivem.net/docs/scripting-reference/runtimes/lua/functions/vector3/)) |
| {% endtab %} |                                                                                                    |

{% tab title="Manipulation (11)" %}
Change the following line to return a different variable on return.

*This can help if there are problems with an anticheat.*

Note that the correct data type must be returned (see [Return](#return-10)[ Tab](#return-10)).

```lua
return CreateObject(model, vector, true, false, false)
```

{% endtab %}

{% tab title="Return (11)" %}
An entity of the type [Object](https://docs.fivem.net/docs/scripting-manual/networking/ids/#entities) is returned
{% endtab %}
{% endtabs %}

## Events

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

{% tabs %}
{% tab title="Explanation (12)" %}
Called when trying to tune up your vehicle using the internal trigger and it is not a Rocket Soccer vehicle.
{% endtab %}

{% tab title="Parameters (12)" %}

| Name          | Type                                                                                        |
| ------------- | ------------------------------------------------------------------------------------------- |
| playerPedId   | int ([Ped](https://docs.fivem.net/docs/scripting-manual/networking/ids/#ped))               |
| netID         | int ([Network ID](https://docs.fivem.net/docs/scripting-manual/networking/ids/#network-id)) |
| {% endtab %}  |                                                                                             |
| {% endtabs %} |                                                                                             |

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

{% tabs %}
{% tab title="Explanation (13)" %}
Called when the round ends.

**Reasons:**

* Time expired
* A team leaves the server
  {% endtab %}

{% tab title="Parameters (13)" %}

|               |                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
| team          | string (<mark style="background-color:blue;">blue</mark> or <mark style="background-color:orange;">orange</mark>) |
| {% endtab %}  |                                                                                                                   |
| {% endtabs %} |                                                                                                                   |

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

{% tabs %}
{% tab title="Explanation (14)" %}
Called when a team scores a goal
{% endtab %}

{% tab title="Parameters (14)" %}

|               |                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
| team          | string (<mark style="background-color:blue;">blue</mark> or <mark style="background-color:orange;">orange</mark>) |
| {% endtab %}  |                                                                                                                   |
| {% endtabs %} |                                                                                                                   |


# Controls

{% embed url="<https://www.youtube.com/watch?v=ltWTyRm-xks>" %}
Controls for Rocket Soccer
{% endembed %}

| Control                        | Action                     |
| ------------------------------ | -------------------------- |
| **Left Mouse Button + W**      | Boost                      |
| **Right Mouse Button**         | Jump Up                    |
| **2 x Right Mouse Button**     | Jump Forward               |
| **2 x Right Mouse Button + W** | Jump Forward *(Frontflip)* |
| **2 x Right Mouse Button + S** | Jump Back *(Backflip)*     |
| **2 x Right Mouse Button + A** | Jump Left *(Left Spin)*    |
| **2 x Right Mouse Button + D** | Jump Right *(Left Spin)*   |
| **SHIFT**                      | Drift                      |
| **Space**                      | Handbrake                  |
| **Right Mouse Button**         | Get back on 4 wheels       |

{% hint style="info" %}
All controls can be changed in settings.lua!
{% endhint %}


# Settings

```lua
Settings = {
    Ball = vec3(-324.1383, -1968.5367, 21.3),            -- Ball Spawn
    Teams = {                                            -- Color for each team. (Vehicle, firework etc will be in that color)
        Orange = {
            r = 243,
            g = 77,
            b = 15
        },
        Blue = {
            r = 15,
            g = 77,
            b = 243
        }
    },
    Peds = {                                            -- Ped Spawn
        Blue = {
            vector = vector4(-293.5027, -1924.0889, 29.1457, 234.9576),
            model = "a_m_y_motox_02"
        },
        Orange = {
            vector = vector4(-286.0806, -1930.2833, 29.1457, 61.4075),
            model = "a_m_y_motox_01"
        }
    },
    Vehicles = {                                        -- Vehicle Spawn
        Blue = {
            vector = vector4(-313.3335, -1977.5653, 20.7550, 53.1432),  -- Spawnpoint for each round
            model = "minioctane",                       -- if you want bigger octane fill in "rroctane"
            invincible = true,                          -- true = no damage to vehicle
            plate = {
                text = "ROCKET",
                index = 1
            }
        },
        Orange = {
            vector = vector4(-335.1695, -1959.1554, 20.7561, 228.0790), -- Spawnpoint for each round
            model = "minioctane",                       -- if you want bigger octane fill in "rroctane"
            invincible = true,                          -- true = no damage to vehicle
            plate = {
                text = "ROCKET",
                index = 1
            }
        }
    },
    API = {                                             -- API to use in your scripts
        Notify = function(source, string)
            TriggerClientEvent("nbc:rocketsoccer:notify", source, string)
        end,
        StartRound = function (sourceOrange, sourceBlue)-- Call function to start a game or manipulate it
            return true
        end,
        StopRound = function ()                         -- Call function to stop a game or manipulate it
            return true
        end,
        GetPlayerName = function(source)                -- Function to get the players name.
            return GetPlayerName(source)
        end,
        IsPlayerAllowed = function(source)              -- Function to check if player is allowed to join the queue.
            if Settings.EventMode then
                return IsPlayerAceAllowed(source, "nbc.admin")
            else
                return true
            end
        end,
        AddPlayerToQueue = function(source, team, force, player) -- Add player to queue
            if Settings.API.IsPlayerAllowed(source) or force then
                queue[team][source] = true
                return true
            end
            
            return false
        end,
        IsPlayerInQueue = function(source)              -- Check if a player is in queue
            return queue.blue[source] or queue.orange[source]
        end,
        RemovePlayerFromQueue = function(source, player)        -- Change logic to remove players or handle this as event
            queue.blue[source] = nil
            queue.orange[source] = nil
        end,
        CreateVehicle = function(model, vector)
            return CreateVehicle(model, vector, true, false)
        end,
        CreateObject = function(model, vector)
            return CreateObject(model, vector, true, false, false)
        end,
        OnExploit = function(playerPedId, netID)

        end,
        OnWinning = function(team)                      -- team can be "blue" or "orange" or nil if all players left the server

        end,
        OnGoal = function(team) -- team can be "blue" or "orange"

        end
    },
    Round = {
        Wait = 5,                                       -- Round Wait Time (in seconds)
        Time = 300                                      -- Round Time (in seconds)
    },
    Lobby = vec3(-282.1134, -1917.9065, 29.9464),
    Language = "en",                                    --Language (en, de, es, sw)
    --Misc...
    Logo = "https://dunb17ur4ymx4.cloudfront.net/webstore/logos/f362f15ca627b0028b886fd69d1c6d30168aebda.png",
    DebugMode = false,                                   --Leave this false! If you need support we will tell you to switch this to true. If true will do extensive loggin in client & server console!
    EventMode = false,                                   --If you wish to disable the queue and allow queue only for Admins.
    Console = true,
    Use3DText = true,
    --Effects
    BoostFX = {
        Active = true,
        CarColors = true,
        Custom = {
            r = 255,
            g = 75,
            b = 125
        }
    }
}
```

{% hint style="info" %}
If you have any questions regarding this file / its options make sure to raise a ticket within our [Discord-Server](https://discord.gg/S8Xq7JwNgg).
{% endhint %}


# Language

Languages which are supported by default:

* German&#x20;
* English&#x20;
* Spanish
* Swedish

```lua
Languages = {
    ["de"] = {
        KeyMap = {
            Jump = "Springen in Rocket League",
            Boost = "Boost in Rocket League",
            Drift = "Drift in Rocket League",
            W = "W Taste in Rocket League",
            A = "A Taste in Rocket League",
            S = "S Taste in Rocket League",
            D = "D Taste in Rocket League",
            E = "E Taste in Rocket League"
        },
        YouAreInQueue = "Du bist bereits in einer Warteschlange!",
        NotPermitted = "Du bist nicht befugt der Warteschlange beizutreten!",
        EventMode = "Eventmode ist eingeschaltet! Beitritt nicht möglich!",
        JoinSuccess = "Erfolgreich beitreten",
        LeaveSuccess = "Du hast das Spiel verlassen!",
        Join = "Beitreten",
        Leave = "Verlassen"
    },
    ["es"] = {
        KeyMap = {
            Jump = "Saltar in Rocket League",
            Boost = "Boost in Rocket League",
            Drift = "Drift in Rocket League",
            W = "W Botón in Rocket League",
            A = "A Botón in Rocket League",
            S = "S Botón in Rocket League",
            D = "D Botón in Rocket League",
            E = "E Botón in Rocket League"
        },
        YouAreInQueue = "Ya estás en una cola!",
        NotPermitted = "No estás autorizado a unirte a la cola!",
        EventMode = "El modo de evento está activado! No puede unirse!",
        JoinSuccess = "Únete con éxito",
        LeaveSuccess = "Te fuiste del juego!",
        Join = "Unirse",
        Leave = "Dejar"
    },
    ["sw"] = {
        KeyMap = {
            Jump = "Hoppa in Rocket League",
            Boost = "Boost in Rocket League",
            Drift = "Drift in Rocket League",
            W = "W Knapp in Rocket League",
            A = "A Knapp in Rocket League",
            S = "S Knapp in Rocket League",
            D = "D Knapp in Rocket League",
            E = "E Knapp in Rocket League"
        },
        YouAreInQueue = "Du står redan i kö!",
        NotPermitted = "Du är inte behörig att gå med i kön!",
        EventMode = "Händelseläget är på! Kan inte gå med!", 
        JoinSuccess = "Únete con éxito",
        LeaveSuccess = "Te fuiste del juego!",
        Join = "Gick med",
        TextLeave = "Lämna",
        JoinSuccess = "Har gått med",
        Leave = "Du lämnade spelet!",

    },
    ["en"] = {
        KeyMap = {
            Jump = "Jump in Rocket League",
            Boost = "Boost in Rocket League",
            Drift = "Drift in Rocket League",
            W = "W Key in Rocket League",
            A = "A Key in Rocket League",
            S = "S Key in Rocket League",
            D = "D Key in Rocket League",
            E = "E Key in Rocket League"
        },
        YouAreInQueue = "You are already in a queue!",
        NotPermitted = "You are not authorized to join the queue!",
        EventMode = "Eventmode is on! Can not join!",
        JoinSuccess = "Successfully joined",
        LeaveSuccess = "You left the game!",
        Join = "Join",
        Leave = "Leave"

    }
}

Language = Languages[Settings.Language]
```

{% hint style="info" %}
Language can be set within the [settings.lua](/reference/rocket-soccer/settings)
{% endhint %}

{% hint style="info" %}
If you have any questions regarding this file / its options make sure to raise a ticket within our [Discord-Server](https://discord.gg/S8Xq7JwNgg).
{% endhint %}


# Fxmanifest

```lua
fx_version 'cerulean'

lua54 'yes'
game 'gta5'

name 'RocketSoccer'
author 'NoBrandCars'
version '1.0.5'

server_script {
    'server.lua',
    'http.lua'
}

client_script 'client.lua'

shared_scripts {
    'settings.lua',
    "languages.lua"
}

files {
    "nui/*.*",
    "nui/sounds/*.*",
    "data/**/*.*"
}

ui_page "nui/index.html"

escrow_ignore {
    "settings.lua",
    "languages.lua"
}

exports {
    "Notify",
    "StartRound",
    "StopRound",
    "GetPlayerName",
    "IsPlayerAllowed",
    "AddPlayerToQueue",
    "IsPlayerInQueue",
    "RemovePlayerFromQueue",
    "OnExploit",
    "OnWinning",
    "OnGoal",
    "GetCurrentRound"
}

data_file 'VEHICLE_LAYOUTS_FILE'    'data/**/vehiclelayouts.meta'
data_file 'HANDLING_FILE'           'data/**/handling.meta'
data_file 'VEHICLE_METADATA_FILE'   'data/**/vehicles.meta'
data_file 'CARCOLS_FILE'            'data/**/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE'  'data/**/carvariations.meta'
```

{% hint style="info" %}
Do not change anything within the fxmanifest.lua
{% endhint %}


# Update

## How to update Rocket-Soccer

Login to [Keymaster](https://keymaster.fivem.net/), navigate to your purchases Assets and redownload Rocket-Soccer.

Replace your old ressource with the new one and make sure to check [settings.lua](/reference/rocket-soccer/settings) for possible changes.

{% hint style="info" %}
Updates for all our scripts are free of charge!
{% endhint %}

<details>

<summary>Update 1.0.5</summary>

* Most wished change implemented: **50% smaller Octane!** (included for free)
* Readjusted the **jump** function to adapt the new vehicle size
* Readjusted the **drift** function to adapt the new vehicle size
* Readjusted the **boost** function to adapt the new vehicle size
* Implemented choice to choose either **2D- or 3D-text**
* Discord Bot now supports **event-mode**
* Discord Bot now supports **adding** players to queue
* Discord Bot now supports **remove** players from queue
* Optimized reset ball logic to reset ball in case it leaves the playing field

**Its important to update your** [**settings.lua**](/reference/rocket-soccer/settings) **from the last update!**

</details>

<details>

<summary>Update 1.0.4</summary>

* NPC-PED logic is now handled clientside rather then serverside to prevent despawn of NPC's.
* [Authentification ](broken://pages/2UHiybFcOjMhdd2abcRI)added for our own [Discord Bot](broken://pages/v2TEnWrpMTwnsDECKVpi).
* Fixxed a ConVar error which had no impact on script functionality, but hey now its gone.

**Its important to update your** [**settings.lua**](/reference/rocket-soccer/settings) **from the last update!**

</details>

<details>

<summary>Update 1.0.3</summary>

* Added more options to the API.
* API now allows for calls to [objects](/reference/rocket-soccer/exports-api-communication#spawn-a-object).
* API now allows for calls for [vehicles](/reference/rocket-soccer/exports-api-communication#spawn-a-vehicle).
* Added Authentication for API Server.
* Games are now streamable over web.
* The octane car is now included in the ressource.
* Smaller tweaks & fixxes.

</details>

<details>

<summary>Update 1.0.2</summary>

* **Fixxed issue** when a player receives a game-crash when beeing in a round of Rocket-Soccer. *(Round would not end correctly).*
* **Fixed issue** when a player disconnects during in a round of Rocket-Soccer *(Round would end to early)*
* Changed the **default respawn position** (after a round ends) outside of the Arena Map. *(Players would get invisibility sometimes).*
* **Optimized loops** and **improved performance** of the script.

</details>

<details>

<summary>Update 1.0.1</summary>

<img src="https://3493880060-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeuO21OLu0WlVpRLjwqGC%2Fuploads%2F1U3a5iqx4hdYcEOgx59T%2Fimage.png?alt=media&amp;token=5d0953cc-d4cf-4318-af2a-077535698f19" alt="" data-size="original">

Performance improvement from 0.03 to 0.00 ms in idle (Outside [Maze Bank Arena](https://fivem.gabzv.com/package/5567774))

</details>


# Sled Race

## Requirements

This script requires [Fenix Sled Vehicle](https://fenix-customs.tebex.io/package/4844230), [ox\_lib](https://github.com/overextended/ox_lib) and [oxmysql](https://github.com/overextended/oxmysql)

## Exports

Everything related to exports:

{% content-ref url="/pages/owrx60LrumT04BlAduNs" %}
[Exports](/reference/sled-race/exports)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Every customer reveives premium support via. our [Discord-Server](https://discord.gg/dqsumwST58). Make sure to join before purchasing!
{% endhint %}


# Exports

All Functions only accessible at server side

## Functions

#### <mark style="color:purple;">Get the current Round</mark>

{% tabs %}
{% tab title="Example (1)" %}

```lua
exports.tynopia_sled:GetRound()
```

{% endtab %}

{% tab title="Return (1)" %}
And object of the <mark style="color:purple;">SledRound</mark> class found in the <mark style="color:purple;">modules/functions/server.lua</mark>
{% endtab %}
{% endtabs %}

#### <mark style="color:purple;">Get the current Round</mark>

{% tabs %}
{% tab title="Example (2)" %}

```lua
exports.tynopia_sled:GetQueue()
```

{% endtab %}

{% tab title="Return (2)" %} <mark style="color:purple;">number\[]</mark> which is a list of all player IDs in the queue
{% endtab %}
{% endtabs %}


# Functions

All functions that can be changed in the server or client

## Server

This functions can be found in the <mark style="color:purple;">modules/functions/server.lua</mark> file

| Name          | Explanation                                                                                                                                                                                                                                   |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OnReward      | This function is called when the first player reaches the goal. It will pass the player's source, license, and reward type, which can be used to give the player their reward.                                                                |
| OnRoundStatus | It will be called whenever the round changes its status, such as when the round starts and the status changes from "queue" to "active round." It will pass the complete Round, which is of type <mark style="color:purple;">SledRound</mark>. |

## Client

This functions can be found in the <mark style="color:purple;">modules/functions/server.lua</mark> file

| Name       | Explanation                                                                                                                                                                                                                                        |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PedSpawned | This function will be called when the ped spawns. It can be used, for example, to initialize <mark style="color:purple;">ox\_target</mark> in the default case. You can reference the entity directly because it will be passed into the function. |


# Events

These events can be triggered on the server.

| Name                            | Explanation                                                                   |
| ------------------------------- | ----------------------------------------------------------------------------- |
| tynopia:sled:server:queue:join  | When triggering this event on the server, it will attempt to join the queue.  |
| tynopia:sled:server:queue:leave | When triggering this event on the server, it will attempt to leave the queue. |


# State Bags

We're using State Bags to identify entities that are part of the sled race.

<table><thead><tr><th>Name</th><th>Explanation</th></tr></thead><tbody><tr><td><pre class="language-lua"><code class="lang-lua">Entity(...).state.isSledVehicle
</code></pre></td><td>This State Bag is applied to all sleds spawned within a round.</td></tr><tr><td><pre class="language-lua"><code class="lang-lua"><strong>Player(...).state.isSledPlayer
</strong></code></pre></td><td>This State Bag specifies all players that are part of a round.</td></tr><tr><td><pre class="language-lua"><code class="lang-lua"><strong>Player(...).state.isSledQueue
</strong></code></pre></td><td>This State Bag is applied to all players in the queue. It will be set to false if you're a sled player, as you will be removed from the queue.</td></tr></tbody></table>


# Support

We provide support for all of our work within our [Discord Server](https://discord.gg/dqsumwST58).

{% hint style="info" %}
[Click here to join](https://discord.gg/dqsumwST58)
{% endhint %}

We try to answer every support inquiry as fast and professional as possible!


