gyrosos14 Posted April 16, 2021 Share Posted April 16, 2021 function isPlayerBanned(player) if (player) then local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT * FROM bans WHERE serial=? AND expiration > CURRENT_TIME()", serial); local bans = dbPoll(qh, 500); if (bans) then if (#bans > 0) then return true; else return false; end else return false; end else return false; end end The script always gives me true, even if i replace that one true with false Link to comment
SpecT Posted April 16, 2021 Share Posted April 16, 2021 Hey, It doesn't make sense to always return true even as you said when you replace the true with false. Could you show the part where you check what the function returns. Also there is no need of all those elses. function isPlayerBanned(player) if (player) then local serial = getPlayerSerial(player); local qh = dbQuery(con, "SELECT * FROM bans WHERE serial=? AND expiration > CURRENT_TIME()", serial); local bans = dbPoll(qh, 500); if (bans) then if (#bans > 0) then return true; end end end return false; end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now