witam nie wiem jak zrobi? aby /cl id gracza aby sprawdza?o czy na danego jest gracza report i mo?na by?o usun?? a nie ?e mo?na na innych usuwa? kod:
[lua]
addCommandHandler("report", function(plr,cmd,cel,...)
if not cel then
outputChatBox("* U?yj: /report <nick/ID> <pow?d>", plr)
return
end
local target=exports["core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
local text=table.concat({...}, " ")
CD = text
desc=getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."("..getElementData(plr,"id")..") >> "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id").."): "..text:gsub("#%x%x%x%x%x%x","")
triggerEvent("admin:addReport", resourceRoot, desc, getElementData(target,"id"))
exports["db"]:dbSet("insert into logi_report SET data=NOW(),serial=?,nick=?,tresc=?",getPlayerSerial(target),getPlayerName(target),CD)
outputChatBox("* Pomy?lnie wys?ano zg?oszenie na gracza: "..getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr)
end)
addCommandHandler("cl", function(plr,cmd,id,...)
if not getAdmin(plr) then
outputChatBox("* Nie posiadasz uprawnie?.", plr, 255, 0, 0)
r...
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:
[code]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