addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("* U?ycie: /zpj <nick/ID> <czas> <jednostka: m/h/y/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
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
result=pobierzDate(type,time)
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) zakaz prowadzenia pojazd?w kat(ABC) od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..reason.."("..time .. type ..")")
exports["DB2"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "A")
exports["DB2"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "B")
exports["DB2"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "C")
outputChatBox("* Pomy?lnie zabrano prawo jazdy ", plr)
end
end)
addCommandHandler("opj", function(plr,cmd,cel)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
if not cel then
outputChatBox("* U?ycie: /opj <nick/ID> ", 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_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","A", getPlayerSerial(target))
local query32=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","B", getPlayerSerial(target))
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","C", getPlayerSerial(target))
local result=exports["DB2"]:pobierzWyniki(query)
local result2=exports["DB2"]:pobierzWyniki(query2)
local result3=exports["DB2"]:pobierzWyniki(query3)
if (result) or (result2) or (result3) then
exports["DB2"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "A", getPlayerSerial(target))
exports["DB2"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "B", getPlayerSerial(target))
exports["DB2"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "C", getPlayerSerial(target))
outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." odzyskal swoje prawo jazdy!", plr, 0, 255, 0)
outputChatBox("* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." oddal Twoje prawo jazdy! Podzi?kuj mu !", target, 0, 255, 0)
else
outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." nie posiada zabranego prawka!", plr, 0, 255, 0)
end
--exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_prawka_logs (komu_oddali,kto_oddal,typ) VALUES (?,?,?)", getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), "prawo jazdy")
end
end)
addCommandHandler("zpl", function(plr,cmd,cel,time,rodzaj,...)
if 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 tonumber(time) or not rodzaj or not reason then
outputChatBox("U?yj: /zpl <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
triggerClientEvent(plr, 'onClientAddNotification', plr, "Nie znaleziono podanego gracza!", 'warning')
return
end
local query=string.format("SELECT * FROM ogrpg_punish WHERE typ=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","L", getPlayerSerial(target))
local result=exports["DB2"]:pobierzWyniki(query)
if (result) then
return outputChatBox(" Gracz Posiada zawieszone prawo jazdy do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE typ=? AND active=1 AND serial=?", "L", getPlayerSerial(plr))
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
if tonumber(time) <= 0 then return end
local result = "DATE()"
if rodzaj == "m" then
result = string.format('DATE_ADD(NOW(), INTERVAL %d MINUTE)',time)
elseif rodzaj == "h" then
result = string.format('DATE_ADD(NOW(), INTERVAL %d HOUR)',time)
elseif rodzaj == "d" then
result = string.format('DATE_ADD(NOW(), INTERVAL %d DAY)',time)
elseif rodzaj == "w" then
result = string.format('DATE_ADD(NOW(), INTERVAL %d WEEK)',time)
end
reason = reason..""
triggerClientEvent(root, "adminRender", root, "Gracz "..getPlayerName(target).." otrzyma? zakaz prowadzenia pojazd?w lotniczych od "..getPlayerName(plr)..", pow?d: "..reason.." ("..time .. rodzaj..")")
outputConsole("Gracz "..getPlayerName(target).." otrzyma? zakaz prowadzenia pojazd?w lotniczych od "..getPlayerName(plr)..", pow?d: "..reason.." ("..time .. rodzaj..")")
local query = string.format("INSERT INTO ogrpg_punish (serial,reason,time,typ,who_add,ukarany) VALUES ('%s','%s',%s,'%s','%s','%s')", getPlayerSerial(target), reason, result, "L",getPlayerName(plr),getPlayerName(target))
exports["ogrpg-db"]:dbSet("insert into kartoteka (typ,karajacy,data,powod,ofiara) VALUES(?,?,NOW(),?,?)", "ZPL", getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), reason, getElementData(target, "player:uid"))
exports["ogrpg-db"]:dbSet(query)
setElementData(target, "player:license:pjL", false)
triggerEvent("save:player",root,target)
--outputChatBox("* Dodanych rekord", plr)
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