搜索
查看: 60|回复: 2
收起左侧

[有效回答] 汉化

[复制链接]

升级进度: 88%

zmx092800 发表于 2024-10-2 12:23:57 | 显示全部楼层 |阅读模式
ESX = nil



TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)


local invaderlist = {}

RegisterNetEvent('lifeinvader:instert')
AddEventHandler('lifeinvader:instert', function(text)

    local xPlayer = ESX.GetPlayerFromId(_source)
    table.insert(invaderlist, {name = GetPlayerName(_source), text = text })

end)

ESX.RegisterServerCallback('delion_tablet:getstarted', function(src, cb)
    local xPlayer = ESX.GetPlayerFromId(src)
    local xInfo = {}
    local vehicles = 0
    local properties = 0

            MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE owner = @identifier', {['@identifier'] = xPlayer.identifier}, function(result1)
                for i,k in pairs(result1) do
                    vehicles = vehicles + 1
                end
                xInfo.vehicles = vehicles

        MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE owner = @identifier', {['@identifier'] = xPlayer.identifier}, function(result2)
            for i,k in pairs(result2) do
                properties = properties + 1
            end
    xInfo.properties = properties

                MySQL.Async.fetchAll("SELECT firstname, lastname FROM users WHERE identifier = @identifier", { ["@identifier"] = xPlayer.identifier }, function(result)
                        xInfo.fullname = result[1].firstname .. ' ' .. result[1].lastname
                    cb(xInfo, serveritems)
                end)
             end)
          end)
end)
ESX.RegisterServerCallback('del_tablet:loadImmos', function(source, cb)
        local ownedImmos = {}
        local s = source
        local x = ESX.GetPlayerFromId(s)
       
        MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE `owner` = @owner', {['@owner'] = x.identifier}, function(properties)

                for _,v in pairs(properties) do
                        table.insert(ownedImmos, {name = v.name, rented = v.rented, price = v.price})
                end
                cb(ownedImmos)
        end)

end)

ESX.RegisterServerCallback('delion_tablet:loadVehicles', function(source, cb)
        local ownedCars = {}
        local s = source
        local x = ESX.GetPlayerFromId(s)
       
        MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE `owner` = @owner', {['@owner'] = x.identifier}, function(vehicles)

                for _,v in pairs(vehicles) do
                        local vehicle = json.decode(v.vehicle)
                        table.insert(ownedCars, {vehicle = vehicle, stored = v.stored, plate = v.plate})
                end
                cb(ownedCars)
        end)

end)

ESX.RegisterServerCallback('delion_tablet:loadUsers', function(source, cb)
        local userlist = {}
        local s = source
        local x = ESX.GetPlayerFromId(s)
       
        MySQL.Async.fetchAll('SELECT * FROM users WHERE `identifier` = @identifier', {['@identifier'] = x.identifier}, function(result)
                        table.insert(userlist, {bank = result[1].bank, firstname = result[1].firstname, lastname = result[1].lastname, job = result[1].job, job_grade = result[1].job_grade, phone_number = result[1].phone_number})
        end)
        Citizen.Wait(1000)
        cb(userlist)

end)


ESX.RegisterServerCallback('delion_tablet:invadermessages',function(source,cb)
    if invaderlist ~= nil then
        cb(invaderlist)
    end
end)

ESX.RegisterServerCallback('delion_tablet:getItemAmount', function(source, cb, item)
    local xPlayer = ESX.GetPlayerFromId(source)
    local qtty = xPlayer.getInventoryItem(item).count
    cb(qtty)
end)



RegisterServerEvent('bank:transfer')
AddEventHandler('bank:transfer', function(to, amountt)
    local _source = source
    local xPlayer = ESX.GetPlayerFromId(_source)
    local zPlayer = ESX.GetPlayerFromId(to)
    local balance = 0
    if zPlayer ~= nil and GetPlayerEndpoint(to) ~= nil then
        balance = xPlayer.getAccount('bank').money
        zbalance = zPlayer.getAccount('bank').money
        if tonumber(_source) == tonumber(to) then
         TriggerClientEvent(Config.notificationstrigger, _source, Config.notificationscolor, "BANKING", 'Du kannst dir selber kein Geld Überweisen!')
        else
            if balance <= 0 or balance < tonumber(amountt) or tonumber(amountt) <=
                0 then
                 TriggerClientEvent('notifications', _source, "red", "BANKING", 'Du hast zu wenig Geld!')
            else
                xPlayer.removeAccountMoney('bank', tonumber(amountt))
                zPlayer.addAccountMoney('bank', tonumber(amountt))
                TriggerClientEvent(Config.notificationstrigger, _source, Config.notificationscolor, "BANKING", 'Du überwest ' ..amountt.. '$ zur ID:' ..to.. '' )
                TriggerClientEvent(Config.notificationstrigger, to, Config.notificationscolor, "BANKING", 'Du bekommst ' ..amountt.. '$ von ' .._source.. '' )
            end

        end
    end

end)


回复 论坛版权

使用道具 举报

ChatGPT 发表于 2024-10-2 12:27:53 | 显示全部楼层
以下是您提供的代码的汉化版本:
ESX = nil

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

local invaderlist = {}

RegisterNetEvent('lifeinvader:instert')
AddEventHandler('lifeinvader:instert', function(text)
    local xPlayer = ESX.GetPlayerFromId(_source)
    table.insert(invaderlist, {name = GetPlayerName(_source), text = text })
end)

ESX.RegisterServerCallback('delion_tablet:getstarted', function(src, cb)
    local xPlayer = ESX.GetPlayerFromId(src)
    local xInfo = {}
    local vehicles = 0
    local properties = 0

    MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE owner = @identifier', {identifier = xPlayer.identifier}, function(result1)
        for i, k in pairs(result1) do
            vehicles = vehicles + 1
        end
        xInfo.vehicles = vehicles

        MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE owner = @identifier', {identifier = xPlayer.identifier}, function(result2)
            for i, k in pairs(result2) do
                properties = properties + 1
            end
            xInfo.properties = properties

            MySQL.Async.fetchAll("SELECT firstname, lastname FROM users WHERE identifier = @identifier", {identifier = xPlayer.identifier}, function(result)
                xInfo.fullname = result.firstname .. ' ' .. result.lastname
                cb(xInfo, serveritems)
            end)
        end)
    end)
end)

ESX.RegisterServerCallback('del_tablet:loadImmos', function(source, cb)
    local ownedImmos = {}
    local s = source
    local x = ESX.GetPlayerFromId(s)

    MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE `owner` = @owner', {owner = x.identifier}, function(properties)
        for _, v in pairs(properties) do
            table.insert(ownedImmos, {name = v.name, rented = v.rented, price = v.price})
        end
        cb(ownedImmos)
    end)
end)

ESX.RegisterServerCallback('delion_tablet:loadVehicles', function(source, cb)
    local ownedCars = {}
    local s = source
    local x = ESX.GetPlayerFromId(s)

    MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE `owner` = @owner', {owner = x.identifier}, function(vehicles)
        for _, v in pairs(vehicles) do
            local vehicle = json.decode(v.vehicle)
            table.insert(ownedCars, {vehicle = vehicle, stored = v.stored, plate = v.plate})
        end
        cb(ownedCars)
    end)
end)

ESX.RegisterServerCallback('delion_tablet:loadUsers', function(source, cb)
    local userlist = {}
    local s = source
    local x = ESX.GetPlayerFromId(s)

    MySQL.Async.fetchAll('SELECT * FROM users WHERE `identifier` = @identifier', {identifier = x.identifier}, function(result)
        table.insert(userlist, {bank = result.bank, firstname = result.firstname, lastname = result.lastname, job = result.job, job_grade = result.job_grade, phone_number = result.phone_number})
    end)
    Citizen.Wait(1000)
    cb(userlist)
end)

ESX.RegisterServerCallback('delion_tablet:invadermessages', function(source, cb)
    if invaderlist ~= nil then
        cb(invaderlist)
    end
end)

ESX.RegisterServerCallback('delion_tablet:getItemAmount', function(source, cb, item)
    local xPlayer = ESX.GetPlayerFromId(source)
    local qtty = xPlayer.getInventoryItem(item).count
    cb(qtty)
end)

RegisterServerEvent('bank:transfer')
AddEventHandler('bank:transfer', function(to, amountt)
    local _source = source
    local xPlayer = ESX.GetPlayerFromId(_source)
    local zPlayer = ESX.GetPlayerFromId(to)
    local balance = 0
    if zPlayer ~= nil and GetPlayerEndpoint(to) ~= nil then
        balance = xPlayer.getAccount('bank').money
        zbalance = zPlayer.getAccount('bank').money
        if tonumber(_source) == tonumber(to) then
            TriggerClientEvent(Config.notificationstrigger, _source, Config.notificationscolor, "银行", '你不能给自己转账!')
        else
            if balance

请注意,代码中的某些部分可能需要根据具体的上下文进行调整。以上是对代码的基本汉化,您可以根据需要进一步修改。
回复

使用道具 举报

ChatGPT 发表于 2024-10-2 12:31:56 | 显示全部楼层
以下是您提供的代码的汉化版本:
ESX = nil

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

local invaderlist = {}

RegisterNetEvent('lifeinvader:instert')
AddEventHandler('lifeinvader:instert', function(text)
    local xPlayer = ESX.GetPlayerFromId(_source)
    table.insert(invaderlist, {name = GetPlayerName(_source), text = text })
end)

ESX.RegisterServerCallback('delion_tablet:getstarted', function(src, cb)
    local xPlayer = ESX.GetPlayerFromId(src)
    local xInfo = {}
    local vehicles = 0
    local properties = 0

    MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE owner = @identifier', {['@identifier'] = xPlayer.identifier}, function(result1)
        for i, k in pairs(result1) do
            vehicles = vehicles + 1
        end
        xInfo.vehicles = vehicles

        MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE owner = @identifier', {['@identifier'] = xPlayer.identifier}, function(result2)
            for i, k in pairs(result2) do
                properties = properties + 1
            end
            xInfo.properties = properties

            MySQL.Async.fetchAll("SELECT firstname, lastname FROM users WHERE identifier = @identifier", {['@identifier'] = xPlayer.identifier}, function(result)
                xInfo.fullname = result.firstname .. ' ' .. result.lastname
                cb(xInfo, serveritems)
            end)
        end)
    end)
end)

ESX.RegisterServerCallback('del_tablet:loadImmos', function(source, cb)
    local ownedImmos = {}
    local s = source
    local x = ESX.GetPlayerFromId(s)

    MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE `owner` = @owner', {['@owner'] = x.identifier}, function(properties)
        for _, v in pairs(properties) do
            table.insert(ownedImmos, {name = v.name, rented = v.rented, price = v.price})
        end
        cb(ownedImmos)
    end)
end)

ESX.RegisterServerCallback('delion_tablet:loadVehicles', function(source, cb)
    local ownedCars = {}
    local s = source
    local x = ESX.GetPlayerFromId(s)

    MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE `owner` = @owner', {['@owner'] = x.identifier}, function(vehicles)
        for _, v in pairs(vehicles) do
            local vehicle = json.decode(v.vehicle)
            table.insert(ownedCars, {vehicle = vehicle, stored = v.stored, plate = v.plate})
        end
        cb(ownedCars)
    end)
end)

ESX.RegisterServerCallback('delion_tablet:loadUsers', function(source, cb)
    local userlist = {}
    local s = source
    local x = ESX.GetPlayerFromId(s)

    MySQL.Async.fetchAll('SELECT * FROM users WHERE `identifier` = @identifier', {['@identifier'] = x.identifier}, function(result)
        table.insert(userlist, {bank = result.bank, firstname = result.firstname, lastname = result.lastname, job = result.job, job_grade = result.job_grade, phone_number = result.phone_number})
    end)
    Citizen.Wait(1000)
    cb(userlist)
end)

ESX.RegisterServerCallback('delion_tablet:invadermessages', function(source, cb)
    if invaderlist ~= nil then
        cb(invaderlist)
    end
end)

ESX.RegisterServerCallback('delion_tablet:getItemAmount', function(source, cb, item)
    local xPlayer = ESX.GetPlayerFromId(source)
    local qtty = xPlayer.getInventoryItem(item).count
    cb(qtty)
end)

RegisterServerEvent('bank:transfer')
AddEventHandler('bank:transfer', function(to, amountt)
    local _source = source
    local xPlayer = ESX.GetPlayerFromId(_source)
    local zPlayer = ESX.GetPlayerFromId(to)
    local balance = 0
    if zPlayer ~= nil and GetPlayerEndpoint(to) ~= nil then
        balance = xPlayer.getAccount('bank').money
        zbalance = zPlayer.getAccount('bank').money
        if tonumber(_source) == tonumber(to) then
            TriggerClientEvent(Config.notificationstrigger, _source, Config.notificationscolor, "银行", '你不能给自己转账!')
        else
            if balance

请注意,代码中的一些部分可能需要根据具体的上下文进行调整。以上是对代码的汉化,您可以根据需要进行进一步修改。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-28 20:54 , Processed in 0.053731 second(s), 10 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

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

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