Try this
-- Server side
function setBans()
local bans = getBans()
triggerClientEvent(client,"setBans", client, bans)
end
addEvent("outputBans", true)
addEventHandler("outputBans", resourceRoot, setBans)
-- Client side
function setBans(bans)
if bans then
for k, v in ipairs(bans) do
local row = guiGridListAddRow (stfgrd5)
local serial = tostring(v.serial) or "N/A"
local duration = tostring(v.time) or "N/A"
local ip = tostring(getBanIP(v)) or "N/A"
local nick = tostring(getBanNick(v)) or "N/A"
local admin = tostring(getBanAdmin(v)) or "N/A"
guiGridListSetItemText (stfgrd5, row, 1, serial, false, false)
guiGridListSetItemText (stfgrd5, row, 2, duration, false, false)
guiGridListSetItemText (stfgrd5, row, 3, ip, false, false)
guiGridListSetItemText (stfgrd5, row, 4, name, true, false)
guiGridListSetItemText (stfgrd5, row, 5, admin, true, false)
end
end
end
addEvent("setBans", true)
addEventHandler("setBans", root, setBans)
function outputBans()
if (source == stfgrd5) then
triggerServerEvent("outputBans", resourceRoot)
end
end
addEventHandler("onClientGUIClick", root, outputBans)