Sekllik
owner - newRPG
Wiek: 25 Na forum: 4233 dni Posty: 23
Nick w MP: Sekllik
Piwa : 139
Witam, tworz? serwer i pr?buje zrobi? system raport?w taki jak jest na serwerach czyli:
/raport id/nick pow?d
Wy?wietla si? to administracji w lewym dolnym rogu
kto? wpisuje /cl (id) I usuwa ten raport
Ale za nic nwm jak to zrobi? mam skrypt przerobiony z lss-admin no ale raporty nie dzia?aj? a nie chce nic robi? pod MYSQL. Za pomoc daje Piwko oraz Respect
Strona serwera:
Kod: function cmd_raport(plr, cmd, id, ...)
if (not id) then
outputChatBox("U?yj: /raport <id/nick> <powod>", plr)
return
end
local target=getElementByID("p"..id)
--local target=exports["lss-core"]:findPlayer(plr,id)
if (not target) then
outputChatBox("Nie odnaleziono gracza o podanym ID.", plr)
return
end
local opis=table.concat(arg, " ")
opis = getPlayerName(target) .. "/"..getElementData(target,"id").. " - " .. opis
opis = opis .. "-- "..getPlayerName(plr).."/"..getElementData(plr,"id")
reportView_add(opis,getElementData(target,"id"))
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["lss-core"]:findPlayer(plr,id)
local opis="?"
if (target) then
id=getElementData(target,"id")
opis=getPlayerName(target)
end
reportView_remove(tonumber(id))
local supportLogin=getElementData(plr, "auth:login")
msgToSupport(supportLogin .. " usun??/??a raport na " .. opis .. "/".. id .. ": " .. powod)
end
addCommandHandler("cl", cmd_cl, true, false)
Strona clienta
Kod: function cmd_raport(plr, cmd, id, ...)
if (not id) then
outputChatBox("U?yj: /raport <id/nick> <powod>", plr)
return
end
if (not target) then
outputChatBox("Nie odnaleziono gracza o podanym ID.", plr)
return
end
local opis=table.concat(arg, " ")
dxDrawText(""..getPlayerName(target) .. " / "..getElementData(target,"id").. " - "..opis.."", 1183, 575, 2133, 600, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, false, false)
opis = opis .. " - "..getPlayerName(plr).."/"..getElementData(plr,"id")
reportView_add(opis,getElementData(target,"id"))
outputChatBox("Zg?oszenie zosta?o wys?ane." , plr)
end
addCommandHandler("raport", cmd_raport, false,false)
addCommandHandler("report", cmd_raport, false,false)