function UpdateVehicleDisplay()
RconPrint('[储存] 保存T1展示位置车辆\n')
for i = 1, #Config.Dealerships do
for slot = 1, #Config.Dealerships[i].display do
if Config.Dealerships[i].display[slot].cache ~= nil and next(Config.Dealerships[i].display[slot].cache) then
if Config.Dealerships[i].display[slot].cache.model ~= nil then
MySQL.Async.execute('UPDATE vehicle_display SET model = @model, name = @name, commission = @commission, downpayment = @downpayment WHERE dealer = @dealer AND slot = @slot', {
['@dealer'] = i,
['@slot'] = slot,
['@model'] = Config.Dealerships[i].display[slot].cache.model,
['@name'] = Config.Dealerships[i].display[slot].cache.name,
['@commission'] = Config.Dealerships[i].display[slot].cache.commission,
['@downpayment'] = Config.Dealerships[i].display[slot].cache.downpayment
})
else
print("^1[ERROR] - Model for dealer ["..i.."] at display spot ["..slot.."] is nil")
end
else
print("^1[ERROR] - Cache table for dealer ["..i.."] at display spot ["..slot.."] is empty")
end
end
end
end
上面是成品插件里的代码,在控制台可以显示中文,你借鉴一下
展示效果
|