SHARE
TWEET

Untitled

a guest Aug 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- FICHIER SERVEUR :
  2.  
  3. util.AddNetworkString("Eryzium:EnableAdminMode")
  4. util.AddNetworkString("Eryzium:DisableAdminMode")
  5. util.AddNetworkString("Eryzium:Open:Admin:Menu")
  6.  
  7. hook.Add( "PlayerSay", "EryziumPlayerSayOpenMenu", function( ply, text, team )
  8.     if not EryziumPanel.GroupAccess[ply:GetUserGroup()] then
  9.         return DarkRP.notify(ply, 1, 4, "Vous n'avez pas accès à ce menu")
  10.     end
  11.     if(string.lower( text ) == EryziumPanel.Command)then
  12.         net.Start("Eryzium:Open:Admin:Menu")
  13.         net.Send(ply)
  14.     end
  15. end)
  16.  
  17. hook.Add("PlayerSpawn", "EryziumPlayerSpawnSetService", function(ply)
  18.     if EryziumPanel.GroupAccess[ply:GetUserGroup()] then
  19.         ply:SetNWString("EryziumAdminMode", "Non disponible")
  20.     end
  21. end)
  22.  
  23. net.Receive("Eryzium:EnableAdminMode", function(lenght, ply)
  24.     if EryziumPanel.GroupAccess[ply:GetUserGroup()] then
  25.         ply:SetNWString("EryziumAdminMode", "En service")
  26.         DarkRP.notify(ply, 0, 4, "Vous êtes en service")
  27.     end
  28. end)
  29.  
  30. net.Receive("Eryzium:DisableAdminMode", function(lenght, ply)
  31.     if EryziumPanel.GroupAccess[ply:GetUserGroup()] then
  32.         ply:SetNWString("EryziumAdminMode", "Non disponible")
  33.         DarkRP.notify(ply, 0, 4, "Vous n'êtes plus en service")
  34.     end
  35. end)
  36.  
  37. hook.Add("PlayerNoClip", "EryziumPlayerNoClip", function(ply, desiredNoClipState)
  38.     if(desiredNoClipState)then
  39.         if EryziumPanel.GroupAccess[ply:GetUserGroup()] then
  40.             if(ply:GetNWString("EryziumAdminMode", "Non disponible"))then
  41.                 return false, DarkRP.notify(ply, 1, 4, "Vous devez être en service pour noclip")
  42.             end
  43.         else
  44.             return false
  45.         end
  46.     end
  47. end)
  48.  
  49.  
  50.  
  51. -- FICHIER CLIENT :
  52.  
  53.  
  54.  
  55. net.Receive("Eryzium:Open:Admin:Menu", function()
  56.     local MainPanelAdmin = vgui.Create( "DFrame" )
  57.     MainPanelAdmin:Center()
  58.     MainPanelAdmin:SetSize( 500, 350 )
  59.     MainPanelAdmin:SetTitle( "" )
  60.     MainPanelAdmin:SetVisible( true )
  61.     MainPanelAdmin:SetDraggable( false )
  62.     MainPanelAdmin:ShowCloseButton( false )
  63.     MainPanelAdmin:MakePopup()
  64.  
  65.     local DermaButton = vgui.Create( "DButton", MainPanelAdmin )
  66.     DermaButton:SetText( "X" )                    
  67.     DermaButton:SetPos( 478, 0 )                    
  68.     DermaButton:SetSize( 20, 20 )                    
  69.     DermaButton.DoClick = function()                
  70.         MainPanelAdmin:Close()
  71.     end
  72.  
  73.     local Service = vgui.Create( "DButton", MainPanelAdmin )
  74.     Service:SetText( "Prise de Service" )
  75.     Service:SetPos( 200, 200 )
  76.     Service:SetSize( 100, 100 )
  77.     Service.DoClick = function()
  78.         if(ply:GetNWString("EryziumAdminMode") == "Non disponible")
  79.             net.Start("Eryzium:EnableAdminMode")
  80.             net.SendToServer()
  81.             RunConsoleCommand("ulx", "god", LocalPlayer:Nick())
  82.             RunConsoleCommand("ulx", "cloak", LocalPlayer:Nick())
  83.         elseif(ply:GetNWString("EryziumAdminMode") == "En service")
  84.             net.Start("Eryzium:DisableAdminMode")
  85.             net.SendToServer()
  86.             RunConsoleCommand("ulx", "ungod", LocalPlayer:Nick())
  87.             RunConsoleCommand("ulx", "uncloak", LocalPlayer:Nick())
  88.         end
  89.     end
  90. end)
  91.  
  92. -- FICHIER CONFIG :
  93.  
  94.  
  95.  
  96. EryziumPanel = EryziumPanel or {}
  97. EryziumPanel.Command = "!panel"
  98. EryziumPanel.GroupAccess = {
  99.    
  100.  
  101.     ["superadmin"] = true,
  102.     ["Administrateur"] = true,
  103.  
  104. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top