addCommandHandler("b", function(plr,cmd,cel,x,bantype,...)
if BWADMIN(plr,3) or BWADMIN(plr,2) or BWADMIN(plr,1) or BWADMIN(plr,5) or BWADMIN(plr,4) or BWADMIN(plr,7) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(x) or not bantype or not reason then
--outputChatBox("#007aff(ⓘ) #FFFFFFU?ycie: /b <nick/ID> <ilo??> <m/h/d> <pow?d>", plr, 255,255,255, true)
triggerClientEvent(plr, 'onClientAddNotification', plr, "U?ycie: /b <nick/ID> <ilo??> <m/h/d> <pow?d>\nm - Minuty h - Godziny d - Dni ", 'info')
return
end
local target=exports["bw-core"]:findPlayer(plr,cel)
if not target then
triggerClientEvent(plr, 'onClientAddNotification', plr, "Nie znaleziono podanego gracza.", 'error')
return
end
if (BWADMIN(plr,7) == false) and BWADMIN(target,7) then return end
if target then
local muza = playSound("ban.mp3") return
end
--reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
if bantype=="m" or bantype=="h" or bantype=="d" then
if bantype=="m" then
exports["bw-db"]:bazaustaw("INSERT INTO bw_zbanowanij (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)", getPlayerSerial(target),reason, x, "ban")
end
if bantype=="h" then
exports["bw-db"]:bazaustaw("INSERT INTO bw_zbanowanij (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)", getPlayerSerial(target),reason, x, "ban")
end
if bantype=="d" then
exports["bw-db"]:bazaustaw("INSERT INTO bw_zbanowanij (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)", getPlayerSerial(target),reason, x, "ban")
end
end
setTimer ( function()
kickPlayer(target,plr,"Zosta?e?(a?) zbanowany(a), po??cz si? ponownie.")
end,5000,1)
--triggerClientEvent(getRootElement(), "notiBig", getRootElement(), "Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." zostaje zbanowany/a przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").. " z powodu: "..reason.." na "..x.." "..bantype, text)
triggerClientEvent(root, 'onClientAddNotification', root, "Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." zostaje zbanowany/a przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").. " \nz powodu: "..reason.." na "..x.." "..bantype, 'error')
end
end)