Witajcie, postanowilem i? zrobie serwer na paczce ourgame ale kicki i bany nie dzia?aj?, wszystko jest ok podpiete pod mysql i wgl, ale tak : Ban nie dzia?a Kick nie wyrzuca pomocy o co chodzi co jest nie tak w kodzie jestem nowy w lua i srednio ogarniam!
addCommandHandler("b", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("* U?ycie: /b <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr)
return
end
local target=exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban", getPlayerSerial(target))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
return outputChatBox(" Gracz Posiada Bana do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?", "ban", getPlayerSerial(target))
end
result=pobierzDate(type,time)
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
if not result then outputChatBox("*Wpisales zla date **",plr,255,0,0) return end
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) bana z powodu: "..reason.."("..time .. type ..")")
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "ban")
kickPlayer(target,reason)
--outputChatBox("* Dodanych rekord", plr)
end
end)
bany dzia?aj? ale mo?na wej?? normalnie na serwer a nie banuje dok?adnie
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