Advertisement
Guest User

Advanced Admin System

a guest
Apr 19th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.73 KB | None | 0 0
  1. -- CLIENT
  2. -- Fonts
  3. surface.CreateFont("WasiedRefundFont", {
  4.     font = "Arial",
  5.     size = 23,
  6.     weight = 2000,
  7. })
  8.  
  9. surface.CreateFont("WasiedRefundFont2", {
  10.     font = "Arial",
  11.     size = 18,
  12.     weight = 1000,
  13. })
  14.  
  15. surface.CreateFont("WasiedRefundFont3", {
  16.     font = "Arial",
  17.     size = 18,
  18.     weight = 700,
  19. })
  20.  
  21. surface.CreateFont("WasiedAdminMenuTitle", {
  22.     font = "Trebuchet24",
  23.     size = 30,
  24.     weight = 700,
  25. })
  26.  
  27. surface.CreateFont("WasiedAdminMenuClose", {
  28.     font = "Trebuchet24",
  29.     size = 60,
  30.     weight = 700,
  31. })
  32.  
  33. surface.CreateFont("WasiedAdminMenuButton", {
  34.     font = "Trebuchet24",
  35.     size = 35,
  36.     weight = 700,
  37. })
  38.  
  39. local lang = AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage]
  40. local staffMod = 0
  41.  
  42. -- Disable FAdmin Messages
  43. if AdvancedStaffConfig.HideFAdmin then
  44.     timer.Simple(5, function()
  45.         function FAdmin.Messages.AddMessage(MsgType, Message)
  46.         end
  47.     end)
  48. end
  49.  
  50. -- Hide Physgun Beam
  51. if AdvancedStaffConfig.HidePhysForStaff then
  52.     hook.Add("DrawPhysgunBeam", "NoDrawPhysgunBeamOnStaff", function(ply)
  53.         return not ply:Team() == AdvancedStaffConfig.AllowedTeam
  54.     end)
  55. end
  56.  
  57. -- Staff Mod
  58. if AdvancedStaffConfig.ShowMoreInfos && AdvancedStaffConfig.ShowMoreContext && AdvancedStaffConfig.AllowedRanks[LocalPlayer():GetUserGroup()] then
  59.  
  60.     hook.Add("OnContextMenuOpen", "AdvAdminContextOpen", function()
  61.         staffMod = 1
  62.     end)
  63.  
  64.     hook.Add("OnContextMenuClose", "AdvAdminContextClose", function()
  65.         staffMod = 0
  66.     end)
  67.  
  68. end
  69.  
  70. -- Refund Menu
  71. net.Receive("AdvAdminSyst:Refund:OpenMenu", function()
  72.     local playertable = net.ReadTable()
  73.     local scrw, scrh = ScrW(), ScrH()
  74.  
  75.     local refundframe = vgui.Create("DFrame")
  76.     refundframe:SetPos(0,0)
  77.     refundframe:SetSize(600,700)
  78.     refundframe:Center()
  79.     refundframe:SetTitle("")
  80.     refundframe:ShowCloseButton(false)
  81.     refundframe:MakePopup()
  82.     refundframe:SlideDown(1)
  83.     function refundframe.Paint(self, w, h)
  84.         Derma_DrawBackgroundBlur(self, self.startTime)
  85.         draw.RoundedBox(0, 0, 0, w, h, Color(205,180,180,150))
  86.         draw.RoundedBox(0, 0, 0, w, 50, Color(255,70,70,190))
  87.         draw.DrawText(lang.RefundMenuTitle, "WasiedRefundFont", w/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER)
  88.         draw.DrawText(lang.RefundMenuSubhead, "WasiedRefundFont2", w/2, 25, Color(255,255,255,255), TEXT_ALIGN_CENTER)
  89.     end
  90.  
  91.     local closebutton = vgui.Create("DButton", refundframe)
  92.     closebutton:SetPos(0,660)
  93.     closebutton:SetSize(600,40)
  94.     closebutton:SetText("")
  95.     closebutton:SetTextColor(Color(255,0,0))
  96.     closebutton.DoClick = function()
  97.         refundframe:SlideUp(1)
  98.     end
  99.     closebutton.OnCursorEntered = function(self)
  100.         self.hover = true
  101.         surface.PlaySound("UI/buttonrollover.wav")
  102.     end
  103.     closebutton.OnCursorExited = function(self)
  104.         self.hover = false
  105.     end
  106.     function closebutton.Paint(self, w, h)
  107.         if !self.hover then
  108.             draw.RoundedBox(0, 0, 0, w, h, Color(255,70,70,190))
  109.         else
  110.             draw.RoundedBox(0, 0, 0, w, h, Color(255,90,90,220))
  111.         end
  112.         draw.DrawText(lang.CloseButton,"WasiedRefundFont",w/2, h/4, Color(255,255,255,255), TEXT_ALIGN_CENTER)
  113.     end
  114.  
  115.     local scrollpanel = vgui.Create("DScrollPanel", refundframe)
  116.     scrollpanel:SetPos(10,70)
  117.     scrollpanel:SetSize(580,520)
  118.  
  119.     local scrollbar = scrollpanel:GetVBar()
  120.     function scrollbar:Paint(w, h)
  121.         draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 110 ) )
  122.     end
  123.     function scrollbar.btnUp:Paint(w, h)
  124.         draw.RoundedBox( 2, 0, 0, w, h, Color(32, 32, 32) )
  125.     end
  126.     function scrollbar.btnDown:Paint(w, h)
  127.         draw.RoundedBox( 2, 0, 0, w, h, Color(32, 32, 32) )
  128.     end
  129.     function scrollbar.btnGrip:Paint(w, h)
  130.         draw.RoundedBox( 6, 0, 0, w, h, Color(0, 137, 255) )
  131.     end
  132.  
  133.     for _,v in pairs(player.GetAll()) do
  134.         if not playertable[v:EntIndex()] then continue end
  135.        
  136.         local weapons = table.concat(playertable[v:EntIndex()].weapons,", ")
  137.  
  138.         local refundemb = vgui.Create("DPanel", scrollpanel)
  139.         refundemb:SetSize(0,80)
  140.         refundemb:DockMargin(0,0,0,5)
  141.         refundemb:Dock( TOP )
  142.         function refundemb:Paint(w,h)
  143.             draw.RoundedBox(5,0,0,w,h,Color(26,30,39))
  144.             draw.SimpleText(lang.NameText.." : " .. v:GetName(), "WasiedRefundFont3", 80, 10, Color(255, 255, 255))
  145.             draw.SimpleText(lang.MoneyBeforeDeathText.." : " .. playertable[v:EntIndex()].money .. lang.Currency, "WasiedRefundFont3", 80, 25, Color(255, 255, 255))
  146.             draw.DrawText(lang.WeaponsBeforeDeathText.." :\n".. weapons, "WasiedRefundFont3", 80, 40, Color(255,255,255))
  147.         end
  148.  
  149.         local pm = vgui.Create("DModelPanel", refundemb)
  150.         pm:SetSize(70,70)
  151.         pm:SetPos(5,5)
  152.         pm:SetModel(v:GetModel())
  153.         pm:SetFOV(15)
  154.         pm:SetCamPos(Vector(50,0,55))
  155.         pm:SetLookAt(v:OBBCenter() + Vector(0,0,25))
  156.         function pm:LayoutEntity() return end
  157.         function pm.Entity:GetPlayerColor() return v:GetPlayerColor() end
  158.  
  159.         local acceptbutton = vgui.Create("DButton", refundemb)
  160.         acceptbutton:SetPos(400,15)
  161.         acceptbutton:SetSize(100,35)
  162.         acceptbutton:SetText(lang.RefundButtonText)
  163.         acceptbutton:SetTextColor(Color(255,255,255))
  164.         acceptbutton:SetFont("WasiedRefundFont")
  165.         acceptbutton.OnCursorEntered = function(self)
  166.             surface.PlaySound("UI/buttonrollover.wav")
  167.             self.hover = true
  168.         end
  169.         acceptbutton.OnCursorExited = function(self)
  170.             self.hover = false
  171.         end
  172.         acceptbutton.Paint = function(self, w, h)
  173.             if !self.hover then
  174.                 draw.RoundedBox(6, 0, 0, w, h, Color(0,128,255))
  175.             else
  176.                 draw.RoundedBox(5, 0, 0, w, h, Color(0,160,255))
  177.             end
  178.         end
  179.         acceptbutton.DoClick = function()
  180.             if IsValid(v) then
  181.                 net.Start("AdvAdminSyst:Refund:ReturnStuff")
  182.                     net.WriteEntity(v)
  183.                 net.SendToServer()
  184.  
  185.                 refundframe:Close()
  186.                 surface.PlaySound("buttons/button14.wav")
  187.             end
  188.         end
  189.     end
  190.  
  191. end)
  192.  
  193. -- Staff Mod
  194. local function ShowBasicInfos()
  195.  
  196.     if staffMod == 1 then
  197.         if AdvancedStaffConfig.AllowedRanks[LocalPlayer():GetUserGroup()] then
  198.  
  199.             for _,v in pairs(player.GetAll()) do
  200.                 if !IsValid(v) then return end
  201.                 if LocalPlayer() != v then
  202.  
  203.                     local pos = v:GetShootPos()
  204.                     pos.z = pos.z+5
  205.                     pos = pos:ToScreen()
  206.                     if not pos.visible then continue end
  207.                     local x, y = pos.x, pos.y
  208.  
  209.                     draw.DrawText("●", "Trebuchet20", x-2 , y-27, team.GetColor(v:Team()), TEXT_ALIGN_CENTER)
  210.                     if v:GetPos():Distance(LocalPlayer():GetPos()) < AdvancedStaffConfig.MaxDistance then
  211.  
  212.                         -- Name
  213.                         draw.RoundedBox( 0, x-62, y-71, 130, 20, Color(0,0,0,90) )
  214.                         surface.SetDrawColor( 255, 255, 255, 255 )
  215.                         surface.SetMaterial( Material("icon16/vcard.png") )
  216.                         surface.DrawTexturedRect( x-60, y-69, 16, 16 )
  217.                         draw.DrawText(v:GetName(), "Trebuchet18", x+10 , y-71, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  218.  
  219.                         -- Job
  220.                         local jobColor = team.GetColor(v:Team())
  221.                         local jobName = team.GetName(v:Team())
  222.                         jobColor.a = 90
  223.  
  224.                         draw.RoundedBox( 0, x-62, y-50, 130, 20, jobColor )
  225.                         surface.SetDrawColor( 255, 255, 255, 255 )
  226.                         surface.SetMaterial( Material("icon16/user_suit.png") )
  227.                         surface.DrawTexturedRect( x-60, y-48, 16, 16 )
  228.                         draw.DrawText(jobName, "Trebuchet20", x , y-50, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  229.  
  230.                         if LocalPlayer():GetNWInt("MoreInfos") == 1 then
  231.  
  232.                             -- Money
  233.                             local money = v:getDarkRPVar("money") or 0
  234.  
  235.                             draw.RoundedBox( 0, x-62, y-92, 130, 20,  Color(0,204,0,90))
  236.                             surface.SetDrawColor( 255, 255, 255, 255 )
  237.                             surface.SetMaterial( Material("icon16/money.png") )
  238.                             surface.DrawTexturedRect( x-60, y-90, 16, 16 )
  239.                             draw.DrawText(money..lang.Currency, "Trebuchet20", x, y-94, Color(255,255,255), TEXT_ALIGN_CENTER)
  240.  
  241.                             -- Health
  242.                             local plyHealth = math.Clamp(v:Health(), 0, 100)
  243.  
  244.                             draw.RoundedBox( 0, x-62, y-114, plyHealth*1.3, 20, Color(255,0,0,90))
  245.                             surface.SetDrawColor( 255, 0, 0, 255 )
  246.                             surface.SetMaterial( Material("icon16/heart.png") )
  247.                             surface.DrawTexturedRect( x-60, y-112, 16, 16 )
  248.                             draw.DrawText(v:Health()..lang.HealthPoint, "Trebuchet20", x, y-116, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  249.  
  250.                             -- Armor
  251.                             local plyArmor = math.Clamp(v:Armor(), 0, 100)
  252.  
  253.                             if plyArmor == 0 then
  254.                                 draw.RoundedBox( 0, x-62, y-136, 130, 20, Color(0,0,0,90))
  255.                             else
  256.                                 draw.RoundedBox( 0, x-62, y-136, plyArmor*1.3, 20, Color(255,0,0,90))
  257.                             end
  258.                            
  259.                             surface.SetDrawColor( 255, 255, 255, 255 )
  260.                             surface.SetMaterial( Material("icon16/shield.png") )
  261.                             surface.DrawTexturedRect( x-60, y-134, 16, 16 )
  262.                             draw.DrawText(v:Armor(), "Trebuchet20", x, y-138, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  263.  
  264.                             -- Hunger
  265.                             local plyHunger = v:getDarkRPVar( "Energy" ) or 0
  266.  
  267.                             if plyHunger == 0 then
  268.                                 draw.RoundedBox( 0, x-62, y-158, 130, 20, Color(0,0,0,90))
  269.                             else
  270.                                 draw.RoundedBox( 0, x-62, y-158, plyHunger*130/100, 20, Color(255, 110, 0,90))
  271.                             end
  272.                            
  273.                             surface.SetDrawColor( 255, 255, 255, 255 )
  274.                             surface.SetMaterial( Material("icon16/cup.png") )
  275.                             surface.DrawTexturedRect( x-60, y-156, 16, 16 )
  276.                             draw.DrawText(plyHunger, "Trebuchet20", x, y-160, Color(255,255,255), TEXT_ALIGN_CENTER)
  277.                            
  278.                             -- Rank
  279.                             local plyRank = v:GetUserGroup()
  280.  
  281.                             draw.RoundedBox( 0, x-62, y-178, 130, 20, Color(255, 110, 0,90))
  282.                             surface.SetDrawColor( 255, 255, 255, 255 )
  283.                             surface.SetMaterial( Material("icon16/key.png") )
  284.                             surface.DrawTexturedRect( x-60, y-176, 16, 16 )
  285.                             draw.DrawText(plyRank, "Trebuchet20", x, y-180, Color(255,255,255), TEXT_ALIGN_CENTER)
  286.  
  287.                         end
  288.                     end
  289.                 end
  290.             end
  291.         end
  292.     end
  293. end
  294. hook.Add("HUDPaint", "DrawPlyInfos", ShowBasicInfos)
  295.  
  296. net.Receive("AdvAdminSyst:ShowInfo:Show", function()
  297.     local int = net.ReadInt(4)
  298.     staffMod = int
  299. end)
  300.  
  301. net.Receive("AdvAdminSyst:AdminMenu:Open", function()
  302.  
  303.     if IsValid(menuframe) then return end
  304.  
  305.     local menuframe = vgui.Create("DFrame")
  306.     menuframe:SetSize(ScrW()/2,ScrH()/4)
  307.     menuframe:Center()
  308.     menuframe:SetTitle("")
  309.     menuframe:SetDraggable(false)
  310.     menuframe:MakePopup()
  311.     function menuframe:Paint(w,h)
  312.         draw.RoundedBox(3, 0, 0, w, h, Color(30,30,30,230))
  313.         draw.RoundedBox(2, 0, 0, w, 40, Color(60,120,255))
  314.        
  315.         draw.SimpleText(lang.AdminMenuTitle, "WasiedAdminMenuTitle", w/2, 7, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  316.     end
  317.  
  318.     local refundMenu = vgui.Create("DButton", menuframe)
  319.     refundMenu:SetPos(10, 60)
  320.     refundMenu:SetSize(menuframe:GetWide()/2-20,55)
  321.     refundMenu:SetText("")
  322.     refundMenu.OnCursorEntered = function(self)
  323.         surface.PlaySound("UI/buttonrollover.wav")
  324.         self.hover = true
  325.     end
  326.     refundMenu.OnCursorExited = function(self)
  327.         self.hover = false
  328.     end
  329.     function refundMenu:Paint(w, h)
  330.         if !self.hover then
  331.             draw.RoundedBox(8, 0, 0, w, h, Color(0,0,0,220))
  332.         else
  333.             draw.RoundedBox(8, 0, 0, w, h, Color(30,30,30,220))
  334.         end
  335.         draw.SimpleText(lang.RefundMenuTitle, "WasiedAdminMenuButton", w/2, h/2, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  336.     end
  337.     refundMenu.DoClick = function()
  338.         menuframe:Close()
  339.         LocalPlayer():ConCommand("say "..AdvancedStaffConfig.RefundTextCommand)
  340.     end
  341.  
  342.     local staffMod = vgui.Create("DButton", menuframe)
  343.     staffMod:SetPos(menuframe:GetWide()/2+10, 60)
  344.     staffMod:SetSize(menuframe:GetWide()/2-20,55)
  345.     staffMod:SetText("")
  346.     staffMod.OnCursorEntered = function(self)
  347.         surface.PlaySound("UI/buttonrollover.wav")
  348.         self.hover = true
  349.     end
  350.     staffMod.OnCursorExited = function(self)
  351.         self.hover = false
  352.     end
  353.     function staffMod:Paint(w, h)
  354.         if !self.hover then
  355.             draw.RoundedBox(8, 0, 0, w, h, Color(0,0,0,220))
  356.         else
  357.             draw.RoundedBox(8, 0, 0, w, h, Color(30,30,30,220))
  358.         end
  359.         if staffMod == 0 then
  360.             draw.SimpleText(lang.Activate.." "..string.lower(lang.StaffModTitle), "WasiedAdminMenuButton", w/2, h/2, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  361.         elseif staffMod == 1 then
  362.             draw.SimpleText(lang.Disable.." "..string.lower(lang.StaffModTitle), "WasiedAdminMenuButton", w/2, h/2, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  363.         elseif staffMod == 2 then
  364.             draw.SimpleText(lang.PleaseWait, "WasiedAdminMenuButton", w/2, h/2, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  365.         end
  366.    
  367.     end
  368.     staffMod.DoClick = function()
  369.         menuframe:Close()
  370.         LocalPlayer():ConCommand("say "..AdvancedStaffConfig.StaffCommand)
  371.     end
  372.  
  373.     local closeButton = vgui.Create("DButton", menuframe)
  374.     closeButton:SetPos(10, menuframe:GetTall()-65)
  375.     closeButton:SetSize(menuframe:GetWide()-20,55)
  376.     closeButton:SetText("")
  377.     closeButton.OnCursorEntered = function(self)
  378.         surface.PlaySound("UI/buttonrollover.wav")
  379.         self.hover = true
  380.     end
  381.     closeButton.OnCursorExited = function(self)
  382.         self.hover = false
  383.     end
  384.     function closeButton:Paint(w, h)
  385.         if self.hover then
  386.             draw.RoundedBox(3, 0, 0, w, h, Color(100,140,255))
  387.         else
  388.             draw.RoundedBox(3, 0, 0, w, h, Color(90,130,255))
  389.         end
  390.         draw.SimpleText(lang.CloseButton, "WasiedAdminMenuClose", w/2, h/2, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  391.     end
  392.     closeButton.DoClick = function()
  393.         menuframe:Close()
  394.     end
  395.  
  396. end)
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404. -- Server
  405. -- Networking
  406. util.AddNetworkString("AdvAdminSyst:Refund:ReturnStuff")
  407. util.AddNetworkString("AdvAdminSyst:Refund:OpenMenu")
  408. util.AddNetworkString("AdvAdminSyst:AdminMenu:Open")
  409. util.AddNetworkString("AdvAdminSyst:ShowInfo:Show")
  410.  
  411. local function VerifyStaff(ply)
  412.  
  413.     if !IsValid(ply) then return false end
  414.  
  415.     if !AdvancedStaffConfig.AllowedRanks[ply:GetUserGroup()] then
  416.         DarkRP.notify(ply, 0, 7, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].UnableTo)
  417.         return false
  418.     else
  419.         return true
  420.     end
  421.  
  422. end
  423.  
  424. -- Refund Menu
  425. hook.Add("PlayerDeath", "RefundCheckDeath", function(ply, inflicator, attacker)
  426.    
  427.     local weapons = {}
  428.     local pos = ply:GetPos()
  429.    
  430.     ply.refund = {
  431.         money = ply:getDarkRPVar("money"),
  432.         weapons = weapons
  433.     }  
  434.    
  435.     for _,v in pairs(ply:GetWeapons()) do
  436.  
  437.         if !IsValid(v) then return false end
  438.        
  439.         table.insert(weapons, v:GetClass())
  440.         if AdvancedStaffConfig.dropWeapons then
  441.             for _,bWeap in pairs(AdvancedStaffConfig.blacklistedWeapons) do
  442.                 if bWeap != v then
  443.                     ply:DropWeapon(v)
  444.                 end
  445.             end
  446.         end
  447.     end
  448.  
  449.     if AdvancedStaffConfig.dropMoney then DarkRP.createMoneyBag(pos, ply:getDarkRPVar("money")) end
  450.     if AdvancedStaffConfig.lostWeapons then ply:StripWeapons() end
  451.     if AdvancedStaffConfig.lostMoney then ply:setDarkRPVar("money", 0) end
  452.  
  453. end)
  454.  
  455. net.Receive("AdvAdminSyst:Refund:ReturnStuff",function(len, ply)
  456.     local playerrefund = net.ReadEntity()
  457.    
  458.     if VerifyStaff(ply) then
  459.         if IsValid(playerrefund) and playerrefund:Alive() then
  460.  
  461.             if not playerrefund.refund then return end
  462.  
  463.             for k, v in pairs(playerrefund.refund.weapons) do
  464.                 playerrefund:Give(v)
  465.             end
  466.  
  467.             playerrefund:setDarkRPVar("money", playerrefund.refunshowd.money)
  468.             playerrefund.refund = nil
  469.             DarkRP.notify(playerrefund, 0, 7, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].SuccessfullNotificationText.." ".. ply:GetName())
  470.  
  471.         else
  472.             DarkRP.notify(ply, 0, 7, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].DisconnectedTarget)
  473.         end
  474.     end
  475.  
  476. end)
  477.  
  478. local showInfos = 0
  479. local staffJob = AdvancedStaffConfig.AllowedTeam
  480. local returnJob = AdvancedStaffConfig.ReturnTeam
  481. hook.Add("PlayerSay", "AdvancedAdminSystem:OnStaffCommand", function(staff, text)
  482.  
  483.     if !IsValid(staff) then return end
  484.  
  485.     local playertable = {}
  486.  
  487.     if text == AdvancedStaffConfig.ShowMoreCommand then
  488.        
  489.         if !AdvancedStaffConfig.ShowMoreContext && AdvancedStaffConfig.ShowMoreInfos && VerifyStaff(staff) then
  490.            
  491.             if showInfos == 0 then
  492.                 showInfos = 1
  493.             elseif showInfos == 1 then
  494.                 showInfos = 0
  495.             end
  496.  
  497.             net.Start("AdvAdminSyst:ShowInfo:Show")
  498.                 net.WriteInt(showInfos, 4)
  499.             net.Send(staff)                
  500.  
  501.         end
  502.  
  503.     elseif text == AdvancedStaffConfig.RefundTextCommand then
  504.  
  505.         if VerifyStaff(staff) then
  506.  
  507.             for _,v in pairs(player.GetAll()) do
  508.                 if not v.refund then continue end
  509.                 playertable[v:EntIndex()] = v.refund
  510.             end
  511.  
  512.             net.Start("AdvAdminSyst:Refund:OpenMenu")
  513.                 net.WriteTable(playertable)
  514.             net.Send(staff)
  515.  
  516.             DarkRP.notify(staff, 0, 5, "Ouverture du menu de remboursement...")
  517.        
  518.         end
  519.  
  520.     elseif text == AdvancedStaffConfig.StaffCommand && AdvancedStaffConfig.StaffSystem then
  521.        
  522.         if VerifyStaff(staff) then
  523.        
  524.             if staff:GetNWInt("StaffMod") == 0 then
  525.  
  526.                 if AdvancedStaffConfig.EnableChangeTeam then
  527.                     if staff:Team() != staffJob then
  528.                         staff:changeTeam(staffJob, true, AdvancedStaffConfig.HideNotifOnChangeTeam)
  529.                     end
  530.                 end
  531.  
  532.                 if AdvancedStaffConfig.EnableGod then
  533.                     staff:GodEnable()
  534.                 end
  535.  
  536.                 if AdvancedStaffConfig.EnableRevive then
  537.                     staff:SetHealth(100)
  538.                 end
  539.  
  540.                 if AdvancedStaffConfig.EnableCloak then
  541.                     ULib.invisible( staff, true, 0 )
  542.                 end
  543.  
  544.                 if AdvancedStaffConfig.EnableNoclip then
  545.                     staff:SetMoveType(MOVETYPE_NOCLIP)
  546.                 end
  547.  
  548.                 DarkRP.notify(staff, 0, 5, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].EnterStaffMod)
  549.                 staff:SetNWInt("StaffMod" , 1)
  550.                
  551.             elseif staff:GetNWInt("StaffMod") == 1 then
  552.                
  553.                 if AdvancedStaffConfig.EnableChangeTeam then
  554.                     if staff:Team() != returnJob then
  555.                         staff:changeTeam(returnJob, true, AdvancedStaffConfig.HideNotifOnChangeTeam)
  556.                     end
  557.                 end
  558.  
  559.                 if AdvancedStaffConfig.EnableRevive then
  560.                     staff:SetHealth(100)
  561.                 end
  562.  
  563.                 if AdvancedStaffConfig.EnableCloak then
  564.                     ULib.invisible( staff, false, 0 )
  565.                 end
  566.  
  567.                 if AdvancedStaffConfig.EnableNoclip then
  568.                     staff:SetMoveType(MOVETYPE_WALK)
  569.                 end
  570.  
  571.                 if AdvancedStaffConfig.EnableGod then
  572.                     DarkRP.notify(staff, 0, 5, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].GodSecurity)
  573.                     staff:SetNWInt("StaffMod", 2)
  574.  
  575.                     timer.Simple(3, function()
  576.                         staff:GodDisable()
  577.                         staff:SetNWInt("StaffMod" , 0)
  578.                         DarkRP.notify(staff, 0, 5, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].GodSuccessfull)
  579.                     end)
  580.                 else
  581.                     staff:SetNWInt("StaffMod", 0)
  582.                 end
  583.  
  584.                 DarkRP.notify(staff, 0, 5, AdvancedStaffConfig.Language[AdvancedStaffConfig.ScriptLanguage].LeaveStaffMod)
  585.             end
  586.         end
  587.  
  588.     elseif text == AdvancedStaffConfig.AdminMenuCommand && AdvancedStaffConfig.AdminMenu then
  589.        
  590.         if VerifyStaff(staff) then
  591.             net.Start("AdvAdminSyst:AdminMenu:Open")
  592.             net.Send(staff)
  593.             DarkRP.notify(staff, 0, 5, "Ouverture du menu d'administration...")
  594.         end
  595.    
  596.     end
  597.  
  598. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement