frnnfukncdnkxwvmwxdpmflrzkunkjipbwchrnutrhepezb
https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M
local Framework = require('server.utils')uldobfvwumrjcharhvvytxwupenvlqrgbvvdaqzvdrefyfx
local resourceName = GetCurrentResourceName()ltqrssbrehnzjbhwbqfhjuggluahxhciasaslcjqjxqszxp
local CreditScores = {}https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4
hmkpndqgpsqfcovv
local function saveCreditScores()pexpvrnlgkrgpgegxufzefiamc
SaveResourceFile(resourceName, 'credit_scores.json', json.encode(CreditScores), -1)zhehurjfyyqzmddechgdjgbqgmueuclujpb
endhttps://pan.baidu.com/s/5G6H7I8J9K0L1M2N3O4P
asfuqbpfgdbsttyvotypkyknpototqvuiaphttps://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I?pwd=nop3
local function loanPaidLoop()https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S
https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
local data = MySQL.query.await('SELECT * FROM players_loan WHERE status = 1', {})jsoyjwfjijysgimgofgsytgqwqafv
for k, v in pairs(data) dosydrwmupmbshhesiauimchalmbdikwkd
local loanDetails = json.decode(v.loan_details)https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M
for _, duesdata in pairs(loanDetails.dues) do这是干扰码
if not duesdata.paid thendhcsfnmvinbtzycpdwdsmbkafvgnlqipxlhcyuxhhyahxdx
if os.time() >= duesdata.time thenykdtrqmaftstonucdsvpcmmwulc https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D?pwd=yza8
local hasRemoved = Framework:RemoveMoneyByIdentifier(v.citizenid, 'bank', tonumber(duesdata.amount),https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij
"banker-loan")jtfgetcocxrzphuaxtqtdjavjrkfpwxzqdfuwijzfayv
if not hasRemoved thendiirbxdjghkdtlytxzjsykktsdpbyrrbaatcxwledwh
Framework:RemoveMoneyByIdentifierOffline(v.citizenid, tonumber(duesdata.amount))ohpbchkbsrpdyltxzziwttbb
endpyjrcwycpsnxvoejwmwztqkzkdcisgfifozhlykarxynlcwi
if Config.CreditScore.Enable theneagspoucimteuprzmnihsubadfrjhqqlrxd
HandleScores(v.citizenid, "remove", tonumber(duesdata.amount))rzxfunncqzasnekdovh
endmipgniwpifnvjdmwhioikqgzvdxwykjlszsfiouq
duesdata.paid = truebinztqtkggkmadfoqzrusmk
MySQL.Async.execute('UPDATE players_loan SET status = ? , loan_details = ? WHERE loan_id = ?',dejsdtpjdxscqykdfzimshf
{ 3, json.encode(loanDetails), v.loan_id })iilcjqogeicfetmmeqabgobftpgjdn
endebgpzzqixqgvaaburl https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
endhttps://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X?pwd=hij2
endednffxvjjpdsbgohvhuwkjnnbgtdbwkgzxl
endouucruihkkzyddnlyuplpvkimimehynvshyk https://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N
SetTimeout(Config.LoanIntervals, loanPaidLoop)fxyrdpppukyyukiatapcyejrbkfdzg
endhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L
https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5
AddEventHandler('txAdmin:events:serverShuttingDown', function()hgnbhgqpvrsdctvtiyruspurxrlqsmgattbbasqvki
saveCreditScores()npxvfdmplcfwqqnkvksqtbjcbwmdbkgpa
end)ypwshugoebqprhgaldpkxktafszetmnrckkjeqhttps://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx
damijjplwykyshzbmatqd
AddEventHandler('onResourceStart', function(resourceName)xbpyhkplpzdsstbwquyhtjkyitkaa
if (GetCurrentResourceName() ~= resourceName) thenhttps://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
returnrzxfunncqzasnekdovh
endftkbrojocscoydmhbtesiltrzoyxltmqnwsflctouv
if Config.AutomaticDeduction thenhttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
Wait(5000)https://pan.baidu.com/s/4O5P6Q7R8S9T0U1V2W3X
loanPaidLoop()gwpznfkxukehwffyua
end --启动扣除贷款付款的循环https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
if Config.PhoneMails.DueReminder then -- 启动循环以在脚本重启时发送贷款还款提醒https://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc
local data = MySQL.query.await('SELECT * FROM players_loan WHERE status = 1', {})zysoxzynknmogfhibyczfviqurjfskwrjofgnetyrgm
for k, v in pairs(data) doxvbdvjtgdarw
local loanDetails = json.decode(v.loan_details)mxsglwqfokssdalurvutyzbgyuoggdh
for _, duesdata in pairs(loanDetails.dues) doebgpzzqixqgvaaburl https://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z
if not duesdata.paid thenmmmcpclyzbkvzhlhwacnjheqipwwnqkzdwctzorzp
if os.time() >= (duesdata.time - (Config.PhoneMails.Time * 24 * 60 * 60)) and os.time() < duesdata.time thenbinztqtkggkmadfoqzrusmk
-- convert dues.time into dateikicxtenofnlsmx
local date = os.date("%d-%m-%Y %H:%M:%S", duesdata.time)hirqzrupunnecujmc
local maildata = {imdmyztgncrejramoxlzhwrhpwpdrgxasamragyniqsrhs
sender = "Banker",nbfjzgquwxruxskyqroibbrbvqh
subject = "#" .. v.loan_id .. " Loan Payment Reminder",mcufltxflmadjroakagktamuaelwouwawrghkdnwqozzfnapohhttps://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W
message = "You have a loan payment due . Please visit the bank to pay your loan before " ..https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
date .. ". Payment Amount : $" .. duesdata.amount .. ". ",https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q
}qzqugzywdtyvzbmxpdjjexqjtaipbyrs
Framework:SendMail(v.citizenid, maildata)mugosjnyewozoyfgjbxspdzchtazz
endourbphnqzuxengeiorlwrxisaq
endbabbghigsnspmiidawmaualbpvzarvhtwiuchttps://pan.baidu.com/s/4O5P6Q7R8S9T0U1V2W3X
endhttps://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2
enduisleesgejygsexupkjpjpib
endoxisluwedohdybkcanvqlltvgzqvkllyiurtonyrcg
end)https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
AddEventHandler('onResourceStop', function(res)asfuqbpfgdbsttyvotypkyknpototqvuiaphttps://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
if res ~= resourceName then return endjdoepkmrfwyntkcctzyuzbppldrqqhuzk
saveCreditScores()https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4
end)https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
ouucruihkkzyddnlyuplpvkimimehynvshykhttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
CreateThread(function()sryxzjzknzsramsrjds
Wait(100)https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
local scores = json.decode(LoadResourceFile(resourceName, 'credit_scores.json'))arsxfcqfmylzhqgchttps://pan.baidu.com/s/4F5G6H7I8J9K0L1M2N3O
if type(scores) == 'table' thenbpseytzmgfcsingxhhsaiujkozcqtpcveuzcozp
CreditScores = scoreshttps://pan.baidu.com/s/9K0L1M2N3O4P5Q6R7S8T
elsehttps://pan.baidu.com/s/1K2L3M4N5O7P8Q9R0S1T
SaveResourceFile(resourceName, "credit_scores.json", '[]', -1)hlugzcjzlgwvbohnajifspzxrntvdhhttps://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I?pwd=nop3
CreditScores = {}https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O
https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M
endourbphnqzuxengeiorlwrxisaq
end)https://pan.baidu.com/s/4F5G6H7I8J9K0L1M2N3O
https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
function GetScores(cid)ourbphnqzuxengeiorlwrxisaq
if not CreditScores[cid] then return 0 endcnqrakcwygxlohudsrccqukpvwqpnugpiwhigjefqbq
return CreditScores[cid]diirbxdjghkdtlytxzjsykktsdpbyrrbaatcxwledwh
enddbtsjujdnkancsvnwhdsaxyryxnxqzhuaamjvw
https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
function HandleScores(cid, operation, amount)cmuldfyoatftpzzpnudbgcpluqibvrvydpjguhuvbaoqzn
local score = 0https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
-- Define the scoring rules based on the operationhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
local scoringRulesheuqckvzjrvjpxqgzbagniqh
if operation == "add" thenhttps://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1
scoringRules = Config.CreditScore.Addonhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
elseif operation == "remove" thenhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9
scoringRules = Config.CreditScore.Deductlerzncrsxjxfjwktqqwfonxwmgzciyttdktrmkkkthq
endhttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C?pwd=wxy7
-- Loop through scoring rules to calculate the scoreasfvzmwwokunvvnftkpwmzjjmylkaayatdwsqspfd
for k, v in pairs(scoringRules) dohttps://pan.baidu.com/s/9Z0A1B2C3D4E5F6G7H8I?pwd=pqr7
local nextKey = next(scoringRules, k) -- Get the next keypfijygqdsnbkvpxonhlrqgtfymbfnjwcoelnlcqdqso
local currentRange = scoringRules[k]https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
if nextKey thenuldobfvwumrjcharhvvytxwupenvlqrgbvvdaqzvdrefyfx
local nextRange = scoringRules[nextKey]https://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C
-- Check if 'amount' is within the current rangekgopsusqlxpzchsdrbxrpubvqr
if amount >= currentRange.amount and amount < nextRange.amount thenaoahwcroiu
score = currentRange.scorehlkfjafwdiafqgjamlqtykxsmimwxoafz
break -- Exit the loop since we found the correct rangetxzbkswjoyigqif
endhttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
elsehttps://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz
-- If there is no next key, it means 'amount' is greater than or equal to the last rangecmuldfyoatftpzzpnudbgcpluqibvrvydpjguhuvbaoqzn
if amount >= currentRange.amount thenhttps://pan.baidu.com/s/4N5O7P8Q9R0S1T2U3V4W
score = currentRange.scorepevrvzaghbksgdxunxfnnehjsjbnuatjfo
breakhttps://pan.baidu.com/s/1C2D3E4F5G6H7I8J9K0L
endhttps://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C
endmipgniwpifnvjdmwhioikqgzvdxwykjlszsfiouq
endhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
-- Update the player's credit scorehttps://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
if operation == "add" thenhttps://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
CreditScores[cid] = (CreditScores[cid] or 0) + scorehttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N
elsehttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
CreditScores[cid] = (CreditScores[cid] or 0) - scoresboyrghunfnkzzzuczkd
if CreditScores[cid] < 0 thenhttps://pan.baidu.com/s/5P6Q7R8S9T0U1V2W3X4Y
CreditScores[cid] = 0asedxlkzpmukw
enducgnmwmbjmprr
endtxzbkswjoyigqif
saveCreditScores()https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
endhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
bhxxgurfmlb
lib.callback.register('loan-system:server:getLoans', function(source)tiijthuwjcpqhxwwxdhwoinlgbxixgxrpgajougyxv
local data = MySQL.query.await('SELECT * FROM players_loan', {})https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K
local returnData = {https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
Pending = {},https://pan.baidu.com/s/5V6W7X8Y9Z0A1B2C3D4E?pwd=efg3
Approved = {},mnnqdiypewzvvzychqbkugmhjutrcdto
Rejected = {},upkgwggytqg
Paid = {},yysdxwigxuiirhyivuxzlernqtik
All = {}cyibezftdxsyeqthqdjqvwgtwovrchoffxgkwmdzjvxnmrvc
}https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L
for k, v in pairs(data) dohttps://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I
if v.status == 0 thenvtzdjwaewgakqicmjvzycpysxptalyqhsqkbnlfjrgt
table.insert(returnData.Pending, v)https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4
elseif v.status == 1 thenhttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E
table.insert(returnData.Approved, v)damijjplwykyshzbmatqd
elseif v.status == 2 thenhttps://pan.baidu.com/s/9Q0R1S2T3U4V5W6X7Y8Z?pwd=mnop
table.insert(returnData.Rejected, v)xtzxxsvfukdndyigzgezyfzwlfrijbhgvgeszzytkbgoapuzw
elseif v.status == 3 thennijpolfzgviirze
table.insert(returnData.Paid, v)imfhlbleahdbubrxlabirlcrurttj
endiwppntbdpiubwvcxebdliuhvawdohdgpavfnpgqfplhlhttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
table.insert(returnData.All, v)https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv
endrfkmpqbfjvxagvqgxxzapbyhqsjmiauzgemw
for _, statusData in pairs(returnData) doaoahwcroiu
for _, loanDetails in pairs(statusData) dohttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
local loanDetailsDecoded = json.decode(loanDetails.loan_details)https://pan.baidu.com/s/8A9B0C1D2E3F4G5H6I7J
if loanDetailsDecoded.starttime thenhttps://pan.baidu.com/s/2S3T4U5V6W7X8Y9Z0A1B?pwd=uvwx
https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J
local starttime = os.date("%c", tonumber(loanDetailsDecoded.starttime))vazwmzmdbamckbcuwmqesn
loanDetailsDecoded.convertedstarttime = starttimeyweanxxwdiszxinnbkgokbondrze
endxicnofbkapdmdlsbrhttps://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc
if loanDetailsDecoded.endtime thenzysoxzynknmogfhibyczfviqurjfskwrjofgnetyrgm
local endtime = os.date("%c", tonumber(loanDetailsDecoded.endtime))你好啊
https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9
loanDetailsDecoded.convertedendtime = endtimehttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8
endtghfbgmimtkm
if loanDetailsDecoded.requestedtime thenhttps://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K
local requestedtime = os.date("%c", tonumber(loanDetailsDecoded.requestedtime))ikujsambtlaxvuymmpzoryqdqjixpmvywphppuqifrgblfnxu
loanDetailsDecoded.convertedrequestedtime = requestedtimeokupngvzvohsnfguxfkiapwdbnl
endborolykkczxjnnzvenbjzuvqoiuvvqnwfflrdvbfvypj
if loanDetailsDecoded.dues thenhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
for _, duesdata in pairs(loanDetailsDecoded.dues) dohfqefawdkhxckmdieukfudhsztxd
if duesdata.time thenuldobfvwumrjcharhvvytxwupenvlqrgbvvdaqzvdrefyfx
local time = os.date("%c", tonumber(duesdata.time))https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
duesdata.convertedtime = timehttps://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh
enddtykogejhfyyfmfsuohjam
endjqcmpraziegugntiogsnuubnqytljrwthyfxqf
endfkmphdtduznpchxvexxpptyeshljpqgubtkiwdmqdzgfhdbma
loanDetails.loan_details = json.encode(loanDetailsDecoded)tseyeixhbnjzbtwbi
endugurjjlcvxqtzhthc
endhttps://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst
return returnDatazxrtitljcyjvpcfwiqiiunxlmogfbqabnrvwlgfnfoiuqoqhttps://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9
end)nxtadfgkcligiwvhxwlhnwknwkivcxrpvlpyqwjshszqovxm
uisleesgejygsexupkjpjpib
lib.callback.register('loan-system:server:getMyLoans', function(source)syffezquvdtfmfdyqeyofrsbkitznxkgwpmaoc https://pan.baidu.com/s/8P9Q0R1S2T3U4V5W6X7Y?pwd=ijkl
local Player = Framework:GetPlayer(source)https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K
local cid = Player.citizenidvkghwlpijxw
local data = MySQL.query.await('SELECT * FROM players_loan WHERE citizenid =?', { cid })csrbxtaadlzvaxiqqxnxlundllslkjpmc
for _, statusData in pairs(data) dogdxgzipltglsayjiyhykpokhsvddqs https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J
local loanDetailsDecoded = json.decode(statusData.loan_details)cyibezftdxsyeqthqdjqvwgtwovrchoffxgkwmdzjvxnmrvc
if loanDetailsDecoded.starttime thenjsrgrcmmvldyuipeszrffpylkexaqxuaqmhiptuleyjzgz
local starttime = os.date("%c", tonumber(loanDetailsDecoded.starttime))https://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K?pwd=tuv5
loanDetailsDecoded.convertedstarttime = starttimehttps://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
endbpseytzmgfcsingxhhsaiujkozcqtpcveuzcozp
if loanDetailsDecoded.endtime thenhttps://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K?pwd=tuv5
local endtime = os.date("%c", tonumber(loanDetailsDecoded.endtime))https://pan.baidu.com/s/3M4N5O7P8Q9R0S1T2U3V
loanDetailsDecoded.convertedendtime = endtimeiqrczackmdgrlihyjntcvf
endyxuystwmltdqnlupnzsbnqnoxf
if loanDetailsDecoded.requestedtime thenourbphnqzuxengeiorlwrxisaq
local requestedtime = os.date("%c", tonumber(loanDetailsDecoded.requestedtime))mmmcpclyzbkvzhlhwacnjheqipwwnqkzdwctzorzp
loanDetailsDecoded.convertedrequestedtime = requestedtimecuarqgpjodhidpevcrfcryoqmtbnhfvjzvbq
endjqcmpraziegugntiogsnuubnqytljrwthyfxqf
if loanDetailsDecoded.dues thenhttps://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E
for _, duesdata in pairs(loanDetailsDecoded.dues) dohttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
if duesdata.time thenhttps://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
local time = os.date("%c", tonumber(duesdata.time))txzbkswjoyigqif
duesdata.convertedtime = timehttps://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5
endikicxtenofnlsmx
endqqiuljtvodhgc
endwyhesiesvbiomjapnmflpqelywjombsja
statusData.loan_details = json.encode(loanDetailsDecoded)tjwnoakyxxjedkcqrsedchylitmsiuibefptgzrdxbh
end你好啊
https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
return datapepsvhwsdxwyhqelqwhrmnaabjyfghqwmgohoka
end)https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R
tsaxzsshldmpwsufrbywytl
lib.callback.register('loan-system:server:getMyScores', function(source)https://pan.baidu.com/s/1S2T3U4V5W6X7Y8Z9A0B?pwd=tuv6
local Player = Framework:GetPlayer(source)mivwjubsvrockhqvstvzjfbojkrevsehazektfcpxrrhyidqczhttps://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=efgh
if not Player then return false endhttps://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1
local cid = Player.citizenidhttps://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N
local data = GetScores(cid)https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5
return datasnanrrwrpblylzkbbipoiloxafqqbroteohvgenvfytqydszm
end)oercgabbvrpelkzcyvhegyhcznyydhlrmdtsevua
lerzncrsxjxfjwktqqwfonxwmgzciyttdktrmkkkthq
RegisterNetEvent("loan-system:server:requestLoan", function(data)gdxgzipltglsayjiyhykpokhsvddqshttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst
local src = sourcemjwoargtkpfchdagmz
local Player = Framework:GetPlayer(src)https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=uvwx
if not Player then return endbabbghigsnspmiidawmaualbpvzarvhtwiuchttps://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U
local cid = Player.citizenidhttps://pan.baidu.com/s/2T3U4V5W6X7Y8Z9A0B1C
local totalamount = tonumber(data.amount) + tonumber(data.interest)npxvfdmplcfwqqnkvksqtbjcbwmdbkgpa
if data.amount < 0 thennclisqlvgemznjiqxwvzgwokisvatnpgpapiqbdwf https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8
TriggerClientEvent("ox_lib:notify", source, {mnnqdiypewzvvzychqbkugmhjutrcdto
description = "You can't request a negative amount!",https://pan.baidu.com/s/8Z9A0B1C2D3E4F5G6H7I
type = "error"https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S
})https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
returnjdoepkmrfwyntkcctzyuzbppldrqqhuzk
endhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U?pwd=yza9
upkgwggytqg
local saveData = {tlohgxgvmkwvqfcdpsqt
name = Player.fullname,https://pan.baidu.com/s/9J0K1L2M3N4O5P6Q7R8S
loantype = data.type,qdxgcpkroykpnihtpbgvpqvoqprpaudrybxarisghc
amount = totalamount,https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1
remainingamount = totalamount,qqiuljtvodhgc
reason = data.reason,qdxgcpkroykpnihtpbgvpqvoqprpaudrybxarisghc
duration = data.duration,oercgabbvrpelkzcyvhegyhcznyydhlrmdtsevua
requestedamount = data.amount,https://pan.baidu.com/s/2L3M4N5O7P8Q9R0S1T2U
interest = data.interestpercent,https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
requestedtime = os.time(),https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
}zhehurjfyyqzmddechgdjgbqgmueuclujpb
MySQL.Async.execute('INSERT INTO players_loan (citizenid, loan_details) VALUES (?, ?)', {https://pan.baidu.com/s/9R0S1T2U3V4W5X6Y7Z8A
cid,xxygxrgphmjowrhttps://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef
json.encode(saveData),https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
})qnprultlzb
TriggerClientEvent("ox_lib:notify", source, {jjlkmxtheoharwhvdxvycinjztykakrjtdtg
description = "Loan Request Successfully Sent to the Bank!",cuarqgpjodhidpevcrfcryoqmtbnhfvjzvbq
type = "success"https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
})https://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
end)ebbecooylahsodbu
https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
RegisterNetEvent('loan-system:server:approveLoan', function(data)qdxgcpkroykpnihtpbgvpqvoqprpaudrybxarisghc
local src = sourcehttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
local cid = data.citizeniduhpewsxxylfuszrcjeqkkjnmgxtgvflqma
local loanDetails = json.decode(data.loan_details)https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O
https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y
local intervals = {}npxvfdmplcfwqqnkvksqtbjcbwmdbkgpa
local totalmoney = 0mcjfpsjzhvphpxosclnukgvfzzotux
for i = 1, tonumber(loanDetails.duration) dohttps://pan.baidu.com/s/9J0K1L2M3N4O5P6Q7R8S
local intervaltime = os.time() + (i * 7 * 24 * 60 * 60)https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
local money = tonumber(string.format("%.0f", loanDetails.amount / tonumber(loanDetails.duration)))https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
if i == tonumber(loanDetails.duration) thensydrwmupmbshhesiauimchalmbdikwkd
money = tonumber(loanDetails.amount) - tonumber(totalmoney)uisleesgejygsexupkjpjpib
enducgnmwmbjmprr
table.insert(intervals, { amount = money, time = intervaltime, paid = false, due = i })https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q
totalmoney = totalmoney + tonumber(string.format("%.0f", loanDetails.amount / tonumber(loanDetails.duration)))https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef
endhpndmauxaxucruqitglovvuscbrwr
loanDetails.starttime = os.time()ilavtlnjsgoqspwfysinxtaiwrmnkazslzoelbod
loanDetails.endtime = os.time() + tonumber(loanDetails.duration * 7 * 24 * 60 * 60)这是干扰码
loanDetails.dues = intervalsbdupkzxyqiuigdbguedwkwnlggaymhpnlkdvjauajpi
MySQL.Async.execute('UPDATE players_loan SET status = 1, loan_details = ? WHERE loan_id = ?', {tseyeixhbnjzbtwbi
json.encode(loanDetails),https://pan.baidu.com/s/4M5N6O7P8Q9R0S1T2U3V?pwd=bcd0
data.loan_id,iqrczackmdgrlihyjntcvf
})jsoyjwfjijysgimgofgsytgqwqafv
local hasRemoved = Framework:AddMoneyByIdentifier(cid, 'bank', tonumber(loanDetails.requestedamount), "banker-loan")不要乱来哦
https://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
if not hasRemoved thenzveyrpejynlgtgmyzmxygiznwadqzzozvsxnibwhphnioagom
Framework:AddMoneyByIdentifierOffline(cid, tonumber(loanDetails.requestedamount))tjwnoakyxxjedkcqrsedchylitmsiuibefptgzrdxbh
endmogbvhtspov
if Config.PhoneMails.ApproveMail thenhttps://pan.baidu.com/s/5O7P8Q9R0S1T2U3V4W5X
local maildata = {https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
sender = "Banker",wfaeoyrrpybkzjwhtkkwf https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R?pwd=qrs6
subject = "#" .. data.loan_id .. " Loan Approved",chdrneepywqk
message = "Your loan request has been approved. Please check your Bank Amount. Loan Amount : $" ..https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R
loanDetails.requestedamount .. ". ",https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
}https://pan.baidu.com/s/6Y7Z8A9B0C1D2E3F4G5H
Framework:SendMail(cid, maildata)hcexvszsautdjuvi
endcyibezftdxsyeqthqdjqvwgtwovrchoffxgkwmdzjvxnmrvc
TriggerClientEvent("ox_lib:notify", src, {rzxfunncqzasnekdovh
description = "#" .. data.loan_id .. " Loan Request Approved!",zysoxzynknmogfhibyczfviqurjfskwrjofgnetyrgm
type = "success"jijjiyzaaamnupupcdllylxfrymcjztthdcqbcqcccpw
})https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
end)https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
https://pan.baidu.com/s/5F6G7H8I9J0K1L2M3N4O?pwd=efg9
https://pan.baidu.com/s/4D5E6F7G8H9I0J1K2L3M?pwd=bcd1
RegisterNetEvent('loan-system:server:rejectLoan', function(data)ourbphnqzuxengeiorlwrxisaq
local src = sourcesrhskcbqquiduxswdovjrtaofanbtrbmiietkgkbbtewqwtulo
local cid = data.citizenidpepsvhwsdxwyhqelqwhrmnaabjyfghqwmgohoka
local loanDetails = json.decode(data.loan_details)damijjplwykyshzbmatqd
loanDetails.rejectionReason = data.rejectionReasonhttps://pan.baidu.com/s/5W6X7Y8Z9A0B1C2D3E4F?pwd=efg0
MySQL.Async.execute('UPDATE players_loan SET status = 2, loan_details = ? WHERE loan_id = ?', {https://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C
json.encode(loanDetails),pyuvocsvkz
data.loan_id,https://pan.baidu.com/s/8G9H0I1J2K3L4M5N6O7P?pwd=zabc
})ztumroflmxdaiqlnkvurtwufanvnolyofsaxgfi
if Config.PhoneMails.DeclineMail thenhttps://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
local maildata = {zgwfnhnqvckxmzqdszyljucygdxugghttps://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
sender = "Banker",qqiuljtvodhgc
subject = "#" .. data.loan_id .. " Loan Declined",https://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz
message = "Your loan request has been declined. Reason : " ..https://pan.baidu.com/s/6H7I8J9K0L1M2N3O4P5Q
data.rejectionReason .. ". Loan Amount : $" .. loanDetails.requestedamount .. ". ",frnnfukncdnkxwvmwxdpmflrzkunkjipbwchrnutrhepezb
}zxrtitljcyjvpcfwiqiiunxlmogfbqabnrvwlgfnfoiuqoq https://pan.baidu.com/s/1R2S3T4U5V6W7X8Y9Z0A?pwd=qrst
Framework:SendMail(cid, maildata)imdmyztgncrejramoxlzhwrhpwpdrgxasamragyniqsrhs
endqnprultlzb
TriggerClientEvent("ox_lib:notify", src, {mogbvhtspov
description = "#" .. data.loan_id .. " Loan Request Rejected!",https://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z?pwd=nop4
type = "error"https://pan.baidu.com/s/6N7O8P9Q0R1S2T3U4V5W?pwd=abcd
})tiijthuwjcpqhxwwxdhwoinlgbxixgxrpgajougyxv
end)syhfmxxrhnmsykxdiucpstvhai
https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
RegisterNetEvent("loan-system:server:payLoan", function(data)https://pan.baidu.com/s/7Y8Z9A0B1C2D3E4F5G6H?pwd=klm2
local src = sourcehsmrrkvuyhtswfirpqdxdiebvaudyfe
local cid = data.citizenidcmuldfyoatftpzzpnudbgcpluqibvrvydpjguhuvbaoqzn
local loanDetails = json.decode(data.loan_details)https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8
if Framework:RemoveMoneyByIdentifier(cid, 'bank', tonumber(data.payamount), "banker-loan") thenimfhlbleahdbubrxlabirlcrurttj
loanDetails.remainingamount = tonumber(loanDetails.remainingamount) - tonumber(data.payamount)https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
for k, v in pairs(loanDetails.dues) doouiyppebjf
if v.due == tonumber(data.due) thenhttps://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T?pwd=wxy8
v.paid = truehttps://pan.baidu.com/s/8Q9R0S1T2U3V4W5X6Y7Z
https://pan.baidu.com/s/6O7P8Q9R0S1T2U3V4W5X?pwd=hij2
if Config.CreditScore.Enable thenhttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst
if os.time() > v.time thenhttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
HandleScores(cid, "remove", tonumber(data.payamount))iwppntbdpiubwvcxebdliuhvawdohdgpavfnpgqfplhl https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=ijkl
elsehttps://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
HandleScores(cid, "add", tonumber(data.payamount))ypzjwjkxcpttmmnxbraiurwzwlxsbiyayx
endbdupkzxyqiuigdbguedwkwnlggaymhpnlkdvjauajpi
endhttps://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N
endhttps://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef
endhttps://pan.baidu.com/s/3D4E5F6G7H8I9J0K1L2M?pwd=yza7
if tonumber(loanDetails.remainingamount) == 0 thenhttps://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z
MySQL.Async.execute('UPDATE players_loan SET status= ?, loan_details = ? WHERE loan_id = ?', {https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P
3,zgwfnhnqvckxmzqdszyljucygdxugghttps://pan.baidu.com/s/6P8Q9R0S1T2U3V4W5X6Y
json.encode(loanDetails),xmheaanozslosznxgwyeonhoqphqogemtmqtndhmw
data.loan_id,typaziesrplj
})https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
elseykdtrqmaftstonucdsvpcmmwulc https://pan.baidu.com/s/2U3V4W5X6Y7Z8A9B0C1D
MySQL.Async.execute('UPDATE players_loan SET loan_details = ? WHERE loan_id = ?', {xicnofbkapdmdlsbr https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
json.encode(loanDetails),vfbcinwecmgmuoesjxdibrbsjqzomznifpkncgsetyromvhwtl https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
data.loan_id,asfvzmwwokunvvnftkpwmzjjmylkaayatdwsqspfd
})pgjcdbgqrichytwumpudaq
endhttps://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y
diygqxotgcrtxiflwwopnptxsnzuzdcdlajc
pmhixmdrgkubhlhkodcvktzbzquyq
TriggerClientEvent("ox_lib:notify", src, {dijivwndffmhthhmqn
description = "Loan Payment Successful!",babbghigsnspmiidawmaualbpvzarvhtwiuchttps://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
type = "success"jsoyjwfjijysgimgofgsytgqwqafv
})https://pan.baidu.com/s/4E5F6G7H8I9J0K1L2M3N?pwd=bcd8
elsehttps://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=qrst
TriggerClientEvent("ox_lib:notify", src, {pniincsvhmsdnkahngxtyedqstpkkbcaokicmayunqxb
description = "Loan Payment Failed!",dqvhhawcoyylaakywjcbkmwmpcybp
type = "error"https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
})iwppntbdpiubwvcxebdliuhvawdohdgpavfnpgqfplhlhttps://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
endzatmbemhzsulicagniimdgtkfusdxpe
end)typaziesrplj
jsoyjwfjijysgimgofgsytgqwqafv
RegisterNetEvent("loan-system:server:sendMail", function(data)byrvnyveetafghakfmxyptrsoizxokgpjxlww
local src = sourcefrcknoaygsrblqjdh
local cid = data.citizenidhttps://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
local maildata = {ikicxtenofnlsmx
sender = "Pacific Bank",https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
subject = data.subject,qfjoniydxi
message = data.message,https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
}asedxlkzpmukw
Framework:SendMail(cid, maildata)ucgnmwmbjmprr
TriggerClientEvent("ox_lib:notify", src, {iilcjqogeicfetmmeqabgobftpgjdn
description = "Mail Sent!",mcufltxflmadjroakagktamuaelwouwawrghkdnwqozzfnapohhttps://pan.baidu.com/s/3M4N5O7P8Q9R0S1T2U3V
type = "success"https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=stu8
})vqbgoxhinqcszzdofwjlqdsimsvzwbyssaygxfokwrdwqgkvct
end)oxisluwedohdybkcanvqlltvgzqvkllyiurtonyrcg
https://pan.baidu.com/s/1J2K3L4M5N6O7P8Q9R0S?pwd=tuv7
RegisterNetEvent("loan-system:server:firstTimeCredits", function()tiijthuwjcpqhxwwxdhwoinlgbxixgxrpgajougyxv
local Player = Framework:GetPlayer(source)jijjiyzaaamnupupcdllylxfrymcjztthdcqbcqcccpw
if not Player then return endtiijthuwjcpqhxwwxdhwoinlgbxixgxrpgajougyxv
local cid = Player.citizeniddijivwndffmhthhmqn
if not CreditScores[cid] thentxzbkswjoyigqif
CreditScores[cid] = Config.CreditScore.DefaultCreditScorebdupkzxyqiuigdbguedwkwnlggaymhpnlkdvjauajpi
saveCreditScores()bdupkzxyqiuigdbguedwkwnlggaymhpnlkdvjauajpi
endchdrneepywqk
end)osjtleutthduxqgccvshhrdrfqsyat
https://pan.baidu.com/s/8I9J0K1L2M3N4O5P6Q7R
https://pan.baidu.com/s/4L5M6N7O8P9Q0R1S2T3U?pwd=stuv
MySQL.ready(function()frnnfukncdnkxwvmwxdpmflrzkunkjipbwchrnutrhepezb
local success, result = pcall(MySQL.query.await, "SELECT 1 FROM players_loan LIMIT 1")https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O
https://pan.baidu.com/s/2K3L4M5N6O7P8Q9R0S1T
if not success thenbabbghigsnspmiidawmaualbpvzarvhtwiuchttps://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
-- Create 'players_loan' table if it doesn't existgdxgzipltglsayjiyhykpokhsvddqs https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N
success, result = pcall(MySQL.query, [[https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5
CREATE TABLE IF NOT EXISTS `players_loan` (pevrvzaghbksgdxunxfnnehjsjbnuatjfo
`loan_id` int(11) NOT NULL AUTO_INCREMENT,https://pan.baidu.com/s/4V5W6X7Y8Z9A0B1C2D3E?pwd=bcd9
`citizenid` varchar(50) NOT NULL DEFAULT '0',fyizmfkytrdvidxwvsshzxvelezcspcxokxapizjzcfhgcdcuv
`loan_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`loan_details`)),https://pan.baidu.com/s/8Y9Z0A1B2C3D4E5F6G7H?pwd=mno6
`status` int(11) NOT NULL DEFAULT 0,https://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C
PRIMARY KEY (`loan_id`)diygqxotgcrtxiflwwopnptxsnzuzdcdlajc
)bhxxgurfmlb
)https://pan.baidu.com/s/7Z8A9B0C1D2E3F4G5H6I
if not success thenhsmrrkvuyhtswfirpqdxdiebvaudyfe
return print(result)https://pan.baidu.com/s/1T2U3V4W5X6Y7Z8A9B0C
endhttps://pan.baidu.com/s/3L4M5N6O7P8Q9R0S1T2U
print("Created table 'players_loan' in MySQL database.")hpndmauxaxucruqitglovvuscbrwr
endfxyrdpppukyyukiatapcyejrbkfdzg
end)tsaxzsshldmpwsufrbywytl
https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
mjwoargtkpfchdagmz
hsmrrkvuyhtswfirpqdxdiebvaudyfe
https://pan.baidu.com/s/3E4F5G6H7I8J9K0L1M2N
https://pan.baidu.com/s/8J9K0L1M2N3O4P5Q6R7S
https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
zyvedkdpvhmvyjqzadgiszddebndimhhk https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
https://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z
|