Jump to content

Check if the player banned


Artisz

Recommended Posts

Hi!

I don't know how can I do this, I have some problem with this. Here is the code, when the player is logging in:

addEvent("onPlayerAttemptLogin",true) 
addEventHandler("onPlayerAttemptLogin",root, 
function(username,password) 
    if (exports["secret_main"]:singleQuery("SELECT * FROM accounts WHERE username=? LIMIT 1",string.lower(username))) then 
        local accData = exports["secret_main"]:singleQuery("SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1",string.lower(username),sha256(password)) 
        if (accData) then 
            local banQuery = dbQuery( kapcsolat, "SELECT * FROM `tiltasok` WHERE `felhasznalo`=?? LIMIT 1", accData.id) 
            local banQueryEredmeny, sorokSzama = dbPoll ( banQuery, -1 ) 
            if(sorokSzama ~= 0) then 
                local banData = exports["secret_main"]:singleQuery("SELECT * FROM `tiltasok` WHERE `felhasznalo`=? LIMIT 1",accData.id) 
                if(tostring(banData.meddig) <= tostring(getRealTime())) then 
                    dbExec(kapcsolat, "DELETE FROM `tiltasok` WHERE felhasznalo='??'", accData.id) 
                else 
                    kickPlayer(source, "Ki vagy tiltva a szerverről!") 
                end 
            elseif(sorokSzama == 0) then 
                --    ..........ETC.. 
                --    ..........ETC.. 
                --    ..........ETC.. 

And it isn't kick me, when I am banned. I can logging in. How can I do it?

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...