搜索
查看: 246|回复: 1
收起左侧

请帮忙汉化一下

[复制链接]

升级进度: 68%

忍冬天天开心 发表于 2024-4-29 22:26:32 | 显示全部楼层 |阅读模式
local Framework = require('server.utils')https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
local resourceName = GetCurrentResourceName()https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
local CreditScores = {}https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij
https://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6

local function saveCreditScores()jdjfbuhovuofwxxazyvieamlfnhxctqmwaryuzmpubvqz
    SaveResourceFile(resourceName, 'credit_scores.json', json.encode(CreditScores), -1)kaaiovkspdrencdzvfqgkwiybvlmuubfvbnjxxcnb
end
ldtmfhzppfjocrqsxfhfqcifevtpucgggzslhsbxxkl

https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O

local function loanPaidLoop()stxnpqmusmjete
    local data = MySQL.query.await('SELECT * FROM players_loan WHERE status = 1', {})
  • ivjipyplmemihpgpkkhngmzezmtfsswaofideypqcbzj

  •     for k, v in pairs(data) do
  • https://pan.baidu.com/s/5G6H7I8J9K0L1M2N3O4P

  •         local loanDetails = json.decode(v.loan_details)fmejooejgtbvzjpxnpumxhrxynlddvmihqswf
            for _, duesdata in pairs(loanDetails.dues) dohttps://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D?pwd=yza8
                if not duesdata.paid thenaplmostxlbhyhpmwiue
                    if os.time() >= duesdata.time thenhttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E?pwd=bcd9
                        local hasRemoved = Framework:RemoveMoneyByIdentifier(v.citizenid, 'bank', tonumber(duesdata.amount),不影响正文阅读
                            "banker-loan")xajfcwydmbjhfelhshzqucawwayxohkmhuskqrod
                        if not hasRemoved thenlcapmslmejghyloyma
                            Framework:RemoveMoneyByIdentifierOffline(v.citizenid, tonumber(duesdata.amount))bcepodussegcgvdtkbgfbkjqqoluyxczzhpok
                        end
  • lrartksqniwce

  •                     if Config.CreditScore.Enable then
    https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F

                            HandleScores(v.citizenid, "remove", tonumber(duesdata.amount))
    yxyokvwfakdxgswvlvebfnh

                        endhttps://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
                        duesdata.paid = truemetwglmyautwvobrahxqmvdzddigmjdzowvuihticnfxbgpc
                        MySQL.Async.execute('UPDATE players_loan SET status = ? , loan_details = ? WHERE loan_id = ?',
    https://pan.baidu.com/s/5X6Y7Z8A9B0C1D2E3F4G

                            { 3, json.encode(loanDetails), v.loan_id })xpqcvknphfmm
                    end
  • grjqggypracjumadhtjywfimtkbdsqqyiaopgnex

  •             end
    dtoazkgpqrkzcdkbplkv

            end
    arwjinopugtrwfbkbxcpfpvifxkizcvzusjdfxsz

        endhttps://pan.baidu.com/s/9J0K1L2M3N4O5P6Q7R8S
        SetTimeout(Config.LoanIntervals, loanPaidLoop)tuqlcuztqmurakblyfjtogbywzujlw
    endfvjyutbjslbwratuigfupmunacwzgxhlsrjnk

    kizycpqpqobvzkjcwunfbdxojhjtwvhhegfgvwwlk

    https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K


    AddEventHandler('txAdmin:events:serverShuttingDown', function()
  • vvexunoznppuelotnhuifovziyalden

  •     saveCreditScores()https://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G
    end)https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
    pefpcqcofigawopdppbzqrkwkfnvpflfjrumhwbmfh
    AddEventHandler('onResourceStart', function(resourceName)https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
        if (GetCurrentResourceName() ~= resourceName) then
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5

            returnhqtsrlskaragci
        end

    upgqznwmwqympthpsrwihpyhttps://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W


        if Config.AutomaticDeduction thenlatfuzoyschjdaphurfrsfjlgnskawl
            Wait(5000)https://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7
            loanPaidLoop()
  • https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N

  •     end                                   --启动扣除贷款付款的循环
    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W

        if Config.PhoneMails.DueReminder then -- 启动循环以在脚本重启时发送贷款还款提醒zdwmdjsjkrfigfvceenizhczrzarluckxyxbhql
            local data = MySQL.query.await('SELECT * FROM players_loan WHERE status = 1', {})https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S
            for k, v in pairs(data) do
    okzqwxiidhie

                local loanDetails = json.decode(v.loan_details)
    bhocpeowbmnluhufqohgxoxbonbenqpoydrnhf

                for _, duesdata in pairs(loanDetails.dues) dohttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
                    if not duesdata.paid then
    owcpquempseqxdaxkkanfpkufnfxdznswqhnlmaaee

                        if os.time() >= (duesdata.time - (Config.PhoneMails.Time * 24 * 60 * 60)) and os.time() < duesdata.time thenhafqthuppuforpbxqeikqqbvsrcdidmperfxz
                            -- convert dues.time into date
  • zhknceefmnnbxzezjtfxfzbx

  •                         local date = os.date("%d-%m-%Y %H:%M:%S", duesdata.time)pgrucntzurbfleqkyfwtwk
                            local maildata = {
    etskgluhhgtdmlvrqkozhvlfrexfchlhadr

                                sender = "Banker",qecpeomrqudjimbpxveqrpekusarkaxafaq
                                subject = "#" .. v.loan_id .. " Loan Payment Reminder",sdbhplhxxq
                                message = "You have a loan payment due . Please visit the bank to pay your loan before " ..
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V

                                    date .. ". Payment Amount : $" .. duesdata.amount .. ". ",vxrolihxxnujrxvfcezbkollhxsoqaglyxajfhhdvcmm
                            }https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7
                            Framework:SendMail(v.citizenid, maildata)https://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H?pwd=klm2
                        endhttps://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
                    endhttps://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6
                endpzdlxwiblmvpprvba
            endhttps://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
        end

    wfrrffpxiwglxvtsnyj

  • https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F

  • end)nxicxxalooxubpzdllfwyimraviiabgnyopwlpiaegugvtkhf
    kpwiikbnstjrjusgrdvjpncpkhp
    AddEventHandler('onResourceStop', function(res)neqzgqkpqwurutbntmybkptyra
        if res ~= resourceName then return endhttps://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
        saveCreditScores()https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef
    end)
  • iwpnfqxqsuxt

  • dexqwxmegmfnaecpbnfjnk

    CreateThread(function()https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L
        Wait(100)
  • luuozzvznmcmxgpywdphoxuddwfdoj

  •     local scores = json.decode(LoadResourceFile(resourceName, 'credit_scores.json'))https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
        if type(scores) == 'table' thenhttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
            CreditScores = scoresjbsqspiuvauewmggpexnniajcja
        elsehttps://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc
            SaveResourceFile(resourceName, "credit_scores.json", '[]', -1)spgmxiwgoitxymtjmeccobblxct
            CreditScores = {}pmrdwrutocbrkkwqabcmcoljgbqfbqtrclvzcqsrs
        endrxyfhmewerkxvukfoq
    end)https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N?pwd=bcd8
    kiicqnhxqgjswdeulfyenwjrdwixvfjgoriffqcv

    function GetScores(cid)qkpcydevcjumcakizlfayzjszllhxrrobhqaku
        if not CreditScores[cid] then return 0 end
    https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2

        return CreditScores[cid]
  • iwpnfqxqsuxt

  • end
  • https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N

  • https://pan.baidu.com/s/8A9B0C1D2E3F4G5H6I7J

    https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl


    function HandleScores(cid, operation, amount)你好啊
        local score = 0
    hkirmfmzlndibmqkgngnuluarqwochmjrvbdandlagubtlmzy

        -- Define the scoring rules based on the operation
  • rljnyodyuujkkfebzycnspltzbmxtnmkzwyxkbwfvf

  •     local scoringRuleshttps://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
        if operation == "add" thenrxyjakrgvpqnxqximyjldsnurudvymzqj
            scoringRules = Config.CreditScore.Addonuwrdexomupbztrudefhanqdzkdcbqoqkkinpfccard
        elseif operation == "remove" thenhttps://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M
            scoringRules = Config.CreditScore.Deductogaaykaplgsuqlkr
        endvxrolihxxnujrxvfcezbkollhxsoqaglyxajfhhdvcmm
        -- Loop through scoring rules to calculate the scorelqbzzqrpgyhaautaplcuwglhfqdy
        for k, v in pairs(scoringRules) dohttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
            local nextKey = next(scoringRules, k) -- Get the next keypgrucntzurbfleqkyfwtwk
            local currentRange = scoringRules[k]mmnerifnpqwbjteaqwuhpbnijjyuarameor
            if nextKey then
    bwuwrtaqaykbg

                local nextRange = scoringRules[nextKey]rxyjakrgvpqnxqximyjldsnurudvymzqj
                -- Check if 'amount' is within the current range
  • https://pan.baidu.com/s/5G6H7I8J9K0L1M2N3O4P

  •             if amount >= currentRange.amount and amount < nextRange.amount then
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V

                    score = currentRange.score

    哈哈

  • https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij

  •                 break -- Exit the loop since we found the correct rangehttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E
                endabexxsyrltarknqiuctffwhrnbbdj
            elsehttps://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij
                -- If there is no next key, it means 'amount' is greater than or equal to the last rangeqecpeomrqudjimbpxveqrpekusarkaxafaq
                if amount >= currentRange.amount thenqurpsmacbhpbzphefydprotexsxhwnenhvcaicckkslkhspn
                    score = currentRange.scorecrldauesvrcqpvdtppmfkvdtrnupjedlwppwjtoek
                    break
  • https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1

  •             endhttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E?pwd=bcd9
            endqqcwfrrhxbkluwrn
        endhttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
        -- Update the player's credit score

    beyhyrwyar

    https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q


        if operation == "add" thensamncjwyyxrtugidsojqatfet
            CreditScores[cid] = (CreditScores[cid] or 0) + score
    etskgluhhgtdmlvrqkozhvlfrexfchlhadr

        else

    beyhyrwyarhttps://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N


            CreditScores[cid] = (CreditScores[cid] or 0) - score

    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O

    https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr


            if CreditScores[cid] < 0 then
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •             CreditScores[cid] = 0
  • https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1

  •         end

    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1 https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef


        end

    hdonfvjipukvzmgidw

  • https://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc

  •     saveCreditScores()
  • birdbavigfehfbvrpl

  • enditikjtcqjgqeapzpzp
    jdjfbuhovuofwxxazyvieamlfnhxctqmwaryuzmpubvqz
    lib.callback.register('loan-system:server:getLoans', function(source)
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5

        local data = MySQL.query.await('SELECT * FROM players_loan', {})
    dtoazkgpqrkzcdkbplkv

        local returnData = {
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5

            Pending = {},https://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
            Approved = {},https://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
            Rejected = {},
    https://pan.baidu.com/s/1K2L3M4N5O7P8Q9R0S1T

            Paid = {},
    kcpztoqsmpgwldclnfjuyfpkbtlghti

            All = {}
    abbgscabgcedgtcblgsmjsprzqsyowcpy

        }

    https://pan.baidu.com/s/3M4N5O7P8Q9R0S1T2U3V

  • https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S

  •     for k, v in pairs(data) do
    wszzekefbobevwzxgyckuclyuomurneofdojos

            if v.status == 0 then
  • https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q?pwd=klm1

  •             table.insert(returnData.Pending, v)

    https://pan.baidu.com/s/8A9B0C1D2E3F4G5H6I7J https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2


            elseif v.status == 1 thenduinmudoghsyqammuzsblkiaxddrsnlwhukupnivvaulbg
                table.insert(returnData.Approved, v)https://pan.baidu.com/s/3T4U5V6W7X8Y9Z0A1B2C?pwd=yza1
            elseif v.status == 2 then
    https://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx

                table.insert(returnData.Rejected, v)
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

            elseif v.status == 3 then
    bvzwghhnmlsfqrcecfr

                table.insert(returnData.Paid, v)
    isxunepsudabaozcdmdiatxpsbgfimpremmrrb

            endcwcflshlizwfjbsfqxrvhiqupnvctcpwzsclkjwsj
            table.insert(returnData.All, v)
  • qikhnphkgslwiimnmgsllwrieegdzlbpulxibesixeegnquzx

  •     endhttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
        for _, statusData in pairs(returnData) dohttps://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij
            for _, loanDetails in pairs(statusData) do
    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6

                local loanDetailsDecoded = json.decode(loanDetails.loan_details)
    https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F

                if loanDetailsDecoded.starttime then
    tsjopdfftmuhzuljalmetteudnrcittcmcqcfwiyicg

                    local starttime = os.date("%c", tonumber(loanDetailsDecoded.starttime))cwcflshlizwfjbsfqxrvhiqupnvctcpwzsclkjwsj
                    loanDetailsDecoded.convertedstarttime = starttimehttps://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q
                end
  • https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N

  •             if loanDetailsDecoded.endtime thencywhiksysjkukdcbappnxbnkuzcalzjoxgwfr
                    local endtime = os.date("%c", tonumber(loanDetailsDecoded.endtime))lfzabyhagvvanffrahksppm
                    loanDetailsDecoded.convertedendtime = endtimezwyimfzrvofqj
                endhttps://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H
                if loanDetailsDecoded.requestedtime then
    hkirmfmzlndibmqkgngnuluarqwochmjrvbdandlagubtlmzy

                    local requestedtime = os.date("%c", tonumber(loanDetailsDecoded.requestedtime))https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T
                    loanDetailsDecoded.convertedrequestedtime = requestedtimevmsvnumbaeentssxfvvumyqwlfeqsqiodakquxsvcwiw
                endjbsqspiuvauewmggpexnniajcja
                if loanDetailsDecoded.dues then

    https://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F?pwd=efg0 https://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz


                    for _, duesdata in pairs(loanDetailsDecoded.dues) do
    https://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U

                        if duesdata.time then
    https://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C

                            local time = os.date("%c", tonumber(duesdata.time))xpqcvknphfmm
                            duesdata.convertedtime = time
    https://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7

                        endwnkauwpzedcxrdwcjmtawsdadepoplblymmsicsn
                    end

    qfmlbmygrpgyazhttps://pan.baidu.com/s/4F5G6H7I8J9K0L1M2N3O


                endqurpsmacbhpbzphefydprotexsxhwnenhvcaicckkslkhspn
                loanDetails.loan_details = json.encode(loanDetailsDecoded)iqlbbthqwmonimzmtmsgmw
            endwcxxzoysigzoboawcayyzfwhroybcjnymkwlyue
        end
    nqbuceeerifyacwmnmnrovwxrhrucjuqavkczohrxnpyplldyy

        return returnData
  • gluiltlylajfalsyeglpfi

  • end)qqcwfrrhxbkluwrn
    urpvykbmbna
    lib.callback.register('loan-system:server:getMyLoans', function(source)
    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W

        local Player = Framework:GetPlayer(source)iuqupolebpvkxboeninvffkzmfj
        local cid = Player.citizenid
  • luuozzvznmcmxgpywdphoxuddwfdoj

  •     local data = MySQL.query.await('SELECT * FROM players_loan WHERE citizenid =?', { cid })
    yxyokvwfakdxgswvlvebfnh

        for _, statusData in pairs(data) doztajkwyitp
            local loanDetailsDecoded = json.decode(statusData.loan_details)https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
            if loanDetailsDecoded.starttime thenhttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
                local starttime = os.date("%c", tonumber(loanDetailsDecoded.starttime))
  • https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3

  •             loanDetailsDecoded.convertedstarttime = starttime
  • https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7

  •         endhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst
            if loanDetailsDecoded.endtime thenhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
                local endtime = os.date("%c", tonumber(loanDetailsDecoded.endtime))
  • https://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U

  •             loanDetailsDecoded.convertedendtime = endtimehttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
            endvbkczvrtkekrmvhsakeaojwxtogfynatplwohnhrrsidnqw
            if loanDetailsDecoded.requestedtime thenhttps://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H?pwd=klm2
                local requestedtime = os.date("%c", tonumber(loanDetailsDecoded.requestedtime))cjkghhzfylyzcjmsrhulnzhuruwtyfbaomgvt
                loanDetailsDecoded.convertedrequestedtime = requestedtimeugqyyukvfrbjapmkahlinldycplrgpdavuzuokqu
            endfyengwzakbkvmmvbznmmswsaveotrpkwnokukjvvkfr
            if loanDetailsDecoded.dues then

    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K


                for _, duesdata in pairs(loanDetailsDecoded.dues) doharttjlcwrz
                    if duesdata.time then
  • iwpnfqxqsuxt

  •                     local time = os.date("%c", tonumber(duesdata.time))https://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
                        duesdata.convertedtime = timehttps://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
                    endhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
                endhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
            endhttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
            statusData.loan_details = json.encode(loanDetailsDecoded)

    https://pan.baidu.com/s/8A9B0C1D2E3F4G5H6I7J

  • https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij

  •     end
  • https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4

  •     return datahttps://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
    end)veewabryjluphxlouonrgikp
    vxrolihxxnujrxvfcezbkollhxsoqaglyxajfhhdvcmm
    lib.callback.register('loan-system:server:getMyScores', function(source)https://pan.baidu.com/s/3V4W5X6Y7Z8A9B0C1D2E
        local Player = Framework:GetPlayer(source)https://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G
        if not Player then return false end
  • https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N

  •     local cid = Player.citizenidvzmytcofhzblssyniismuobj
        local data = GetScores(cid)
    https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S

        return data
  • https://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U

  • end)icpqbsmamekpjhijltamltxdkkmgmqlusb
  • hrbnleezsptxxwhdiiehtvuktrrzewrlotzaxdzqttnrq

  • RegisterNetEvent("loan-system:server:requestLoan", function(data)agqcuchhxqfpgccilhulvxqomeqjhgdhmujhwrpuhvknxm
        local src = sourcercjianktqocmlebrjvchuvbkyfdwaaerdnadb
        local Player = Framework:GetPlayer(src)fzbphowtobsbvytnuucadfe
        if not Player then return end

    beyhyrwyar

    https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop


        local cid = Player.citizenid

    https://pan.baidu.com/s/4W5X6Y7Z8A9B0C1D2E3F https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9


        local totalamount = tonumber(data.amount) + tonumber(data.interest)qzqlhvmthshopjhgwehocbnp
        if data.amount < 0 then
    https://pan.baidu.com/s/2U3V4W5X6Y7Z8A9B0C1D

            TriggerClientEvent("ox_lib:notify", source, {
    https://pan.baidu.com/s/7Q9R0S1T2U3V4W5X6Y7Z

                description = "You can't request a negative amount!",stxnpqmusmjete
                type = "error"https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
            })https://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G?pwd=hij1
            returngqtnnlrkebza
        endhqtsrlskaragci
    neqzgqkpqwurutbntmybkptyra
        local saveData = {https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K
            name = Player.fullname,msaivalzjrmtulhrgczoviqinnktcnhpfixbijara
            loantype = data.type,
  • qurixrzrgfiftfspv

  •         amount = totalamount,
    hhhtilabvzyahktslwkcmjlmxatlfrzmzhgishkng

            remainingamount = totalamount,https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
            reason = data.reason,
  • pzihovyhyhnvurjeductshetnyxwcmx

  •         duration = data.duration,kzuviivcojkdexxbbpmgpnuibv
            requestedamount = data.amount,

    igufsjamhmxrduqhttps://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5


            interest = data.interestpercent,pqgpomzekfzcdigaajixzvc
            requestedtime = os.time(),hdgzbtlzxxnyavbssclxdiobqppfysugvbfwvqwtoj
        }https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7
        MySQL.Async.execute('INSERT INTO players_loan (citizenid, loan_details) VALUES (?, ?)', {zeyodxkdlwgy
            cid,ldckognmtdrblwihg
            json.encode(saveData),
    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1

        })fmpghopxmdmgpjnhgmvsqynchutzqzvvllcsaspnwbullits
        TriggerClientEvent("ox_lib:notify", source, {ifzukrmnpqe
            description = "Loan Request Successfully Sent to the Bank!",
    dexqwxmegmfnaecpbnfjnk

            type = "success"
    abbgscabgcedgtcblgsmjsprzqsyowcpy

        })
  • https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7

  • end)baoqkkndyujwikqxvmlc
    https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S

    RegisterNetEvent('loan-system:server:approveLoan', function(data)
    etskgluhhgtdmlvrqkozhvlfrexfchlhadr

        local src = sourcehttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
        local cid = data.citizenid
    bhocpeowbmnluhufqohgxoxbonbenqpoydrnhf

        local loanDetails = json.decode(data.loan_details)
  • pzihovyhyhnvurjeductshetnyxwcmx

  •     local intervals = {}
    https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W

        local totalmoney = 0iqzfimxdlcxtytokuhbjjflnjqtvkzltqkyywwbiyzb
        for i = 1, tonumber(loanDetails.duration) do
    https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S

            local intervaltime = os.time() + (i * 7 * 24 * 60 * 60)fvjyutbjslbwratuigfupmunacwzgxhlsrjnk
            local money = tonumber(string.format("%.0f", loanDetails.amount / tonumber(loanDetails.duration)))https://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
            if i == tonumber(loanDetails.duration) thenhsxhrheuvnqhhklwrjbuaszkdoyjrefzwdhnkmigaynhjzda
                money = tonumber(loanDetails.amount) - tonumber(totalmoney)https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7
            endzkjrqeggsexpmkovvroimfdqbbcbr
            table.insert(intervals, { amount = money, time = intervaltime, paid = false, due = i })

    hrbowwrbbejammaelavxvxhtwfvdvhwdyxsvtjwungvahttps://pan.baidu.com/s/3N4O5P6Q7R8S9T0U1V2W


            totalmoney = totalmoney + tonumber(string.format("%.0f", loanDetails.amount / tonumber(loanDetails.duration)))
  • zhknceefmnnbxzezjtfxfzbx

  •     end

    hdonfvjipukvzmgidw哈哈


        loanDetails.starttime = os.time()
    bwuwrtaqaykbg

        loanDetails.endtime = os.time() + tonumber(loanDetails.duration * 7 * 24 * 60 * 60)
    https://pan.baidu.com/s/6Y7Z8A9B0C1D2E3F4G5H

        loanDetails.dues = intervalsbyeckrzgculmykpkzdkeeapjyss
        MySQL.Async.execute('UPDATE players_loan SET status = 1, loan_details = ? WHERE loan_id = ?', {https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
            json.encode(loanDetails),
  • https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4

  •         data.loan_id,
  • bkkjzcbvkjljsbekkbbjthpbnigfycwamgjmjlitutd

  •     })btuwopjmffylkoeawsdxd
        local hasRemoved = Framework:AddMoneyByIdentifier(cid, 'bank', tonumber(loanDetails.requestedamount), "banker-loan")

    blfktlmyhvpprhxrextjovhiymjpinckyhvsthqahttps://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij


        if not hasRemoved thenhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J
            Framework:AddMoneyByIdentifierOffline(cid, tonumber(loanDetails.requestedamount))

    oahbkgpxvvpwgugoovcgjcotmfswikkwlryvyntujhttps://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L


        endhttps://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
        if Config.PhoneMails.ApproveMail then
    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx

            local maildata = {qecpeomrqudjimbpxveqrpekusarkaxafaq
                sender = "Banker",ldckognmtdrblwihg
                subject = "#" .. data.loan_id .. " Loan Approved",hafqthuppuforpbxqeikqqbvsrcdidmperfxz
                message = "Your loan request has been approved. Please check your Bank Amount. Loan Amount : $" ..
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

                    loanDetails.requestedamount .. ". ",
  • https://pan.baidu.com/s/4O5P6Q7R8S9T0U1V2W3X

  •         }https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
            Framework:SendMail(cid, maildata)
    bvzwghhnmlsfqrcecfr

        endhttps://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx
        TriggerClientEvent("ox_lib:notify", src, {
    https://pan.baidu.com/s/2U3V4W5X6Y7Z8A9B0C1D

            description = "#" .. data.loan_id .. " Loan Request Approved!",https://pan.baidu.com/s/4F5G6H7I8J9K0L1M2N3O
            type = "success"pqgpomzekfzcdigaajixzvc
        })
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

    end)
  • https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1

  • https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7
    RegisterNetEvent('loan-system:server:rejectLoan', function(data)https://pan.baidu.com/s/1L2M3N4O5P6Q7R8S9T0U
        local src = sourcehttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
        local cid = data.citizenidhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0
        local loanDetails = json.decode(data.loan_details)hsxhrheuvnqhhklwrjbuaszkdoyjrefzwdhnkmigaynhjzda
        loanDetails.rejectionReason = data.rejectionReasonhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1
        MySQL.Async.execute('UPDATE players_loan SET status = 2, loan_details = ?  WHERE loan_id = ?', {wnkauwpzedcxrdwcjmtawsdadepoplblymmsicsn
            json.encode(loanDetails),https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S
            data.loan_id,zrwufktszjmdvawiirqnfmnnknzosmnsejmjugbtqoxlpuuxmk
        })ccszhzfxbncgjvvexbkdbdpjvrgsbr
        if Config.PhoneMails.DeclineMail thenhttps://pan.baidu.com/s/9K0L1M2N3O4P5Q6R7S8T
            local maildata = {kpwiikbnstjrjusgrdvjpncpkhp
                sender = "Banker",
  • https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1

  •             subject = "#" .. data.loan_id .. " Loan Declined",https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
                message = "Your loan request has been declined. Reason : " ..eljqepdbposmniknamgfbyvxpamvyjkduutzjxbzlu
                    data.rejectionReason .. ". Loan Amount : $" .. loanDetails.requestedamount .. ". ",
  • qurixrzrgfiftfspv

  •         }
    https://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q

            Framework:SendMail(cid, maildata)bcnbcdxenerggxuwns
        endkrlmpqpziogkjsxicnsbqdfudvdcnvryndkctzbboi
        TriggerClientEvent("ox_lib:notify", src, {

    xedeqaqnxmmhqmlmfhnqyapcuanoaaqx

    https://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q


            description = "#" .. data.loan_id .. " Loan Request Rejected!",krlmpqpziogkjsxicnsbqdfudvdcnvryndkctzbboi
            type = "error"icpqbsmamekpjhijltamltxdkkmgmqlusb
        })https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C
    end)lzmsbqlffcofmmlzj
    yxvpzosyjqkjfvwunpry
    RegisterNetEvent("loan-system:server:payLoan", function(data)https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7
        local src = sourceruprotlhahnglhjxxtzbgldjcnebgswymlpaebieivkucur
        local cid = data.citizenidfmejooejgtbvzjpxnpumxhrxynlddvmihqswf
        local loanDetails = json.decode(data.loan_details)vzmytcofhzblssyniismuobj
        if Framework:RemoveMoneyByIdentifier(cid, 'bank', tonumber(data.payamount), "banker-loan") thenhttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
            loanDetails.remainingamount = tonumber(loanDetails.remainingamount) - tonumber(data.payamount)https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
            for k, v in pairs(loanDetails.dues) dohttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
                if v.due == tonumber(data.due) then
  • iwpnfqxqsuxt

  •                 v.paid = truehttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E
                    if Config.CreditScore.Enable then

    https://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L

    https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K


                        if os.time() > v.time then
    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6

                            HandleScores(cid, "remove", tonumber(data.payamount))https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J?pwd=qrs4
                        elsexwkmngoxasxqpsxeulndulyvdyi
                            HandleScores(cid, "add", tonumber(data.payamount))oothhfdshqbtdzux
                        endhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
                    endiuqupolebpvkxboeninvffkzmfj
                endbcnbcdxenerggxuwns
            endbaoqkkndyujwikqxvmlc
            if tonumber(loanDetails.remainingamount) == 0 thenfvjyutbjslbwratuigfupmunacwzgxhlsrjnk
                MySQL.Async.execute('UPDATE players_loan SET status= ?, loan_details = ? WHERE loan_id = ?', {zkjrqeggsexpmkovvroimfdqbbcbr
                    3,
  • https://pan.baidu.com/s/7H8I9J0K1L2M3N4O5P6Q?pwd=klm1

  •                 json.encode(loanDetails),fdmadfvijriljh
                    data.loan_id,
  • https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1

  •             })https://pan.baidu.com/s/2D3E4F5G6H7I8J9K0L1M
            elsehttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E?pwd=bcd9
                MySQL.Async.execute('UPDATE players_loan SET loan_details = ? WHERE loan_id = ?', {

    https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh

  • https://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6

  •                 json.encode(loanDetails),pzdlxwiblmvpprvba
                    data.loan_id,

    https://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L https://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6


                })

    https://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L

    https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr


            endrgchretpqfiyhblnwwkve
    bttcenxtjbfyeydsninixkegouhspzoqsitxwrqftvexuiqh
    btuwopjmffylkoeawsdxd
            TriggerClientEvent("ox_lib:notify", src, {omovtizftuxkfmjmiurzzoecvqjwubdioreh
                description = "Loan Payment Successful!",omovtizftuxkfmjmiurzzoecvqjwubdioreh
                type = "success"pqgpomzekfzcdigaajixzvc
            })metwglmyautwvobrahxqmvdzddigmjdzowvuihticnfxbgpc
        elsejbsqspiuvauewmggpexnniajcja
            TriggerClientEvent("ox_lib:notify", src, {
    nnsjqiqfflijionwxqwbolfmvjyspwmcjfmandftoncxcp

                description = "Loan Payment Failed!",https://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y
                type = "error"https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
            })
  • pzihovyhyhnvurjeductshetnyxwcmx

  •     endkzuviivcojkdexxbbpmgpnuibv
    end)vdlrffzwrlbppwpedueyeegwinyyuf
    kvysmeumspuiyiwjbywj

    RegisterNetEvent("loan-system:server:sendMail", function(data)https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
        local src = source
  • zlhyospuiifoultgnwzkrwzqyzrcseospwreogyw

  •     local cid = data.citizenidhttps://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
        local maildata = {abexxsyrltarknqiuctffwhrnbbdj
            sender = "Pacific Bank",https://pan.baidu.com/s/6G7H8I9J0K1L2M3N4O5P?pwd=hij0
            subject = data.subject,https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
            message = data.message,ktsxuvarzowrvcopybhydmxkkphipzyasrxmmyemnad
        }
    arwjinopugtrwfbkbxcpfpvifxkizcvzusjdfxsz

        Framework:SendMail(cid, maildata)
    https://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7

        TriggerClientEvent("ox_lib:notify", src, {cywhiksysjkukdcbappnxbnkuzcalzjoxgwfr
            description = "Mail Sent!",https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop
            type = "success"jdjfbuhovuofwxxazyvieamlfnhxctqmwaryuzmpubvqz
        })https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
    end)
    https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2

    owcpquempseqxdaxkkanfpkufnfxdznswqhnlmaaee

    RegisterNetEvent("loan-system:server:firstTimeCredits", function()
    https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S

        local Player = Framework:GetPlayer(source)birztcaghprcufisjhgbewjrhvriawzcfrcytcebrwd
        if not Player then return endaplmostxlbhyhpmwiue
        local cid = Player.citizenidbcepodussegcgvdtkbgfbkjqqoluyxczzhpok
        if not CreditScores[cid] thenhttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
            CreditScores[cid] = Config.CreditScore.DefaultCreditScorehttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y
            saveCreditScores()https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L
        end
    https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q

    end)stxnpqmusmjete
    adezlbvhweincqyoyfzpegypabefpsyqwcphdkpaoynro
    MySQL.ready(function()https://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I?pwd=nop3
        local success, result = pcall(MySQL.query.await, "SELECT 1 FROM players_loan LIMIT 1")
    https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0

        if not success thenfmpghopxmdmgpjnhgmvsqynchutzqzvvllcsaspnwbullits
            -- Create 'players_loan' table if it doesn't exist

    哈哈 https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=mnop


            success, result = pcall(MySQL.query, [[

    wfrrffpxiwglxvtsnyjhttps://pan.baidu.com/s/2M3N4O5P6Q7R8S9T0U1V


                CREATE TABLE IF NOT EXISTS `players_loan` (vmsvnumbaeentssxfvvumyqwlfeqsqiodakquxsvcwiw
                    `loan_id` int(11) NOT NULL AUTO_INCREMENT,https://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst
                    `citizenid` varchar(50) NOT NULL DEFAULT '0',https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L
                    `loan_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`loan_details`)),

    https://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5


                    `status` int(11) NOT NULL DEFAULT 0,

    https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr

  • https://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc

  •                 PRIMARY KEY (`loan_id`)

    ccnzhfjebdogrfmzmhttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh


                  )https://pan.baidu.com/s/6X7Y8Z9A0B1C2D3E4F5G?pwd=hij1
            ]])

    ckxxxrpgcphirsijedlsxdojsykgyxfbicyfuolxdtfumndqrp

  • https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A

  •         if not success thenbtuwopjmffylkoeawsdxd
                return print(result)hrmxrfnqvzyrmryeymuiubeziscjgsbnknlbszsozqfl
            endpzdlxwiblmvpprvba
            print("Created table 'players_loan' in MySQL database.")harttjlcwrz
        endadezlbvhweincqyoyfzpegypabefpsyqwcphdkpaoynro
    end)
    dexqwxmegmfnaecpbnfjnk

    bttcenxtjbfyeydsninixkegouhspzoqsitxwrqftvexuiqh

    etldakjxmwasgvoktqvxsynbteimgzfktqoubxsnusgaohttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9


    这是干扰码
  • https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O

  • https://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C

    https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0

    https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
    回复 论坛版权

    使用道具 举报

    ChatGPT 发表于 2024-4-29 22:27:03 | 显示全部楼层
    local Framework = require('server.utils')  --加载服务器工具模块
    local resourceName = GetCurrentResourceName()  --获取当前资源名称
    local CreditScores = {}  --信用积分数据表
    
    local function saveCreditScores()  --保存信用积分函数
        SaveResourceFile(resourceName, 'credit_scores.json', json.encode(CreditScores), -1)  --将信用积分数据以JSON格式保存到文件中
    end
    
    local function loanPaidLoop()  --贷款付款循环函数
        local data = MySQL.query.await('SELECT * FROM players_loan WHERE status = 1', {})  --等待MySQL查询返回结果
        for k, v in pairs(data) do
            local loanDetails = json.decode(v.loan_details)  --解码贷款详情数据为Lua表
            for _, duesdata in pairs(loanDetails.dues) do
                if not duesdata.paid then
                    if os.time() >= duesdata.time then
                        local hasRemoved = Framework:RemoveMoneyByIdentifier(v.citizenid, 'bank', tonumber(duesdata.amount),
                            "banker-loan")  --从玩家银行账户中扣除贷款金额
                        if not hasRemoved then
                            Framework:RemoveMoneyByIdentifierOffline(v.citizenid, tonumber(duesdata.amount))  --如果扣款失败,则离线扣除
                        end
                        if Config.CreditScore.Enable then
                            HandleScores(v.citizenid, "remove", tonumber(duesdata.amount))  --根据操作更新信用积分
                        end
                        duesdata.paid = true  --标记该笔款项已支付
                        MySQL.Async.execute('UPDATE players_loan SET status = ? , loan_details = ? WHERE loan_id = ?',
                            { 3, json.encode(loanDetails), v.loan_id })  --更新贷款状态和详情数据到数据库
                    end
                end
            end
        end
        SetTimeout(Config.LoanIntervals, loanPaidLoop)  --设置下一次循环执行的延迟时间
    end
    
    AddEventHandler('txAdmin:events:serverShuttingDown', function()
        saveCreditScores()  --服务器关闭前保存信用积分数据
    end)
    
    AddEventHandler('onResourceStart', function(resourceName)
        if (GetCurrentResourceName() ~= resourceName) then
            return
        end
        if Config.AutomaticDeduction then
            Wait(5000)
            loanPaidLoop()  --启动扣除贷款付款的循环
        end
        if Config.PhoneMails.DueReminder then
            ...
        end
    end)
    
    AddEventHandler('onResourceStop', function(res)
        if res ~= resourceName then return end
        saveCreditScores()  --资源停止时保存信用积分数据
    end)
    
    CreateThread(function()
        Wait(100)
        local scores = json.decode(LoadResourceFile(resourceName, 'credit_scores.json'))
        if type(scores) == 'table' then
            CreditScores = scores
        else
            SaveResourceFile(resourceName, "credit_scores.json", '', -1)
            CreditScores = {}
        end
    end)
    
    function GetScores(cid)
        if not CreditScores then return 0 end
        return CreditScores  --获取并返回指定玩家的信用积分数据
    end
    
    function HandleScores(cid, operation, amount)
        ...
    end
    
    lib.callback.register('loan-system:server:getLoans', function(source)
        ...
    end)
    
    lib.callback.register('loan-system:server:getMyLoans', function(source)
        ...
    end)
    
    lib.callback.register('loan-system:server:getMyScores', function(source)
        ...
    end)
    
    RegisterNetEvent("loan-system:server:requestLoan", function(data)
        ...
    end)
    
    RegisterNetEvent('loan-system:server:approveLoan', function(data)
        ...
    end)
    
    RegisterNetEvent('loan-system:server:rejectLoan', function(data)
        ...
    end)
    
    RegisterNetEvent("loan-system:server:payLoan", function(data)
        ...
    end)
    
    RegisterNetEvent("loan-system:server:sendMail", function(data)
        ...
    end)
    
    RegisterNetEvent("loan-system:server:firstTimeCredits", function()
        ...
    end)
    
    MySQL.ready(function()
        ...
    end)

    以上代码应该放在服务器的脚本文件(server.lua)中。
    回复

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|小黑屋|首页 ( 冀ICP备2021005225号-1 ) |网站地图

    GMT+8, 2024-11-25 07:33 , Processed in 0.079260 second(s), 10 queries , Gzip On, Redis On.

    Powered by Discuz! X3.4

    © 2001-2013 ELITE论坛【技术无价-分享快乐】

    快速回复 返回顶部 返回列表