Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add( "OnPlayerChat", "OpenCrateGui", function( ply, text, team )
- if (string.sub(text, 1, 11) == "/gestion") && ply == LocalPlayer() then
- if ply:Team() == TEAM_CO then
- local mainpanel = vgui.Create("DFrame")
- mainpanel:SetSize( 600, 400)
- mainpanel:SetPos(0,0)
- mainpanel:Center()
- mainpanel:SetTitle("")
- mainpanel:SetDraggable(false)
- mainpanel:MakePopup()
- mainpanel:ShowCloseButton(true)
- local x,y = mainpanel:GetSize()
- function mainpanel:Paint(w,h)
- end
- local bluebar = vgui.Create("DPanel", mainpanel)
- bluebar:SetSize(x,30)
- bluebar:SetPos(0,0)
- function bluebar:Paint(w,h)
- draw.RoundedBox(0,0,0,w,h,Color(0,147,255,255))
- end
- local button = vgui.Create("DButton", mainpanel)
- button:SetFont("DermaDefault")
- button:SetText("X")
- button:SetSize(70,30)
- button:SetPos(x - 50, 0)
- button:SetColor(Color(255,255,255))
- function button:Paint (w,h)
- end
- button.DoClick = function ()
- mainpanel:SetVisible(false)
- end
- local maincollumn = vgui.Create("DPanel", mainpanel)
- maincollumn:SetSize(x, y - 30)
- maincollumn:SetPos(0,30)
- function maincollumn:Paint(w,h)
- draw.RoundedBox(0,0,0,w,h,Color(48,48,48,255))
- draw.DrawText("URGENCES", "DermaDefault", 15, 30, Color(255,255,255))
- draw.RoundedBox(0,10,50,200,1,Color(255,255,255))
- draw.RoundedBox(0,10,250,200,1,Color(255,255,255))
- draw.DrawText("GOUVERNEMENT", "DermaDefault", x-15, 30, Color(255,255,255),TEXT_ALIGN_RIGHT)
- draw.RoundedBox(0,x-10-200,50,200,1,Color(255,255,255))
- draw.RoundedBox(0,x-10-200,250,200,1,Color(255,255,255))
- draw.DrawText("AUTRES ACTIONS", "DermaDefault", x/2, y/2+45, Color(255,255,255),TEXT_ALIGN_CENTER)
- end
- local drawPlayer = vgui.Create("DModelPanel", mainpanel)
- drawPlayer:SetSize(200,200)
- drawPlayer:SetModel(LocalPlayer():GetModel())
- drawPlayer:SetPos(x/2-100,y/2-125)
- local x,y = maincollumn:GetSize()
- local urgencesmain = vgui.Create("DPanel", maincollumn)
- urgencesmain:SetSize(200, 185)
- urgencesmain:SetPos(10, 50)
- function urgencesmain:Paint(w,h)
- end
- local urgencesbutton_gocf = vgui.Create("DButton", urgencesmain)
- urgencesbutton_gocf:SetSize(150,40)
- urgencesbutton_gocf:SetPos(20,25)
- urgencesbutton_gocf:SetColor(Color(255,255,255))
- urgencesbutton_gocf:SetText("Lancer le couvre-feu")
- function urgencesbutton_gocf:Paint(w,h)
- if (urgencesbutton_gocf:IsDown()) then
- urgencesbutton_gocf:SetColor(Color(150,150,150))
- elseif( urgencesbutton_gocf:IsHovered()) then
- urgencesbutton_gocf:SetColor(Color(10,147,255,255))
- else
- urgencesbutton_gocf:SetColor(Color(255,255,255))
- end
- end
- urgencesbutton_gocf.DoClick = function()
- surface.PlaySound( "buttons/button15.wav" )
- RunConsoleCommand( "say", "/lockdown" )
- end
- local urgencesbutton_endcf = vgui.Create("DButton", urgencesmain)
- urgencesbutton_endcf:SetSize(150,40)
- urgencesbutton_endcf:SetPos(20,75)
- urgencesbutton_endcf:SetText("Arrêter le couvre-feu")
- --urgencesbutton_endcf:SetImage( "icon16/shape_square_error.png" )
- urgencesbutton_endcf:SetColor(Color(255,255,255))
- function urgencesbutton_endcf:Paint(w,h)
- if (urgencesbutton_endcf:IsDown()) then
- urgencesbutton_endcf:SetColor(Color(150,150,150))
- elseif( urgencesbutton_endcf:IsHovered()) then
- urgencesbutton_endcf:SetColor(Color(10,147,255,255))
- else
- urgencesbutton_endcf:SetColor(Color(255,255,255))
- end
- end
- urgencesbutton_endcf.DoClick = function()
- surface.PlaySound( "buttons/button15.wav" )
- RunConsoleCommand( "say", "/unlockdown" )
- end
- local urgencesbutton_callpolice = vgui.Create("DButton", urgencesmain)
- urgencesbutton_callpolice:SetSize(150,40)
- urgencesbutton_callpolice:SetPos(20,125)
- urgencesbutton_callpolice:SetText("Appeller la police")
- --urgencesbutton_callpolice:SetImage( "icon16/shape_square_error.png" )
- urgencesbutton_callpolice:SetColor(Color(255,255,255))
- function urgencesbutton_callpolice:Paint(w,h)
- if (urgencesbutton_callpolice:IsDown()) then
- urgencesbutton_callpolice:SetColor(Color(150,150,150))
- elseif( urgencesbutton_callpolice:IsHovered()) then
- urgencesbutton_callpolice:SetColor(Color(10,147,255,255))
- else
- urgencesbutton_callpolice:SetColor(Color(255,255,255))
- end
- end
- local gouvernementmain = vgui.Create("DPanel", maincollumn)
- gouvernementmain:SetSize(200,185)
- gouvernementmain:SetPos(x-10-200, 50)
- function gouvernementmain:Paint(w,h)
- end
- local gouvernementbutton_addlaw = vgui.Create("DButton", gouvernementmain)
- gouvernementbutton_addlaw:SetSize(150,40)
- gouvernementbutton_addlaw:SetPos(20,25)
- gouvernementbutton_addlaw:SetText("Ajouter une loi")
- gouvernementbutton_addlaw:SetColor(Color(255,255,255))
- function gouvernementbutton_addlaw:Paint(w,h)
- if (gouvernementbutton_addlaw:IsDown()) then
- gouvernementbutton_addlaw:SetColor(Color(150,150,150))
- elseif( gouvernementbutton_addlaw:IsHovered()) then
- gouvernementbutton_addlaw:SetColor(Color(10,147,255,255))
- else
- gouvernementbutton_addlaw:SetColor(Color(255,255,255))
- end
- end
- gouvernementbutton_addlaw.DoClick = function()
- surface.PlaySound( "buttons/button15.wav" )
- Derma_StringRequest("", "Ajouter une loi, en écrivant juste en dessous!", "", function( text ) RunConsoleCommand( "say", "/addlaw "..text ) end )
- end
- local gouvernementbutton_deletelaw = vgui.Create("DButton", gouvernementmain)
- gouvernementbutton_deletelaw:SetSize(150,40)
- gouvernementbutton_deletelaw:SetPos(20,75)
- gouvernementbutton_deletelaw:SetText("Supprimer une loi")
- gouvernementbutton_deletelaw:SetColor(Color(255,255,255))
- function gouvernementbutton_deletelaw:Paint(w,h)
- if (gouvernementbutton_deletelaw:IsDown()) then
- gouvernementbutton_deletelaw:SetColor(Color(150,150,150))
- elseif( gouvernementbutton_deletelaw:IsHovered()) then
- gouvernementbutton_deletelaw:SetColor(Color(10,147,255,255))
- else
- gouvernementbutton_deletelaw:SetColor(Color(255,255,255))
- end
- end
- gouvernementbutton_deletelaw.DoClick = function()
- surface.PlaySound( "buttons/button15.wav" )
- Derma_StringRequest("", "Ecrivez le numéro de la loi que vous voulez enlever (ex: 3)!", "", function( text ) RunConsoleCommand( "say", "/removelaw "..text ) end, function( text ) print( "x" ) end)
- end
- local gouvernementbutton_board = vgui.Create("DButton", gouvernementmain)
- gouvernementbutton_board:SetSize(150,40)
- gouvernementbutton_board:SetPos(20,125)
- gouvernementbutton_board:SetText("Tableau des lois")
- gouvernementbutton_board:SetColor(Color(255,255,255))
- function gouvernementbutton_board:Paint(w,h)
- if (gouvernementbutton_board:IsDown()) then
- gouvernementbutton_board:SetColor(Color(150,150,150))
- elseif( gouvernementbutton_board:IsHovered()) then
- gouvernementbutton_board:SetColor(Color(10,147,255,255))
- else
- gouvernementbutton_board:SetColor(Color(255,255,255))
- end
- end
- gouvernementbutton_board.DoClick = function()
- surface.PlaySound( "buttons/button15.wav" )
- Derma_Query( "Êtes vous sûr de vouloir placer un tableau des lois ?", "",
- "OUI!", function() RunConsoleCommand( "say", "/placelaws" ) end,
- "Non.", function() MsgN( "x" ) end )
- end
- local othermain = vgui.Create("DPanel", maincollumn)
- othermain:SetSize(x-50,75)
- othermain:SetPos(25,y/2+90)
- function othermain:Paint(w,h)
- end
- local x,y = othermain:GetSize()
- local other_annonce = vgui.Create("DButton", othermain)
- other_annonce:SetSize(150,40)
- other_annonce:SetPos(x/2-75,y/2-20)
- other_annonce:SetText("Faire une annonce")
- other_annonce:SetColor(Color(255,255,255))
- function other_annonce:Paint(w,h)
- if (other_annonce:IsDown()) then
- other_annonce:SetColor(Color(150,150,150))
- elseif( other_annonce:IsHovered()) then
- other_annonce:SetColor(Color(10,147,255,255))
- else
- other_annonce:SetColor(Color(255,255,255))
- end
- end
- other_annonce.DoClick = function()
- surface.PlaySound( "buttons/button15.wav" )
- Derma_StringRequest("", "Faite une annonce, en écrivant juste en dessous!","", function( text ) RunConsoleCommand( "say", "/broadcast " .. text ) end,
- function( text ) print( "x" ) end)
- end
- local name_server = vgui.Create("DLabel", bluebar)
- name_server:SetSize(300,30)
- name_server:SetPos(10,0)
- name_server:SetText("URANIUM COMMUNITY - MENU DU MAIRE")
- name_server:SetTextColor(Color(255,255,255))
- name_server:SetFont("DermaDefault")
- else
- ply:ChatPrint("Tu n'as pas le job requis pour accéder à ce menu!")
- end
- end
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement