Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My Function:
- function searchTable(SID)
- local queryQ = DATABASE:query("SELECT * FROM `database` WHERE steamid = '" .. SID .. "'")
- queryQ.onData = function(Q,D)
- --queryQ.onSuccess = function(q)
- Reason = D.reason
- BannedTill = D.to_date
- BannedFrom = D.from_date
- bool_var = true
- PrintTable(D)
- --end
- end
- queryQ.onError = function(Q,E) print("Q1") print(E)
- Reason = nil
- BannedTill = nil
- BannedFrom = nil
- bool_var = false
- end
- queryQ:start()
- queryQ:wait()
- return Reason, SID, bool_var, BannedFrom, BannedTill
- end
- The Function which uses it:
- function checkForPrisoner(sid64)
- reason, steamid, trueorfalse, bannedfrom, bannedtill = searchTable(sid64)
- if(trueorfalse)then
- return false , "You got Banned for: "..reason.."\n You are Banned untill:"..os.date( "%H:%M:%S - %d/%m/%Y" , bannedtill )
- else
- print("Player:"..sid64.." is not Banned")
- return true
- end
- end
- Expected Returns:
- reason = "Reason"
- steamid = my64bitsteamid
- trueorfalse = true
- bannedfrom = UnixTime
- bannedtill = UnixTime
- Actual Returns:
- reason = "Reason"
- steamid = nil
- trueorfalse = nil
- bannedfrom = nil
- bannedtill = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement