EXOTICA NETWORKDocs

Referencia completa de configuración

Archivos editables, valores de fábrica y esquema SQL del paquete

Consulta los valores de fábrica antes de comparar tu configuración. Modifica tu copia instalada y conserva los archivos originales como respaldo. Los ejemplos de identificadores y webhooks deben sustituirse en el servidor.

config.lua

config.lua
--========================================================
-- 🧠 EXOTICA NETWORK — ZONES TABLET — OFFICIAL CONFIG
--========================================================
Config = {}

--========================================================
-- 🔧 GENERAL
--========================================================
Config.Debug = false

--========================================================
-- 🧱 FRAMEWORK
--========================================================
-- "ESX", "QB" or "QBCore" (case-insensitive)
Config.Framework = "ESX"
Config.ESXLibrary = "esx:getSharedObject"

--========================================================
-- 👮 ADMIN
--========================================================
-- NOTA: los grupos/permisos de admin viven SOLO en el servidor
-- (server/sv_config.lua) para que no se puedan leer desde un dump del cliente.
Config.TabletCommand = "zonetablet"

--========================================================
-- ⚔ CAPTURE SETTINGS
--========================================================
Config.CapturingTime = 15
Config.CheckPlayersForCapturing = true
Config.AutoCapture = false
Config.MinPlayersToCapture = 1

Config.AutoCaptureDistance = 2.0 -- distancia para iniciar captura automática

Config.CaptureCenterText = {
    Enabled = false,
    Distance = 6.0,
    Text = "~r~⚔ ~w~CAPTURAR ~r~⚔"
}

--========================================================
-- 📏 RADIUS
--========================================================
Config.CaptureRadius = 340.0
Config.CancelCaptureIfLeaveRadius = true
-- Dibuja el cilindro de zona solo cuando hay captura, guerra o intruso.
-- Mantener DrawIdleRadius=false en Config.ZoneHUD evita que el cilindro este activo siempre.
Config.DrawCaptureRadius = true
Config.CaptureCylinderHeight = 70.0

Config.RadiusColor = {
    r = 255,
    g = 50,
    b = 50,
    a = 45
}

--========================================================
-- 🎁 REWARDS
--========================================================
Config.RewardTickSeconds = 5

Config.DefaultRewards = {
    { type = "money", amount = 500 },
    { type = "item", name = "water", count = 1 }
}

--========================================================
-- 🗺 BLIPS
--========================================================
Config.Blip = {
    FreeColor = 2,
    TakenColor = 1,
    FreeSprite = 197,
    TakenSprite = 303,
    ZoneRadiusColor = 1,
    ZoneRadiusAlpha = 130,
    ZoneIconColor = 1
}

--========================================================
-- 📱 TABLET PREVIEW
--========================================================
Config.TabletPreview = {
    enabled = true,
    markerType = 1,
    markerHeight = 1.2
}

--========================================================
-- ⚔ WAR SYSTEM
--========================================================
Config.WarSystem = {

    Enabled = true,

    -- frecuencia con la que el cliente reporta presencia
    PresenceIntervalMs = 1000,

    -- tiempo sin defensores para empezar captura
    EmptyWinDelaySec = 3,

    -- velocidad de progreso cuando hay ventaja
    AdvantagePerSec = 12,

    MaxProgress = 100,

    --====================================================
    -- 🚨 THIRD PARTY (INTRUDERS)
    --====================================================
    ThirdParty = {
        Enabled = true,
        WarningTime = 8,

        Punishments = {
            Damage = true,
            Kill = false,
            RemoveWeapons = false,
            Freeze = false,
            Fine = false
        },

        DamagePerSec = 25,
        FineAmount = 500,
        FreezeTime = 5
    },

    -- Warn other gangs while two gangs are fighting inside a zone.
    GlobalAlert = {
        Enabled = true,
        UpdateIntervalSec = 4,
        TtlSec = 6
    },

    --====================================================
    -- 🧪 DEBUG WAR
    --====================================================
    Debug = {
        Enabled = false,
        Zone = "prueba",

        Attacker = {
            job = "mechanic",
            label = "Mecanicos",
            count = 5
        },

        Defender = {
            job = "ambulance",
            label = "EMS",
            count = 4
        }
    },

    --====================================================
    -- 🧪 INTRUDER TEST MODE
    --====================================================
    IntruderTest = {
        Enabled = false,
        ForceAllPlayers = false
    }
}

--========================================================
-- ZONE HUD / PERFORMANCE
--========================================================
Config.ZoneHUD = {
    Enabled = true,
    ThrottleMs = 350,
    InZoneTickMs = 300,
    PlayerCountIntervalMs = 4000,
    CaptureCheckIntervalMs = 150,
    CapturePlayerCountIntervalMs = 4000,
    DrawIdleRadius = false
}

--========================================================
-- RANKINGS / WORLD POSTERS
--========================================================
Config.Ranking = {
    Enabled = true,
    MaxRows = 5,
    RefreshSeconds = 60,
    CountKillsOnlyInActiveWars = true,

    WallScreens = {
            {
                Name = "Gang Ranking Principal",
                Enabled = true,
                Coords = { x = -1617.70, y = -1067.92, z = 14.18 },
                Rotation = { x = 0.00, y = 0.00, z = 49.95 },
                Scale = { x = 6.00, y = 3.38, z = 1.00 },
                DrawDistance = 55.00,
                DoubleSided = true,
                FaceOffset = 0.015,
                Debug = false
            }
    },

    WallEditor = {
        Enabled = true,
        Width = 1920,
        Height = 1080,
        RefreshSeconds = 30,
        Command = "addranking"
    }
}

--========================================================
-- 📡 DISCORD LOGS
--========================================================
--========================================================
-- ZONE COIN REWARDS
--========================================================
Config.RankingRewards = {
    Enabled = true,
    Item = "zonacoin",
    Notify = true,

    Kill = {
        Enabled = true,
        Coins = 1
    },

    Capture = {
        Enabled = true,
        Coins = 5,
        Recipient = "online_gang" -- online_gang, capturer/source
    },

    Hold = {
        Enabled = true,
        IntervalMinutes = 30,
        CoinsPerZone = 1,
        Recipient = "online_gang"
    }
}

--========================================================
-- DISCORD LOGS
--========================================================
-- NOTA: las URLs de webhook viven SOLO en el servidor (server/sv_config.lua).
-- Nunca deben estar en este archivo shared: se dumpean desde el cliente.

--========================================================
-- 🌍 TRANSLATIONS
--========================================================
Config.Translate = {

    -- CAPTURE
    [0]  = "~w~[~r~E~w~] ~s~CAPTURE",
    [1]  = "~w~[~r~E~w~] ~s~JOIN CAPTURE",

    -- UI
    [5]  = " / 3",

    -- STATUS
    [10] = "FREE",
    [11] = "You are in Gang Zone: ~r~",
    [12] = "CONTROLLED BY:",
    [13] = "CAPTURING TIME:",

    -- ERRORS
    [14] = "Your gang is already controlling this place.",
    [15] = "More gang members are required to capture.",
    [25] = "No hay ninguna gang rival activa en la ciudad para poder capturar.",

    -- STATE
    [16] = "ZONE IS CURRENTLY BEING CAPTURED. TIME LEFT:",

    -- LOGS
    [20] = "is being captured by Gang:",
    [21] = "Capturing failed!",
    [22] = "with gang:",
    [23] = "have captured a zone:",
    [24] = "is trying to capture a zone:"
}

--========================================================
-- 🧠 DEBUG PRINT
--========================================================
function DebugPrint(...)
    if not Config.Debug then return end

    local args = {...}
    local msg = ""
    for i = 1, #args do
        msg = msg .. " " .. tostring(args[i])
    end

    print("^5[EN ZONES DEBUG]^7" .. msg)
end

server/sv_config.lua

server/sv_config.lua
-- ============================================================
-- CONFIG SERVER-ONLY  (NO se carga en el cliente)
-- ============================================================
-- Todo lo sensible va aqui para que no aparezca en un dump del
-- lado cliente: grupos de admin y URLs de webhook de Discord.
-- Este archivo se declara unicamente en server_scripts del fxmanifest.
-- ============================================================

Config = Config or {}

-- ---------- ADMIN (quien puede abrir la tablet) ----------
Config.AdminGroups   = { "god" }            -- ESX (getGroup)
Config.QBPermissions = { "admin", "god" }   -- QB (HasPermission)

-- ---------- DISCORD LOGS ----------
-- Pon tus webhooks aqui, o mejor usa convars en server.cfg:
--   set en_tabletzones_webhook "https://discord.com/api/webhooks/..."
-- (la convar tiene prioridad y no queda en ningun archivo del recurso)
local convarWebhook = GetConvar("en_tabletzones_webhook", "")

Config.Discord = {
    Enabled = true,
    Webhooks = {
        -- "https://discord.com/api/webhooks/...",
    },
    BotName = "Zones System",
    Header  = "Zones Logs",
}

if convarWebhook ~= "" then
    table.insert(Config.Discord.Webhooks, convarWebhook)
end

en_zones.sql

en_zones.sql
-- --------------------------------------------------------
-- Exotica Network Database Structure
-- --------------------------------------------------------
--
-- INSTALACION NUEVA: importa este archivo tal cual (crea las tablas en_*).
--
-- MIGRACION desde una version anterior (tablas kmsscripts_*):
-- si ya tienes datos, en vez de importar esto corre lo siguiente UNA vez
-- para conservar tus zonas/stats renombrando las tablas:
--
--   RENAME TABLE kmsscripts_zones        TO en_zones;
--   RENAME TABLE kmsscripts_jobs         TO en_jobs;
--   RENAME TABLE kmsscripts_gang_stats   TO en_gang_stats;
--   RENAME TABLE kmsscripts_zone_records TO en_zone_records;
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


-- ========================================================
-- TABLE: en_jobs
-- ========================================================
CREATE TABLE IF NOT EXISTS `en_jobs` (
  `name` varchar(50) NOT NULL,
  `label` varchar(50) NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


-- Example data
INSERT INTO `en_jobs` (`name`, `label`) VALUES
('mechanic', 'mechanic');


-- ========================================================
-- TABLE: en_zones
-- ========================================================
CREATE TABLE IF NOT EXISTS `en_zones` (
  `zone` varchar(40) NOT NULL,
  `owner` varchar(46) DEFAULT NULL,
  `job` varchar(50) DEFAULT 'nojob',
  `x` varchar(50) DEFAULT '0',
  `y` varchar(50) DEFAULT '0',
  `z` varchar(50) DEFAULT '0',
  `radius` int(11) DEFAULT 340,
  `rewards_json` longtext DEFAULT NULL,
  `reward_interval` int(11) DEFAULT 900,
  `capture_time` int(11) DEFAULT 60,
  PRIMARY KEY (`zone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


-- Example data
INSERT INTO `en_zones`
(`zone`, `owner`, `job`, `x`, `y`, `z`, `radius`, `rewards_json`, `reward_interval`, `capture_time`)
VALUES
('prueba', 'noowner', 'nojob', '196.567138671875', '-935.8324584960938', '30.686824798583984', 44, '[{"amount":1,"chance":100,"type":"black_money"}]', 5, 15);


-- ========================================================
-- TABLE: en_gang_stats
-- ========================================================
CREATE TABLE IF NOT EXISTS `en_gang_stats` (
  `job` varchar(50) NOT NULL,
  `label` varchar(80) DEFAULT NULL,
  `kills` int(11) NOT NULL DEFAULT 0,
  `deaths` int(11) NOT NULL DEFAULT 0,
  `captures` int(11) NOT NULL DEFAULT 0,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`job`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


-- ========================================================
-- TABLE: en_zone_records
-- ========================================================
CREATE TABLE IF NOT EXISTS `en_zone_records` (
  `zone` varchar(40) NOT NULL,
  `record_job` varchar(50) DEFAULT NULL,
  `record_label` varchar(80) DEFAULT NULL,
  `record_seconds` int(11) NOT NULL DEFAULT 0,
  `current_job` varchar(50) DEFAULT NULL,
  `current_label` varchar(80) DEFAULT NULL,
  `held_since` int(11) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`zone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Optional ESX classic item. If your inventory table has different columns,
-- create the zonacoin item in your inventory system instead of running this.
-- INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`)
-- VALUES ('zonacoin', 'Zone Coin', 1, 0, 1);


/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;

En esta página