Jump to content

attempt to index local 'bans' (a nil value)


Msypon

Recommended Posts

-- client

tick = 0 
  
addEvent ( 'getBansList', true ) 
function panelTick ( bans ) 
    if ( guiGetVisible ( GUIEditor.window[1] ) ) then 
        if ( getTickCount() >= tick ) then 
            local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
            if ( name and ip ) then 
                guiGridListSetItemText ( GUIEditor.gridlist[1], row, name, bans.name, false, false ) 
                guiGridListSetItemText ( GUIEditor.gridlist[1], row, ip, bans.name, false, false ) 
            end 
            tick = getTickCount() + 1000 
        end 
    end 
end 
addEventHandler ( 'onClientRender', root, panelTick ) 
addEventHandler ( 'getBansList', root, panelTick ) 

--server

function banList ( ) 
    local bans = dbQuery ( banSQL, 'SELECT * FROM banTable' ) 
    local result = dbPoll ( bans, -1 ) 
    for _, bans in pairs ( result ) do 
        triggerClientEvent ( 'getBansList', root, bans ) 
    end 
end 

:9: attempt to index local 'bans' (a nil value)

Link to comment

try this:

Server

function banList ( ) 
    local bans = dbQuery ( banSQL, 'SELECT * FROM banTable' ) 
    local result = dbPoll ( bans, -1 ) 
    for _, ban in pairs ( result ) do 
        triggerClientEvent ( 'getBansList', root, ban ) 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...