documentation
  • GENERAL INFORMATION
    • 🔷Tebex Integration
    • 👾Code Creator
    • 🔌REACT
    • 🌐 VISION Tebex Theme
  • PACKAGES
    • İDCARD
    • RADIO
    • NPC DIALOG
    • CARPLAY
    • SCOREBOARD
    • CARSHOP
    • GARAGE
    • GUNSHOP
    • RENT A CAR
    • CRAFTING
    • DRIVING SCHOOL
    • CUSTOMS
    • CASE
    • DAİLYREWARD
    • BLACKMARKET
    • REPORT
    • CLOTHESHOP
    • REGİSTER
    • CREATOR
    • VIPSYSTEM
    • NOTIFICATION
    • FİSHİNG
    • DİVİNG
    • PROGRESS & NOTIFY
    • NEW YEAR
Powered by GitBook
On this page
  1. PACKAGES

NEW YEAR

FiveM New Year Excitement: Eyes Store Reward Script!

  1. Framework Support: The configuration supports multiple game frameworks such as QBCore, ESX, OLDQBCore, and NewESX. This flexibility allows developers to integrate the script within different server setups seamlessly.

  2. Daily Rewards System:

    • The Day table within the configuration contains a list of rewards that players can collect each day. Each entry specifies:

      • day: The day number for which the reward is available.

      • item: Contains the model of the item and the amount that can be collected (i.e., how many of that item the player will receive).

      • variable: A boolean flag indicating whether the item is a variable reward or not.

      • collected: A boolean flag indicating whether the item has already been collected by the player.

  3. Item Addition Functionality:

    • The Add function is responsible for adding items to a player’s inventory.

    • It checks for valid input (player, item, and amount), verifies the amount is a positive number, and then adds the designated item to the specified player's inventory based on the framework being used.

  4. Dynamic Framework Retrieval:

    • The GetFramework function is designed to dynamically retrieve the game framework in use. It handles fetching the necessary shared object for each framework type, ensuring compatibility and ease of use.

Usage Example

Every day, players can collect specific items, motivating them to log in regularly. For example, on day 1, players receive an armor item, while on day 5, they can acquire gold bars. The configuration allows for easy adjustment of days and items based on game design requirements.

Conclusion

This script serves as a robust foundation for implementing a daily rewards system within a game framework. Its support for multiple frameworks and the ability to modify item allocations make it a valuable asset for enhancing player engagement and creating a rewarding game experience.

Feel free to reach out if you have any questions or need further modifications!


This explanation should help your client understand the purpose and functionality of the configuration script.

Item Addition Function in shared.lua

In the shared.lua configuration file, the Add function is a crucial component for managing item distribution to players in the game. This function is designed to ensure that items can be added to a player's inventory accurately and efficiently. Below is a detailed breakdown of how the function operates:

Add = function(Player, Item, Amount)
    if not Player or not Item or not Amount then
        print("Error: Invalid player, item, or amount.")
        return false
    end

    Amount = tonumber(Amount)
    if not Amount or Amount <= 0 then
        print("Error: Invalid amount.")
        return false
    end

    if Config.Framework == "QBCore" or Config.Framework == "OLDQBCore" then
        if Player.Functions.AddItem(Item, Amount) then
            print(Item .. " successfully added: " .. Amount)
            return true
        else
            print("Error: An error occurred while adding " .. Item .. ".")
            return false
        end
    else
        if Player.addInventoryItem(Item, Amount) then
            print(Item .. " successfully added: " .. Amount)
            return true
        else
            print("Error: An error occurred while adding " .. Item .. ".")
            return false
        end
    end
end

Daily Rewards Item Structure In the rewards configuration, each day's item rewards are defined using a standard structure. This structure is vital for managing item allocations effectively from day to day. Below is the breakdown of how the configuration is set up:

Day = {
    { day = 1, item = { { model = "armor", count = 1 } }, variable = true, collected = false },
    { day = 2, item = { { model = "advancedlockpick", count = 2 } }, variable = true, collected = false },
    { day = 3, item = { { model = "sandwich", count = 1 } }, variable = true, collected = false },
    { day = 4, item = { { model = "weapon_appistol", count = 3 } }, variable = true, collected = false },
    { day = 5, item = { { model = "goldbar", count = 2 } }, variable = true, collected = false },
    { day = 6, item = { { model = "tablet", count = 1 } }, variable = false, collected = false },
    { day = 7, item = { { model = "veh_neons", count = 5 } }, variable = false, collected = false },
    { day = 8, item = { { model = "armor", count = 2 } }, variable = false, collected = false },
    { day = 9, item = { { model = "weapon_pistol50", count = 3 } }, variable = false, collected = false },
    { day = 10, item = { { model = "weapon_petrolcan", count = 1 } }, variable = false, collected = false },
    { day = 11, item = { { model = "weapon_switchblade", count = 1 } }, variable = false, collected = false },
    { day = 12, item = { { model = "weapontint_plat", count = 1 } }, variable = false, collected = false },
    { day = 13, item = { { model = "rolex", count = 1 } }, variable = false, collected = false },
    { day = 14, item = { { model = "samsungphone", count = 2 } }, variable = false, collected = false },
    { day = 15, item = { { model = "snowball", count = 5 } }, variable = false, collected = false },
    { day = 16, item = { { model = "newscam", count = 2 } }, variable = false, collected = false },
    { day = 17, item = { { model = "nitrous", count = 1 } }, variable = false, collected = false },
    { day = 18, item = { { model = "bank_card", count = 3 } }, variable = false, collected = false },
    { day = 19, item = { { model = "fishingrod", count = 2 } }, variable = false, collected = false },
    { day = 20, item = { { model = "fitbit", count = 4 } }, variable = false, collected = false },
    { day = 21, item = { { model = "goldchain", count = 2 } }, variable = false, collected = false },
    { day = 22, item = { { model = "copper", count = 1 } }, variable = false, collected = false },
    { day = 23, item = { { model = "boomcamo_attachment", count = 2 } }, variable = false, collected = false },
    { day = 24, item = { { model = "bellend_muzzle_brake", count = 5 } }, variable = false, collected = false },
    { day = 25, item = { { model = "beer", count = 3 } }, variable = false, collected = false },
    { day = 26, item = { { model = "coke_small_brick", count = 2 } }, variable = false, collected = false },
    { day = 27, item = { { model = "drum_attachment", count = 1 } }, variable = false, collected = false },
    { day = 28, item = { { model = "laptop", count = 1 } }, variable = false, collected = false },
    { day = 29, item = { { model = "mg_ammo", count = 2 } }, variable = false, collected = false },
    { day = 30, item = { { model = "meth_tray", count = 1 } }, variable = false, collected = false }
},

Structure Explanation

  • Day: Each entry specifies a particular day (from 1 to 30) and contains the following key attributes:

    • item: This is a table containing an item defined by its model and the count of that item to be given. For example, on Day 1, players receive 1 piece of armor.

    • variable: This boolean field indicates whether the item is a variable reward or not. Items with variable = true may differ based on certain conditions or player progress, while variable = false means the item is fixed and will be the same for all players.

    • collected: This boolean field tracks whether the player has collected the item. Initially set to false, it changes to true once the player collects the item on that specific day.

Example of Daily Item Configuration

  • For Day 1:

    • Players receive 1 armor item.

    • The variable is set to true, suggesting that the armor could vary or may have options for upgrades or enhancements.

    • The collected flag starts as false indicating that the item has not yet been collected.

  • For Day 6:

    • Players receive 1 tablet item.

    • The variable is set to false, meaning every player will receive the same tablet.

    • The collected flag starts as false, indicating that it has not been collected yet.

Conclusion

This standard item structure within the daily rewards configuration helps facilitate an organized and dynamic rewards system in the game. It fosters player engagement by encouraging daily logins while simplifying management and item tracking through clear boolean flags for variability and collection status.

If you have any more questions or need further insights into how to modify or utilize this structure, please don’t hesitate to ask!

PreviousPROGRESS & NOTIFY

Last updated 6 months ago