Configuration


1. Configure cl_config.lua

In this section, you will configure the client-side configuration file cl_config.lua. Follow the instructions below to set it up according to your framework (ESX or QBcore).

Config = {}

Config.Header = {
    title = "RESMONSTUDIO",           -- Main header title
    name = "Advent Calendar"          -- System name displayed in the header
}

Config.Options = {
    Language = 'en',                  -- System language ('en' for English, 'pl' for Polish, etc.)
    TestEnable = false,               -- Enable test mode (bypasses certain checks, e.g., month restrictions)
    UseNewEsx = true,                 -- Use the new ESX framework if true; otherwise, use the old ESX framework
    UseVersionCheck = true,           -- Enable version compatibility checking for the script
    AllowClaimForgot = true,          -- Allow claiming missed rewards from the 1st to the current date; false restricts to the current day
    UseOpenType = "both",             -- How the advent calendar can be opened ("command", "coords", or "both")
    OpenCommand = "openadvent",       -- Command to open the advent calendar (e.g., '/openadvent' in chat)
    OpenKeyMapping = "F5",            -- Keybinding for opening the advent calendar (default: F5)
    OpenGiftTime = 5000,              -- Duration in milliseconds for the gift-opening animation (default: 5000ms)
    CurrentMonth = 12,                -- The month (numeric) during which rewards are available (default: December)
    PlayMusicOnCoords = true,         -- Enable music playback near specified coordinates

    Overextended = {
        Enabled = false,              -- Enable Overextended support for advanced features
        UseOXInventory = false,       -- Enable OX Inventory integration
        UseOxTarget = false,          -- Use OxTarget for interactions (requires ped/entity positions, not markers)
        TargetIcon = "fa-solid fa-gift", -- Icon shown during OxTarget interactions
        TargetText = "Open Advent Calendar" -- Text displayed for OxTarget interactions
    },

    UsePickUpSnow = {                 -- Configuration for snowball pickup functionality
        enabled = false,              -- Enable or disable snowball pickup
        SnowBallAmount = 1,           -- Number of snowballs given per pickup
        PressKey = 119,               -- Keybinding for snowball pickup (default: E)
        IsNextWeatherType = {"XMAS", "SNOW"} -- Allowed weather types for snowball pickup
    },

    UsePermanentSnow = {              -- Configuration for permanent snow weather
        enabled = true,               -- Enable permanent snow
        RandomSnow = false,           -- Randomize between specified snow types if true; otherwise, use fixed type
        types = {"SNOW", "XMAS", "SNOWLIGHT"}, -- Available weather types for randomization
        ChangeWeatherTime = 60,       -- Weather changes every X minutes if RandomSnow is true
        fixedType = "XMAS"            -- Default fixed snow type if RandomSnow is false
    },

    SharedObject = {                  -- ESX shared object configuration
        client = "esx:getSharedObject", -- Event to get the client-side shared object
        server = "esx:getSharedObject"  -- Event to get the server-side shared object
    },
}

Config.Positions = {  -- Marker and blip settings for the advent calendar
    [1] = {
        coords = vector3(233.25, -896.41, 29.69), -- Location coordinates
        music = "xmas_music.mp3",                -- Path to the background music file

        ped = { 
            enabled = false,          -- Enable or disable the ped
            model = "a_m_m_farmer_01",-- Ped model to spawn
            heading = 55.88           -- Direction the ped faces
        },

        entity = {                    -- Settings for Christmas Tree prop
            enabled = true,           -- Enable or disable the prop
            object = "xm_prop_x17_xmas_tree_int" -- Prop model
        },

        marker = {                    -- Marker display settings
            enabled = false,          -- Enable or disable the marker
            type = 21,                -- Marker type
            drawDistance = 15.0,      -- Marker visibility distance
            scale = vector3(1.0, 1.0, 1.0), -- Marker size
            color = {red = 255, green = 0, blue = 0, alpha = 100}, -- Marker color
            moveUpAndDown = false,    -- Animate the marker moving up and down
            rotate = true             -- Enable marker rotation
        },

        blip = {                      -- Blip (map marker) settings
            enabled = true,           -- Enable or disable the blip
            sprite = 466,             -- Blip icon type
            scale = 0.9,              -- Blip size
            color = 2,                -- Blip color
            display = 4,              -- Display type (4 shows on both main map and minimap)
            shortRange = true,        -- Only show the blip when nearby
            text = 'Advent Calendar'  -- Blip label
        },
    },
}

Config.Rewards = {
    [1] = { -- Day 1
        ['reward'] = { 
            name = "water",    -- Item name
            label = "Water",   -- Item label
            type = "item",     -- Item type
            count = 5          -- Reward count
        }
    },
    
    [2] = { -- Day 2 (Weapon Reward)
        ['reward'] = { 
            name = "WEAPON_PISTOL",    -- Item name
            label = "Pistol Weapon",   -- Item label
            type = "weapon",           -- Item type
            count = 1                  -- Reward count
        }
    },

    [3] = { -- Day 3
        ['reward'] = { 
            name = "bread",            -- Item name
            label = "Bread",           -- Item label
            type = "item",             -- Item type
            count = 3                  -- Reward count
        }
    },

    [4] = { -- Day 4 (Money Reward)
        ['reward'] = { 
            name = "money",            -- Money type reward
            label = "Cash",            -- Money label
            type = "money",            -- Money type
            count = 1000               -- Money amount
        }
    },

    [5] = { -- Day 5
        ['reward'] = { 
            name = "bank",             -- Bank reward
            label = "Bank Cash",       -- Label for bank reward
            type = "bank",             -- Bank money type
            count = 5000               -- Amount for the bank
        }
    },

    [6] = { -- Day 6 (Vehicle Reward - Adder)
        ['reward'] = { 
            name = "adder",            -- Vehicle name
            label = "Adder Vehicle",   -- Vehicle label
            type = "vehicle",          -- Vehicle type
            count = 1                  -- Vehicle reward
        }
    },

    [7] = { -- Day 7
        ['reward'] = { 
            name = "blackmoney",       -- Black money reward
            label = "Black Money",     -- Label for black money
            type = "blackmoney",       -- Black money type
            count = 5000               -- Amount for black money
        }
    },

    [8] = { -- Day 8 (Weapon Reward)
        ['reward'] = { 
            name = "WEAPON_ASSAULTRIFLE",    -- Item name
            label = "Assault Rifle",         -- Item label
            type = "weapon",                 -- Item type
            count = 1                        -- Reward count
        }
    },

    [9] = { -- Day 9
        ['reward'] = { 
            name = "water",    -- Item name
            label = "Water",   -- Item label
            type = "item",     -- Item type
            count = 5          -- Reward count
        }
    },

    [10] = { -- Day 10
        ['reward'] = { 
            name = "bread",    -- Item name
            label = "Bread",   -- Item label
            type = "item",     -- Item type
            count = 4          -- Reward count
        }
    },

    [11] = { -- Day 11
        ['reward'] = { 
            name = "WEAPON_PISTOL",    -- Item name
            label = "Pistol Weapon",   -- Item label
            type = "weapon",           -- Item type
            count = 1                  -- Reward count
        }
    },

    [12] = { -- Day 12
        ['reward'] = { 
            name = "money",            -- Money type reward
            label = "Cash",            -- Money label
            type = "money",            -- Money type
            count = 1500               -- Money amount
        }
    },

    [13] = { -- Day 13
        ['reward'] = { 
            name = "water",    -- Item name
            label = "Water",   -- Item label
            type = "item",     -- Item type
            count = 5          -- Reward count
        }
    },

    [14] = { -- Day 14
        ['reward'] = { 
            name = "bread",    -- Item name
            label = "Bread",   -- Item label
            type = "item",     -- Item type
            count = 5          -- Reward count
        }
    },

    [15] = { -- Day 15 (Weapon Reward)
        ['reward'] = { 
            name = "WEAPON_HEAVYPISTOL",  -- Item name
            label = "Heavy Pistol",       -- Item label
            type = "weapon",              -- Item type
            count = 1                     -- Reward count
        }
    },

    [16] = { -- Day 16
        ['reward'] = { 
            name = "phone",    -- Item name
            label = "Phone",   -- Item label
            type = "item",     -- Item type
            count = 1          -- Reward count
        }
    },

    [17] = { -- Day 17 (Money Reward)
        ['reward'] = { 
            name = "money",            -- Money type reward
            label = "Cash",            -- Money label
            type = "money",            -- Money type
            count = 1000               -- Money amount
        }
    },

    [18] = { -- Day 18
        ['reward'] = { 
            name = "water",    -- Item name
            label = "Water",   -- Item label
            type = "item",     -- Item type
            count = 5          -- Reward count
        }
    },

    [19] = { -- Day 19
        ['reward'] = { 
            name = "bread",    -- Item name
            label = "Bread",   -- Item label
            type = "item",     -- Item type
            count = 4          -- Reward count
        }
    },

    [20] = { -- Day 20
        ['reward'] = { 
            name = "WEAPON_PISTOL",    -- Item name
            label = "Pistol Weapon",   -- Item label
            type = "weapon",           -- Item type
            count = 1                  -- Reward count
        }
    },

    [21] = { -- Day 21 (Weapon Reward)
        ['reward'] = { 
            name = "WEAPON_ASSAULTRIFLE",    -- Item name
            label = "Assault Rifle",         -- Item label
            type = "weapon",                 -- Item type
            count = 1                        -- Reward count
        }
    },

    [22] = { -- Day 22 (Money Reward)
        ['reward'] = { 
            name = "money",            -- Money type reward
            label = "Cash",            -- Money label
            type = "money",            -- Money type
            count = 1000               -- Money amount
        }
    },

    [23] = { -- Day 23
        ['reward'] = { 
            name = "phone",    -- Item name
            label = "Phone",   -- Item label
            type = "item",     -- Item type
            count = 1          -- Reward count
        }
    },

    [24] = { -- Day 24 (Gift Vehicle Reward)
        ['reward'] = { 
            name = "adder",           -- Vehicle name
            label = "Adder Vehicle",  -- Vehicle label
            type = "vehicle",         -- Vehicle type
            count = 1                 -- Reward count
        }
    }
}

Config.Vehicles = {
    Plate = {
        UseSpace = false,             -- Option to include a space between letters and numbers on the license plate (true/false)
        Letters = 3,                  -- Number of letters on the plate (e.g., 'ABCD' if set to 4)
        Numbers = 3,                  -- Number of numbers on the plate (e.g., '1234' if set to 4)
        LetterCharset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", -- The set of characters that can be used for the letter portion of the plate
        NumberCharset = "0123456789", -- The set of digits that can be used for the number portion of the plate
        MaxPlates = 9999999           -- Maximum number of unique plates that can be generated (affects randomness and uniqueness)
    }
}

Config.Notify = {
    Enabled = true,
    Delay = 0,

    func = function(message)
        Notify(message)
    end
}

function ShowHelpNotify(msg, E)
    ESX.ShowHelpNotification(msg, E)
    -- exports["rs_hud"]:HelpNotify(msg, E)
end  

function Notify(msg)
    TriggerEvent('esx:showNotification', msg)
    -- TriggerEvent('rs_notify', 'Advent - Calendar', msg , 'info', 5000)
end

2. Configure sv_config.lua

In this section, you will configure the server-side configuration file sv_config.lua. Follow the instructions below to set it up according to your framework (ESX or QBcore)

CFG = {}

CFG.Webhooks = {
    Color = "16777215",
    Author = "ResmonStudio",
    AuthorURL = "https://i.ibb.co/PZDN7K4/logo.png",
    ThumbURL = "https://i.ibb.co/PZDN7K4/logo.png",
    Username = "RS | Logs",
    Webhooks = {
        advent = {'PUT_YOUR_WEBHOOK'},
    }
}

function xPlayerAddMoney(xPlayer, amount)
    xPlayer.addMoney(amount)
end

function xPlayerAddBankMoney(xPlayer, amount)
    xPlayer.addAccountMoney('bank', amount)
end

function xPlayerAddBlackMoney(xPlayer, amount)
    xPlayer.addAccountMoney('black_money', amount)
end

function xPlayerAddWeapon(xPlayer, weaponName)
    xPlayer.addWeapon(weaponName, 200)
end

function xPlayerAddItem(xPlayer, itemName, amount)
    xPlayer.addInventoryItem(itemName, amount)
end

3. Select Languages in sh_languages.lua

In the sh_languages.lua file, you can manage all available language options. To set your preferred language and its corresponding translations, navigate to cl_config.lua and specify your desired locale. This allows you to customize the different languages.

Config.Languages = {
    ['en'] = {  -- English
        ['HelpNotify'] = 'Press [E] to open the Advent Calendar',
        ['RewardNotFound'] = 'Reward not found!',
        ['AlreadyClaimed'] = 'You have already claimed this reward!',
        ['RewardNotAvailable'] = 'This reward is not available yet',
        ['RewardClaimed'] = 'Reward claimed successfully:',
        ['PickedUp'] = 'You picked up {amount} snowball(s)!',
    },
    ['de'] = {  -- German
        ['HelpNotify'] = 'Drücke [E], um den Adventskalender zu öffnen',
        ['RewardNotFound'] = 'Belohnung nicht gefunden!',
        ['AlreadyClaimed'] = 'Du hast diese Belohnung bereits abgeholt!',
        ['RewardNotAvailable'] = 'Diese Belohnung ist erst im Dezember verfügbar.',
        ['RewardClaimed'] = 'Belohnung erfolgreich abgeholt:',
        ['PickedUp'] = 'Du hast {amount} Schneeball/Schneebälle aufgehoben!',
    },
    ['cs'] = {  -- Czech
        ['HelpNotify'] = 'Stiskněte [E] pro otevření Adventního kalendáře',
        ['RewardNotFound'] = 'Odměna nenalezena!',
        ['AlreadyClaimed'] = 'Tuto odměnu jste již získali!',
        ['RewardNotAvailable'] = 'Tato odměna není ještě dostupná.',
        ['RewardClaimed'] = 'Odměna úspěšně získána:',
        ['PickedUp'] = 'Sebrali jste {amount} sněhovou kouli!',
    },
    ['fr'] = {  -- French
        ['HelpNotify'] = 'Appuyez sur [E] pour ouvrir le calendrier de l\'avent',
        ['RewardNotFound'] = 'Récompense introuvable !',
        ['AlreadyClaimed'] = 'Vous avez déjà réclamé cette récompense !',
        ['RewardNotAvailable'] = 'Cette récompense n\'est pas encore disponible',
        ['RewardClaimed'] = 'Récompense réclamée avec succès :',
        ['PickedUp'] = 'Vous avez ramassé {amount} boule(s) de neige !',
    },
    ['es'] = {  -- Spanish
        ['HelpNotify'] = 'Presiona [E] para abrir el Calendario de Adviento',
        ['RewardNotFound'] = '¡Recompensa no encontrada!',
        ['AlreadyClaimed'] = '¡Ya has reclamado esta recompensa!',
        ['RewardNotAvailable'] = 'Esta recompensa no está disponible aún',
        ['RewardClaimed'] = 'Recompensa reclamada exitosamente:',
        ['PickedUp'] = '¡Recogiste {amount} bola(s) de nieve!',
    },
    ['pt'] = {  -- Portuguese
        ['HelpNotify'] = 'Pressione [E] para abrir o Calendário do Advento',
        ['RewardNotFound'] = 'Recompensa não encontrada!',
        ['AlreadyClaimed'] = 'Você já reivindicou esta recompensa!',
        ['RewardNotAvailable'] = 'Esta recompensa ainda não está disponível',
        ['RewardClaimed'] = 'Recompensa reivindicada com sucesso:',
        ['PickedUp'] = 'Você pegou {amount} bola(s) de neve!',
    },
    ['pl'] = {  -- Polish
        ['HelpNotify'] = 'Naciśnij [E], aby otworzyć Kalendarz Adwentowy',
        ['RewardNotFound'] = 'Nagroda nie znaleziona!',
        ['AlreadyClaimed'] = 'Już odebrałeś tę nagrodę!',
        ['RewardNotAvailable'] = 'Ta nagroda nie jest jeszcze dostępna',
        ['RewardClaimed'] = 'Nagroda pomyślnie odebrana:',
        ['PickedUp'] = 'Podniosłeś {amount} śnieżkę/śnieżki!',
    },
    ['it'] = {  -- Italian
        ['HelpNotify'] = 'Premi [E] per aprire il Calendario dell\'Avvento',
        ['RewardNotFound'] = 'Ricompensa non trovata!',
        ['AlreadyClaimed'] = 'Hai già ritirato questa ricompensa!',
        ['RewardNotAvailable'] = 'Questa ricompensa non è ancora disponibile',
        ['RewardClaimed'] = 'Ricompensa ritirata con successo:',
        ['PickedUp'] = 'Hai raccolto {amount} palla/e di neve!',
    },
    ['tr'] = {  -- Turkish
        ['HelpNotify'] = '[E] tuşuna basarak Advent Takvimini açın',
        ['RewardNotFound'] = 'Ödül bulunamadı!',
        ['AlreadyClaimed'] = 'Bu ödülü zaten aldınız!',
        ['RewardNotAvailable'] = 'Bu ödül henüz mevcut değil',
        ['RewardClaimed'] = 'Ödül başarıyla alındı:',
        ['PickedUp'] = '{amount} kar topu aldınız!',
    }
}

Last updated