addEvent("admin:removeReport", true)
addEventHandler("admin:removeReport", root, function(id)
for i=#reportView, 1, -1 do
if (reportView[i][2] and reportView[i][2] == id) then -- Znaczniki ?le pokazuj? powinno by? samo i w nawiasach kwadratowych
table.remove(reportView,i)
end
end
end)
function cmd_raport(plr, cmd, id, ...)
if (not id) then
outputChatBox("U?yj: /raport <id/nick> <powod>", plr)
return
end
local target=getElementByID("id"..id)
local target=exports["czaty"]:findPlayer(plr,id)
if (not target) then
outputChatBox("Nie odnaleziono gracza o podanym ID.", plr)
return
end
local opis=table.concat(arg, " ")
local report=('Report> %s(%d) zg?osi? %s(%d) za %s'):format(getPlayerName(plr),getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), opis)
triggerClientEvent(root, "admin:addReport", root, report)
outputChatBox("Zg?oszenie zosta?o wys?ane." , plr)
end
addCommandHandler("raport", cmd_raport, false,false)
addCommandHandler("report", cmd_raport, false,false)
function cmd_cl(plr,cmd,id,...)
if (not id) then
outputChatBox("U?yj: /cl <id/nick> <powod>", plr)
return
end
local powod=table.concat(arg, " ")
if (string.len(powod)<2) then
outputChatBox("U?yj: /cl <id/nick> <powod>", plr)
return
end
local target=exports["czaty"]:findPlayer(plr,id)
local opis="?"
if (target) then
id=getElementData(target,"id")
opis=getPlayerName(target)
end
reportView(tonumber(id))
local supportLogin=getElementData(plr, "admin:addText")
msgToSupport(supportLogin .. " usun??/??a raport na " .. opis .. "/".. id .. ": " .. powod)
end
addCommandHandler("cl", cmd_cl, false, false)
atu jest wyswietlanie
local xtext=nil
local gameView={"Logi serwerowe"}
local reportView={"Lista raport?w"}
local sx,sy=guiGetScreenSize()
addEventHandler("onClientRender", root, function()
if getElementData(localPlayer,"duty") then
concat=table.concat(gameView, "\n")
dxDrawText(concat, sx*(10+1)/1024, sy*(279+1)/768, sx*(326+1)/1024, sy*(497+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "left", "top", false, true)
dxDrawText(concat, sx*(10)/1024, sy*(279)/768, sx*(326)/1024, sy*(497)/768, white, 1.00, "default", "left", "top", false, true)
end
end)
function renderingInfo()
dxDrawRectangle(sx*(258)/1024, sy*(0)/768, sx*(500)/1024, sy*(23)/768, tocolor(0, 0, 0, 155), false)
dxDrawText(xtext, sx*(258+1)/1024, sy*(0+1)/768, sx*(758+1)/1024, sy*(23+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "center", "center", false, true)
dxDrawText(xtext, sx*(258)/1024, sy*(0)/768, sx*(758)/1024, sy*(23)/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false, true)
end
addEventHandler("onClientRender", root, function()
if getElementData(localPlayer,"duty") then
local tt={}
for i,v in ipairs(reportView) do
if v[1] then table.insert(tt,v[1]) end
end
concat=table.concat(tt, "\n")
dxDrawText(concat, sx*(698+1)/1024, sy*(278+1)/768, sx*(1014+1)/1024, sy*(496+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "right", "top", false, true)
dxDrawText(concat, sx*(698)/1024, sy*(278)/768, sx*(1014)/1024, sy*(496)/768, tocolor(255, 255, 255, 255), 1.00, "default", "right", "top", false, true)
end
end)
addEvent("admin:addText", true)
addEventHandler("admin:addText", root, function(text)
table.insert(gameView, text)
if #gameView > 10 then
table.remove(gameView, 1)
end
end)
addEvent("admin:addReport", true)
addEventHandler("admin:addReport", root, function(text,id)
table.insert(reportView, {text,id})
if #reportView > 10 then
table.remove(reportView, 1)
end
end)
addEvent("admin:removeReport", true)
addEventHandler("admin:removeReport", root, function(id)
for i=#reportView, 1, -1 do
if (reportView[i][2] and reportView[i][2] == id) then -- Znaczniki ?le pokazuj? powinno by? samo i w nawiasach kwadratowych
table.remove(reportView,i)
end
end
end)
addEvent("admin:rendering", true)
addEventHandler("admin:rendering", root, function(text)
xtext=text
addEventHandler("onClientRender", root, renderingInfo)
setTimer(function()
removeEventHandler("onClientRender", root, renderingInfo)
end, 5000, 1)
end)
addEvent("admin:removeReport", true)
addEventHandler("admin:removeReport", root, function(id)
for i=1, #reportView do
if (reportView[i][2] and reportView[i][2] == id) then
table.remove(reportView,i)
end
end
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach