我在控制台上收到此错误 adss / advertisements.lua:117:“ ipairs”的错误参数#1(需要表格,布尔值) 还有这个 adss / advertisements.lua:117:调用:无法调用'mysql:select'[字符串“?”]
功能openAdvertisements(播放器,命令) 本地广告= {}-这些将保存我们的广告以发送给客户并填充我们的广告表。
if not player then player = source end
--Fetch all of the advertisements from the database
for _, ad in ipairs( exports.mysql:select('advertisements') ) do
if tonumber( ad.expiry ) >= tonumber( getRealTime().timestamp ) then --Check if the advertisement has expired, delete it if so.
ad.author = exports.mysql:select_one( "characters", { id = ad.created_by } ).charactername
table.insert( advertisements, ad )
else
deleteAdvertisement( ad.id )
end
end
triggerClientEvent( player, resourceName .. ":display_all", root, advertisements, exports.integration:isPlayerAdmin( player ) ) --Send the advertisements to the client to create the GUI.
结束
这是第117行 对于_,ipairs中的广告(exports.mysql:select('advertisements'))做