Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TriggerEvent("modmin:addModule", "mod.ban", function(_source, params, denied)
- if not denied then
- local license, licenseBanner
- for _, v in pairs(GetPlayerIdentifiers(params.id)) do
- if string.find(v, "license") then
- license = v
- break
- end
- end
- for _, v in pairs(GetPlayerIdentifiers(_source)) do
- if string.find(v, "license") then
- licenseBanner = v
- break
- end
- end
- if not license or not licenseBanner then
- if(not license)then print("^1[ModMin]^7 Failed banning! Could not find license of banned user") end
- if(not licenseBanner)then print("^1[ModMin]^7 Failed banning! Could not find license of banner user") end
- return
- end
- MySQL.Async.execute("INSERT INTO modmin_ban (identifier, name, banned, expires, reason, bannedBy, bannedByName) VALUES (@identifier, @name, now(), @bannedUntil, @reason, @bannedBy, @bannedByName)", {['@identifier'] = license, ['@name'] = GetPlayerName(params.id), ['bannedUntil'] = params.time, ['@reason'] = params.reason, ['@bannedBy'] = licenseBanner, ['@bannedByName'] = GetPlayerName(_source)}, function(result)
- print("^1[ModMin]^7 Successfully banned " .. GetPlayerName(params.id) .. ", by " .. GetPlayerName(_source) .. ". For: " .. params.reason .. " (until " .. params.time .. ")")
- DropPlayer(params.id, "Banned: " .. params.reason)
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement