🏬
SUN SCRIPT 插件文檔網站
  • 📚太陽插件開發商 | 文檔中心
  • 官方網站
    • 如何使用tebex禮品卡
  • 插件列表
    • 📦右上角資訊v1 | sun_serinfo
      • ⚙️使用說明
      • 🧭插件配置
    • 📦右上角資訊v2 | sun_serinfoV2
      • ⚙️使用說明
  • 📦掛機系統 | sun_AFKReward
    • VIP 設定
  • 📦車輛白名單 | sun_Whitelistcar
    • 抓不到車輛問題解決方法
  • 📦線上玩家獎勵系統 | sun_OnlinePlayer
    • 如何重新刷新紀錄
  • 📦地盤爭奪 | sun_territorywar
    • 如何安裝 how install ?
    • 設定 Settings
    • 問題 issue
      • PED System
  • 檔案販售教學
    • 如何設定discord紀錄
      • 有內建紀錄的插件
    • 如何更改按鍵
Powered by GitBook
On this page
  1. 掛機系統 | sun_AFKReward

VIP 設定

Previous掛機系統 | sun_AFKRewardNext車輛白名單 | sun_Whitelistcar

Last updated 11 months ago

level 對應 Config.Rewards ['數字']

```lua
Config.Rewards = {
    ['novip'] = { -- 請不要動 ['novip'] 的值,改了就拿不獎勵
        label = "一般玩家",
        reward = function(_source)
            local source = _source
            local xPlayer = ESX.GetPlayerFromId(source)
            local probability =  math.random(1, 100)
            if probability >= 1 and probability <= 40 then --- 40%
                xPlayer.addInventoryItem('gunkit', 2) 
                TriggerClientEvent('esx:showNotification', source, '~r~武器副本 ~y~獲得LV.2黑槍升級套件x2 40%')
            elseif  probability >= 41 and probability <= 60 then --- 20%
                xPlayer.addInventoryItem('bread', 2) 
                TriggerClientEvent('esx:showNotification', source, '~r~武器副本 ~y~獲得LV.2黑槍升級套件x2 40%')
            end
        end
    },
    ['1'] = {
        name = 'vip1',
        label = "銅會員",
        reward = function(_source)
            local source = _source
            local xPlayer = ESX.GetPlayerFromId(source)
            local probability =  math.random(1, 100)
            if probability >= 1 and probability <= 40 then --- 40%
                xPlayer.addInventoryItem('gunkit', 2) 
                TriggerClientEvent('esx:showNotification', source, '~r~武器副本 ~y~獲得LV.2黑槍升級套件x2 40%')
            elseif  probability >= 41 and probability <= 60 then --- 20%
                xPlayer.addInventoryItem('bread', 2) 
                TriggerClientEvent('esx:showNotification', source, '~r~武器副本 ~y~獲得LV.2黑槍升級套件x2 40%')
            end
            xPlayer.addMoney(8) -- (裡面輸入要給的數量)
        end
    },
    ['2'] = {
        name = 'vip2',
        label = "銀會員",
        reward = function(_source)
            local source = _source
            local xPlayer = ESX.GetPlayerFromId(source)
            xPlayer.addInventoryItem('bread', 2) -- ('物品名稱', 數量)
            xPlayer.addMoney(8) -- (裡面輸入要給的數量)
        end
    }
}

```

📦