addCommandHandler("tmute", function(plr,cmd,cel,x,bantype,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) or getAdmin(plr,5) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(x) or not bantype or not reason then
outputChatBox("U?ycie: /tmute <nick/ID> <czas> <m/h/d> <pow?d>", plr)
return
end
local target=exports["pystories-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 255, 255)
return
end
if (getAdmin(plr,3) == false) and getAdmin(target,3) then return end
reason = reason..""
if bantype=="m" or bantype=="h" or bantype=="d" then
if bantype=="m" then
exports["pystories-db"]:dbSet("INSERT INTO pystories_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)", getPlayerSerial(target),reason, x, "mute")
end
if bantype=="h" then
exports["pystories-db"]:dbSet("INSERT INTO pystories_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)", getPlayerSerial(target),reason, x, "mute")
end
if bantype=="d" then
exports["pystories-db"]:dbSet("INSERT INTO pystories_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)", getPlayerSerial(target),reason, x, "mute")
end
end
exports['yd-noti']:noti(root, getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzyma? blokade pisania od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." z powodu "..reason.." ("..x .. bantype..")", "punish")
setElementData(target, "player:mute", true)
end
end)