Jump to content

Recommended Posts

Mam taki skrypt potrzebuje pomocy nie działa mi /duty jak ktoś chce udostepnie wiencej plikow lua
Quote

function RGBToHex(red, green, blue, alpha)
 if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
  return nil
 end
 if(alpha) then
  return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
 else
  return string.format("#%.2X%.2X%.2X", red,green,blue)
 end
end
--admins
function getAdmin(plr,level)
 if level then
  local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?", getPlayerSerial(plr), level)
  if result and #result > 0 then
   return true
  else
   return false
  end
 else
  local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?", getPlayerSerial(plr))
  if result and #result > 0 then
   return true
  else
   return false
  end
 end
end
 
function getLevel(plr)
 if plr then
  local result=exports["ogrpg-db"]:dbGet("SELECT level from ogrpg_admins WHERE serial=? limit 1", getPlayerSerial(plr))
  if result and #result > 0 then
   if tonumber(result[1].level) > 0 then
   return result[1].level
   else
   return false
   end
  else
   return false
  end
 end
end
--
function cmd_admins(plr)
if not getElementData(plr,"adminsON") then
  local helperzy={}
  local supporterzy={}
  local admini={}
  local rconi={}
  local dev={}
  setElementData(plr,"adminsON",true)
  setTimer(setElementData,30*1000,1,plr,"adminsON",false)
  for i,v in ipairs(getElementsByType("player")) do
    local adminer = getElementData(v,"player:id")
 if (getAdmin(v,4)) then
   local t
   local login=getElementData(v,"player:admin")
   if (login) then
  t="#ffffff"..getPlayerName(v):gsub("#%x%x%x%x%x%x","").."[#0066ffID:"..getElementData(v,"id").."#ffffff]"
  table.insert(dev,t)
   end
 end
   if (getAdmin(v,3)) then
   local t
   local login=getElementData(v,"player:admin")
   if (login) then
  t="#ffffff"..getPlayerName(v):gsub("#%x%x%x%x%x%x","").."[#0066ffID:"..getElementData(v,"id").."#ffffff]"
  table.insert(rconi,t)
   end
 end
 if(getAdmin(v,2)) then
   local t
   local login=getElementData(v,"player:admin")
   if (login) then
  t="#ffffff"..getPlayerName(v):gsub("#%x%x%x%x%x%x","").."[#0066ffID:"..getElementData(v,"id").."#ffffff]"
  table.insert(admini,t)
   end
 end
 if (getAdmin(v,1)) then
   local t
   local login=getElementData(v,"player:admin")
   if (login) then
  t="#ffffff"..getPlayerName(v):gsub("#%x%x%x%x%x%x","").."[#0066ffID:"..getElementData(v,"id").."#ffffff]"
  table.insert(supporterzy,t)
   end
 end
end
  outputChatBox("Developerzy:", plr, 160,0,170)
  if (#dev>0) then
    outputChatBox("  " .. table.concat(dev,", "), plr,255,255,255,true)
  else
 outputChatBox("Brak.", plr)
  end
  outputChatBox("RCON:", plr, 100,0,0)
  if (#rconi>0) then
    outputChatBox("  " .. table.concat(rconi,", "), plr,255,255,255,true)
  else
 outputChatBox("Brak.", plr)
  end
 
  outputChatBox("Administrator:", plr, 255,0,0)
  if (#admini>0) then
    outputChatBox("  " .. table.concat(admini,", "), plr,255,255,255,true)
  else
 outputChatBox("Brak.", plr)
  end
  outputChatBox("Support:", plr, 0,200,0)
  if (#supporterzy>0) then
    outputChatBox("  " .. table.concat(supporterzy,", "), plr,255,255,255,true)
  else
 outputChatBox("Brak.", plr)
  end
end
end
addCommandHandler("admins", cmd_admins, false, false)
addCommandHandler("admini", cmd_admins, false, false)
addCommandHandler("ekipa", cmd_admins, false, false)
addEvent("admin:logs", true)
addEventHandler("admin:logs", root, function(text)
local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_logs (name,data) VALUES (?,NOW())", text)
end)
addCommandHandler("ucho", function(plr,cmd)
 if getAdmin(plr) then
 local x = getElementData(plr,"player:ucho")
 setElementData(plr,"player:ucho",not x)
 end
end)
addCommandHandler("duty", function(plr,cmd)
 if getAdmin(plr) then
  if not getElementData(plr,"player:admin") then
   giveWeapon(plr,22)
   toggleControl(plr,"fire",true)
   toggleControl(plr,"aim_weapon",true)
   if getAdmin(plr, 1) then
   setElementData(plr,"player:level",1)
   elseif getAdmin(plr, 2) then
   setElementData(plr,"player:level",2)
   elseif getAdmin(plr, 3) then
   setElementData(plr,"player:level",3)
   elseif getAdmin(plr, 4) then
   setElementData(plr,"player:level",4)
   end
   setElementData(plr,"player:admin",true)
   setElementData(plr,"player:premium",true)
   exports["noti"]:noti("Zalogowałeś[aś] się na konto Administratora", plr)
   exports["noti"]:noti("Wpisz /ucho by wyświetlić podgląd", plr, 192 ,192 ,192)
    exports["ogrpg-db"]:dbSet("UPDATE ogrpg_admins SET actived=NOW() WHERE serial=?",getPlayerSerial(plr))
   local text = "* "..getPlayerName(plr).." zalogował(a) się do administracji."..RGBToHex(255,255,255)
   triggerEvent("admin:addText", resourceRoot, text,math.random(0,99))
   --outputChatBox(, root, 255, 0, 0)
 --  local rank = getVisualRank(plr)
   if rank then
    setElementData(plr,"player:level",{tonumber(getLevel(plr)),rank})
    return
   end
  else
   takeWeapon(plr,22)
   toggleControl(plr,"fire",false)
   toggleControl(plr,"aim_weapon",false)
   removeElementData(plr,"player:admin")
   removeElementData(plr,"player:level")
   removeElementData(plr,"player:premium")
   exports["noti"]:noti("Wylogowałeś się z duty administracji", plr)
   setPlayerName(plr,getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
   local text = "* "..getPlayerName(plr).." wylogował(a) się z administracji."..RGBToHex(255,255,255)
   triggerEvent("admin:addText", resourceRoot, text,math.random(0,99))
   --outputChatBox(, root, 255, 0, 0)
  end
 else
  --outputChatBox("* Nie posiadasz uprawnień.", plr, 255, 0, 0)
 end
end)
rangi = {
[3] = "RCON",
[2] = "Administrator",
[1] = "Support",
}
scianarapsow = createObject ( 16637,-1983.48, 466.38, 24235.17 )
setObjectScale(scianarapsow,3)
reportView = {{"OBECNE ZGLOSZENIA",0}}
setElementData(scianarapsow,"sciana:raportow",reportView)
addEvent("admin:addReport", true)
addEventHandler("admin:addReport", root, function(text,id)
 table.insert(reportView, {text,id})
 if #reportView > 10 then
  table.remove(reportView, 2)
 end
 setElementData(scianarapsow,"sciana:raportow",reportView)
end)
addEvent("admin:removeReport", true)
addEventHandler("admin:removeReport", root, function(id)
 for i=#reportView, 2, -1 do
  if reportView[2] == id then
   table.remove(reportView,i)
  end
 end
 setElementData(scianarapsow,"sciana:raportow",reportView)
end)
scianatext = createObject ( 981,0,0,0 )
textView = {{"LOGI SERWEROWE",0}}
setElementData(scianatext,"sciana:text",textView)

addEvent("admin:addText", true)
addEventHandler("admin:addText", root, function(text,id)
 table.insert(textView, {text,id})
 if #textView > 10 then
  table.remove(textView, 2)
 end
 setElementData(scianatext,"sciana:text",textView)
end)
addEvent("admin:removeText", true)
addEventHandler("admin:removeText", root, function(id)
 for i=#textView, 2, -1 do
  if textView[2] == id then
   table.remove(textView,i)
  end
 end
 setElementData(scianatext,"sciana:text",textView)
end)

addCommandHandler("report", function(plr,cmd,cel,...)
 if not cel then
  outputChatBox("* Użyj: /report <nick/ID> <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 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"))
 triggerClientEvent(root, "onDebugMessage", resourceRoot, desc,2, "Report")
  exports["ogrpg-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)
  return
 end
 local reason=table.concat({...}, " ")
 local target=exports["ogrpg-core"]:findPlayer(plr,id)
 if target then
  id=getElementData(target,"id")
  opis=getPlayerName(target)
  if target ~= plr and not getAdmin(target) then
  exports["ogrpg-db"]:dbSet("INSERT INTO raps (nick,uid,ostatnio_zrobil) VALUES (?,?,NOW())",getPlayerName(plr):gsub("#%x%x%x%x%x%x",""),getElementData(plr, "player:uid"))
  end
 end
 for i,v in ipairs(getElementsByType("player")) do
  if getAdmin(v) then
  -- if getElementData(v,"player:admin") then
    triggerEvent("admin:removeReport", resourceRoot, id)
    outputChatBox("* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." usunął/ęła raport na: "..opis:gsub("#%x%x%x%x%x%x","").."/"..id..": "..reason, v, 255, 0, 0)
  -- end
  end
 end
end)

addEventHandler("onPlayerQuit", root, function()
 local  id=getElementData(source,"id")
 if id then
  triggerEvent("admin:removeReport", resourceRoot, id)
 end
end)
 

addCommandHandler("rapsy", function(plr,cmd,uid)
 if not getAdmin(plr) then
  return
 end
 if not uid then outputChatBox("Użycie: /rapsy <uid>", plr, 255, 255, 255) return end
 local sel=exports["ogrpg-db"]:dbGet("SELECT * FROM raps WHERE uid=?", uid)
 if sel and #sel > 0 then
 outputChatBox("Użytkownik o uid "..uid.." wykonał "..#sel.." reportów.", plr, 255, 255, 255)
 else
 outputChatBox("Użytkownik o uid "..uid.." wykonał 0 reportów.", plr, 255, 255, 255)
 end
end)
local x,y,z = -6716.17, -1342.35, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6716.17, -1338.40, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6716.17, -1334.33, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6716.17, -1330.37, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6721.07, -1328.51, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6721.07, -1332.64, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6721.14, -1336.55, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)
local x,y,z = -6721.14, -1340.55, 97.75
local obj = createObject(1228,x,y,z-0.65)
triggerClientEvent("setBreakable",root,obj)
setElementFrozen(obj,true)

 

Tu jest Paczka a w niej jest ten skrypt w folderze welesy nazwa dutydrpg

Quote

 

Link to comment
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...