# Wert Car Arena (Death race, Death match, Arena war)

## <mark style="background-color:orange;">INSTALLATION</mark>

## QBX Depends

* qbx\_core
* qb-target (If you use another target please edit codes in editable.lua)
* PolyZone

1 - Upload the script folder to the location of your resources

2 - Do not forget to add the necessary items to your item list ( If u use ox\_inventory please convert ox\_inventory item format )

```lua
-- Item
["cararena_menu"]								= {["name"] = "cararena_menu",				["label"] = "Car arena menu",										["weight"] = 100,	["type"] = "item",	["image"] = "cararena_menu.png",				["unique"] = true,	["useable"] = true,	["shouldClose"] = false,	["combinable"] = nil,	   ["description"] = "Car arena settings tool"},
```

3 - Don't forget to check out the editable settings and codes

4 - <https://github.com/Wert22/Wert-arena> (Load this script your server, this is a arena map) !IMPORTANT

5 - **Installation successful, have a good funs**

<mark style="color:blue;">**Note : Css file is not encrypted, you can customize images (I provided this for you to create your own style).**</mark>

## <mark style="background-color:green;">OX LIB OPTION</mark>

If you want enable ox-lib you need set Config.OxLib = true

After this step you can found this code and  open in fxmanifest.lua

<figure><img src="https://344044646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjk6DeXMrr9YWGvceJWb%2Fuploads%2F5T4pSjS815lLtxrVejwx%2Fimage.png?alt=media&#x26;token=54c3a499-6235-411e-8c77-874b82cd768a" alt=""><figcaption></figcaption></figure>

## <mark style="color:green;background-color:yellow;">EXPORTS</mark>

1 - Client side exports

* Get client player game data

````lua
```lua
local GameData = exports['wert-cararena']:GetClientGameData()
--Results
--GameData.start
--GameData.gamename
--GameData.gamepass
--GameData.maxplayer
--GameData.joinprice
--GameData.gametype
--GameData.mapname
--GameData.mapid
--GameData.owner
--GameData.reward
```
````

* Is the player on the spectator camera?

````lua
```lua
local CamData = exports['wert-cararena']:GetSpectCamActive()
if CamData then
    -- Player use camera
else
    -- Player not use camera
end
```
````

2 - Server side exports

* Retrieves the data of the current game

````lua
```lua
local GameData = exports['wert-cararena']:GetServerGameData()
for k,v in pairs(GameData) do
    print(k, v)
end
```
````

* Get active all cameras data

````lua
```lua
local CamData = exports['wert-cararena']:GetServerCamActive()
for k,v in pairs(CamData) do
    print(k, v)
end
```
````

**Note : If you want to put control in a different script, you can try the exports I mentioned above.**
