# Wert Fuel Stations (Job, Buy, Manage, Create and more ... )

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

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

2 - Don't forget to check that your target system and polyzone script are working

3 - Do not forget to add all the sql files contained in the folder to your database

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

## Example of legacy fuel

You can review the legacyfuel script that I used by making some edits via the github link below and use it if you want. This script is designed for use with wert-fuel stations, but if you want, you can also make your own fuel script compatible with wert-fuelstations by using the following exports.

{% embed url="<https://github.com/Wert22/LegacyFuel-Wert-Fuel-Stations>" %}

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

````lua
```lua
-- Returns which station area you are in, returns nil if you are not in a station area
local GetCurrentStation = exports['wert-fuelstations']:CurrentFuelStation()
if GetCurrentStation then
    -- return : 1, 2, 3 ...
    print("The player is in the area of the number [1] station")
else
    -- return : nil
    print("The character is not in any fuel station area")
end
```
````

````lua
```lua
-- Returns player stations
local GetMyOwnStations = exports['wert-fuelstations']:MyStations()
-- Table
for k,v in pairs(GetMyOwnStations) do
    if v then
        print("The owner of the Number 1 station")
    else
        print("No owner of the number 1 station")
    end
end
-- Other check method
local check_station_number = 1
if GetMyOwnStations[check_station_number] then
    print("The owner of the Number ".. check_station_number .. " station")
else
    print("No owner of the number ".. check_station_number .. " station")
end
```
````

````lua
```lua
-- Returns player employee stations
local GetMyEmployeeStations = exports['wert-fuelstations']:MyEmployess()
-- Table
for k,v in pairs(GetMyEmployeeStations) do
    if v then
        local rank = v
        print("Employee found for this station your rank : " .. rank)
    else
        print("You're not have employee for this station")
    end
end
-- Other check method
local check_station_number = 1
if GetMyEmployeeStations[check_station_number] then
    local rank = GetMyEmployeeStations[check_station_number]
    print("Employee found for this station your rank : " .. rank)
else
    print("You're not have employee for this station")
end
```
````

````lua
```lua
-- Returns player refinerys
local GetMyOwnRefinerys = exports['wert-fuelstations']:MyRefinerys()
-- Table
for k,v in pairs(GetMyOwnRefinerys) do
    if v then
        print("You own this refinery : " .. k)
    else
        print("You're not own this refinery : " .. k)
    end
end
-- Other check method
local check_refinery_name = "refinery-1"
if GetMyOwnRefinerys[check_refinery_name] then
    print("The owner of the this refinery ".. check_refinery_name)
else
    print("You're not own this refinery : " .. check_refinery_name)
end
```
````

````lua
```lua
-- Returns player refinerys
local GetSellingStations = exports['wert-fuelstations']:SellingStations()
local check_station_number = 1
if GetSellingStations[check_station_number] then
    print("Station selled : ".. check_station_number)
else
    print("Station not selled : " .. check_station_number)
end
```
````

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

````lua
```lua
-- It get up the liter price, fuel price and fuel sales status of stations
local StationFuelDatas = exports['wert-fuelstations']:StationFuelData()
local check_station_number = 1
if StationFuelDatas[check_station_number] then
    local row = StationFuelDatas[check_station_number]
    -- Returns :
    print(row.price) -- Fuel station a liter price
    print(row.fuel) -- Fuel station fuel level
    print(row.status) -- If status == 1 fuel sell active || If status == 0 fuel sell deactive
end
```
````

````lua
```lua
-- Returns whether stations have been sold or not
local SellingStations = exports['wert-fuelstations']:SellingStations()
local check_station_number = 1
if SellingStations[check_station_number] then
    print("This station has been sold")
else
    print("This station is not sold")
end
```
````

````lua
```lua
-- Returns whether refinerys have been sold or not
local SellingRefinerys = exports['wert-fuelstations']:SellingRefinerys()
local check_refinery_name = "refinery-1"
if SellingRefinerys[check_refinery_name] then
    print("This refinery has been sold")
else
    print("This refinery is not sold")
end
```
````

````lua
```lua
-- Returns tankers and fuel levels where work can be done
local SavedTankers = exports['wert-fuelstations']:Tankers()
local plate = "CHECKPLATE" -- args plate
if SavedTankers[plate] then
    local tanker_fuel_level = tonumber(SavedTankers[plate])
    print("Tanker fuel : " .. tanker_fuel_level)
else
    print("Tanker not have any fuel")
end
```
````

````lua
```lua
-- The station adds fuel to the tank
local target_station = 1
local add_fuel_amount = 1000 -- Lt
exports['wert-fuelstations']:AddFuelStation(target_station, add_fuel_amount)
```
````

````lua
```lua
-- The station remove fuel to the tank
local target_station = 1
local remove_fuel_amount = 1000 -- Lt
exports['wert-fuelstations']:RemoveFuelStation(target_station, remove_fuel_amount)
```
````

````lua
```lua
-- It helps to add money to the station case
local target_station = 1
local add_money_amount = 10000
exports['wert-fuelstations']:AddMoneyStation(target_station, add_money_amount)
```
````

````lua
```lua
-- It helps to remove money to the station case
local target_station = 1
local remove_money_amount = 20000
exports['wert-fuelstations']:RemoveMoneyStation(target_station, remove_money_amount)
```
````


---

# 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://wert-dev.gitbook.io/wert-dev-docs/products/esx/wert-fuel-stations-job-buy-manage-create-and-more-....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.
