Witam serdecznie, co mo??e by?? nie tak z zpj poniewa?? gdy chce komus da? prawko to pisze ,,Nie mo?na ?abrac prawa jazdy graczowi o SID 1"
addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) or getAdmin(plr,5) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "/zpj [nick/id] [czas] [m/h/d] [powod]", {25, 175, 255})
return
end
local target=exports["dmta_core"]:findPlayer(plr,cel)
if not target then
exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "Nie znaleziono gracza", {25, 175, 255})
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
if getAdmin(target, 5) then
target = plr
end
if getElementData(target,"player:uid") == 1 or 2 then exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "Nie można zabrać prawo jazdy graczowi o SID: 1 !", {25, 175, 255}, plr) return end
result=pobierzDate(type,time)
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "C")
if type=="m" or type=="h" or type=="d" then
if type=="m" then
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)",getPlayerSerial(target), reason, time, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)",getPlayerSerial(target), reason, time, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)",getPlayerSerial(target), reason, time, "C")
end
if type=="h" then
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)",getPlayerSerial(target), reason, time, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)",getPlayerSerial(target), reason, time, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)",getPlayerSerial(target), reason, time, "C")
end
if type=="d" then
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)",getPlayerSerial(target), reason, time, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)",getPlayerSerial(target), reason, time, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)",getPlayerSerial(target), reason, time, "C")
end
end
triggerClientEvent(root, "admin:rendering", root, "["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymał(a) zakaz prowadzenia pojazdów kat. A,B,C od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..reason.."("..time .. type ..")")
exports["dmta_db"]:dbSet("INSERT INTO logs_penalty_list (uid,nick,typ,powod,date,nadajacy,serial) VALUES (?,?,?,?,NOW(),?,?)", getElementData(target, "player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), "Prawo jazdy", ""..reason.." ("..time..""..type..")", getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getPlayerSerial(target))
outputChatBox(" ", target, 255, 0, 0)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Otrzymałeś(aś) zakaz prowadzenia pojazdów od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Powód: "..reason:gsub("#%x%x%x%x%x%x","").."", target, 255, 255, 255)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Czas: "..time .. type .."", target, 255, 255, 255)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox(" ", target, 255, 0, 0)
local desc = "[#ff6600ZPJ#FFFFFF] (Czas: #ff6600"..time .. type .."#ffffff) ["..getElementData(target,"id").."]"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymał(a) zakaz prowadzenia pojazdów kat. A,B,C od ["..getElementData(plr,"id").."]"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..". Powód: "..reason..""
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc:gsub("#%x%x%x%x%x%x",""))
outputConsole("["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymał(a) zakaz prowadzenia pojazdów kat. A,B,C od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..reason.."("..time .. type ..")")
end
end)
|