# API

## Client

***

## IsInsideTurf

```lua
RegisterCommand('test', function()
    local inside, name = exports['uniq_turfwars']:IsInsideTurf()

    if inside then
        print(('You are inside %s'):format(name))
    end
end)
```

***

## Server

***

## IsPlayerInsideTurf

```lua
RegisterCommand('test', function (source, args, raw)
    local inside, turfName exports['uniq_turfwars']:IsPlayerInsideTurf(source)

    if inside then
        -- code
    end
end)
```

***

## IsTurfOwner

```lua
RegisterCommand('test', function (source, args, raw)
    if exports['uniq_turfwars']:IsTurfOwner(source, 'Test Turf') then
        -- code
    end
end)
```

***

## GetTurfData

```lua
RegisterCommand('test', function (source, args, raw)
    local data = exports['uniq_turfwars']:GetTurfData('Test Turf')

    if data then
        print(json.encode(data, {indent = true}))
    end
end)
```

***

## AreCoordsInsideTurf

```lua
RegisterCommand('test', function (source, args, raw)
    local coords = vec3(-2014.375, -470.783, 11.517)
    
    if exports['uniq_turfwars']:AreCoordsInsideTurf(coords, 'Test Turf') then
        -- code
    end
end)
```
