Erczi
Wiek: 27 Na forum: 2371 dni Posty: 17
Nick w MP: ewwe
Piwa : 4
Potrzebuje pomocy
Gdy wpisuje np. /k 3 to kickuje mnie samego siebie
tak samo jest z banami oraz warnami
Kod: addCommandHandler("k", function(plr,cmd,cel,...)
if getAdmin(plr,5) or getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason=table.concat({...}, " ")
if not cel or not reason then
exports.dmta_interface:showPlayerNotification(plr, "/k [nick/id] [powod]", "error", 1, 3000)
return
end
local target=exports["dmta_core"]:findPlayer(plr,cel)
if not target then
exports.dmta_interface:showPlayerNotification(plr, "Nie znaleziono gracza", "error", 1, 3000)
return
end
if getAdmin(target, 5) then
target = plr
end
triggerClientEvent(root, "admin:rendering", root, ""..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." ["..getElementData(target,"id").."] zosta?‚(a) wyrzucony(a) przez ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." z powodu: "..reason.."")
local desc = "[#ff6600KICK#FFFFFF] ["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." zosta?‚(a) wyrzucony(a) przez ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..". PowĂłd: "..reason..""
exports["dmta_db"]:dbSet("INSERT INTO logs_penalty_list (uid,nick,typ,powod,date,nadajacy,serial) VALUES (?,?,?,?,NOW(),?,?)", getElementData(target, "player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), "Kick", reason, getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getPlayerSerial(target))
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc:gsub("#%x%x%x%x%x%x",""))
outputConsole("=================", target)
outputConsole("Zosta?‚e?›/a?› wyrzucony/a z serwera", target)
outputConsole("Przez: "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target)
outputConsole("PowĂłd: "..reason.."", target)
outputConsole("=================", target)
outputConsole(""..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." ["..getElementData(target,"id").."] zosta?‚(a) wyrzucony(a) przez ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." z powodu: "..reason.."")
kickPlayer(target, plr, "Zosta?‚e?›/a?› wyrzucony/a z serwera, otwĂłrz konsole (`) aby uzyska?‡ wi?™cej informacji.")
end
end)
addCommandHandler("warn", function(plr,cmd,cel, ...)
if getAdmin(plr,5) or getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) then
local target=exports["dmta_core"]:findPlayer(plr,cel)
if (not target) then
exports.dmta_interface:showPlayerNotification(plr, "Nie znaleziono gracza", "error", 1, 3000)
return
end
local tresc = table.concat(arg, " ")
if (string.len(tresc)<=1) then
exports.dmta_interface:showPlayerNotification(plr, "Wpisz tre?›?‡ ostrzeĹĽenia!", "error", 1, 3000)
return
end
if getAdmin(target, 5) then
target = plr
end
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Otrzyma?‚e?›(a?›) ostrzeĹĽenie od #ffffff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0, true)
outputChatBox("PowĂłd: #ffffff"..tresc:gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0, true)
outputChatBox(" ", target, 255, 0, 0)
triggerClientEvent("onPlayerWarningReceived", target, tresc)
triggerClientEvent(root, "admin:rendering", root, "["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzyma?‚(a) ostrzeĹĽenie od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..", powĂłd: "..tresc.."")
exports["dmta_db"]:dbSet("INSERT INTO logs_penalty_list (uid,nick,typ,powod,date,nadajacy,serial) VALUES (?,?,?,?,NOW(),?,?)", getElementData(target, "player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), "OstrzeĹĽenie", tresc, getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getPlayerSerial(target))
local desc = "[#ff6600WARN#FFFFFF] ["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymuje ostrzeĹĽenie od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..". PowĂłd: "..tresc..""
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc:gsub("#%x%x%x%x%x%x",""))
outputConsole("["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzyma?‚(a) ostrzeĹĽenie od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..", powĂłd: "..tresc.."")
end
end)