like topic if i use API with "CancelEvent()" it make server crash
i'm do every test with "CancelEvent()". if it not have to work with API it work fine.
if u don't understand my english i'm sorry about that.
Event
AddEventHandler('playerConnecting', function(name, setReason)
local steamID = GetPlayerIdentifiers(source)[1]
--Check ban
if isBanned(steamID) then
debugMsg('Banned player has join : ('..steamID ..') (Kicked)')
setReason('ID has banned!')
CancelEvent()
end
end)
Function
function isBanned(id)
local result = MySQL.Sync.fetchAll('SELECT * FROM bans WHERE steam = @steam', {['@steam'] = id['steam']})
for _,v in pairs(result) do
if v.expires > v.timestamp then
return true
end
end
end
like topic if i use API with "CancelEvent()" it make server crash
i'm do every test with "CancelEvent()". if it not have to work with API it work fine.
if u don't understand my english i'm sorry about that.
Event
Function