Advertisement
Guest User

Untitled

a guest
May 26th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.05 KB | None | 0 0
  1.  
  2. hook.Add( "OnPlayerChat", "OpenCrateGui", function( ply, text, team )
  3.  
  4. if (string.sub(text, 1, 11) == "/gestion") && ply == LocalPlayer() then
  5. if ply:Team() == TEAM_CO then
  6.  
  7. local mainpanel = vgui.Create("DFrame")
  8. mainpanel:SetSize( 600, 400)
  9. mainpanel:SetPos(0,0)
  10. mainpanel:Center()
  11. mainpanel:SetTitle("")
  12. mainpanel:SetDraggable(false)
  13. mainpanel:MakePopup()
  14. mainpanel:ShowCloseButton(true)
  15.  
  16. local x,y = mainpanel:GetSize()
  17.  
  18. function mainpanel:Paint(w,h)
  19. end
  20.  
  21. local bluebar = vgui.Create("DPanel", mainpanel)
  22. bluebar:SetSize(x,30)
  23. bluebar:SetPos(0,0)
  24. function bluebar:Paint(w,h)
  25. draw.RoundedBox(0,0,0,w,h,Color(0,147,255,255))
  26. end
  27.  
  28. local button = vgui.Create("DButton", mainpanel)
  29. button:SetFont("DermaDefault")
  30. button:SetText("X")
  31. button:SetSize(70,30)
  32. button:SetPos(x - 50, 0)
  33. button:SetColor(Color(255,255,255))
  34. function button:Paint (w,h)
  35. end
  36. button.DoClick = function ()
  37. mainpanel:SetVisible(false)
  38. end
  39.  
  40. local maincollumn = vgui.Create("DPanel", mainpanel)
  41. maincollumn:SetSize(x, y - 30)
  42. maincollumn:SetPos(0,30)
  43.  
  44. function maincollumn:Paint(w,h)
  45. draw.RoundedBox(0,0,0,w,h,Color(48,48,48,255))
  46.  
  47. draw.DrawText("URGENCES", "DermaDefault", 15, 30, Color(255,255,255))
  48. draw.RoundedBox(0,10,50,200,1,Color(255,255,255))
  49. draw.RoundedBox(0,10,250,200,1,Color(255,255,255))
  50.  
  51. draw.DrawText("GOUVERNEMENT", "DermaDefault", x-15, 30, Color(255,255,255),TEXT_ALIGN_RIGHT)
  52. draw.RoundedBox(0,x-10-200,50,200,1,Color(255,255,255))
  53. draw.RoundedBox(0,x-10-200,250,200,1,Color(255,255,255))
  54.  
  55. draw.DrawText("AUTRES ACTIONS", "DermaDefault", x/2, y/2+45, Color(255,255,255),TEXT_ALIGN_CENTER)
  56. end
  57.  
  58. local drawPlayer = vgui.Create("DModelPanel", mainpanel)
  59. drawPlayer:SetSize(200,200)
  60. drawPlayer:SetModel(LocalPlayer():GetModel())
  61. drawPlayer:SetPos(x/2-100,y/2-125)
  62.  
  63. local x,y = maincollumn:GetSize()
  64.  
  65. local urgencesmain = vgui.Create("DPanel", maincollumn)
  66. urgencesmain:SetSize(200, 185)
  67. urgencesmain:SetPos(10, 50)
  68. function urgencesmain:Paint(w,h)
  69. end
  70.  
  71. local urgencesbutton_gocf = vgui.Create("DButton", urgencesmain)
  72. urgencesbutton_gocf:SetSize(150,40)
  73. urgencesbutton_gocf:SetPos(20,25)
  74. urgencesbutton_gocf:SetColor(Color(255,255,255))
  75. urgencesbutton_gocf:SetText("Lancer le couvre-feu")
  76. function urgencesbutton_gocf:Paint(w,h)
  77. if (urgencesbutton_gocf:IsDown()) then
  78. urgencesbutton_gocf:SetColor(Color(150,150,150))
  79. elseif( urgencesbutton_gocf:IsHovered()) then
  80. urgencesbutton_gocf:SetColor(Color(10,147,255,255))
  81. else
  82. urgencesbutton_gocf:SetColor(Color(255,255,255))
  83. end
  84. end
  85. urgencesbutton_gocf.DoClick = function()
  86. surface.PlaySound( "buttons/button15.wav" )
  87. RunConsoleCommand( "say", "/lockdown" )
  88. end
  89.  
  90.  
  91.  
  92. local urgencesbutton_endcf = vgui.Create("DButton", urgencesmain)
  93. urgencesbutton_endcf:SetSize(150,40)
  94. urgencesbutton_endcf:SetPos(20,75)
  95. urgencesbutton_endcf:SetText("Arrêter le couvre-feu")
  96. --urgencesbutton_endcf:SetImage( "icon16/shape_square_error.png" )
  97. urgencesbutton_endcf:SetColor(Color(255,255,255))
  98. function urgencesbutton_endcf:Paint(w,h)
  99. if (urgencesbutton_endcf:IsDown()) then
  100. urgencesbutton_endcf:SetColor(Color(150,150,150))
  101. elseif( urgencesbutton_endcf:IsHovered()) then
  102. urgencesbutton_endcf:SetColor(Color(10,147,255,255))
  103. else
  104. urgencesbutton_endcf:SetColor(Color(255,255,255))
  105. end
  106. end
  107. urgencesbutton_endcf.DoClick = function()
  108. surface.PlaySound( "buttons/button15.wav" )
  109. RunConsoleCommand( "say", "/unlockdown" )
  110. end
  111.  
  112. local urgencesbutton_callpolice = vgui.Create("DButton", urgencesmain)
  113. urgencesbutton_callpolice:SetSize(150,40)
  114. urgencesbutton_callpolice:SetPos(20,125)
  115. urgencesbutton_callpolice:SetText("Appeller la police")
  116. --urgencesbutton_callpolice:SetImage( "icon16/shape_square_error.png" )
  117. urgencesbutton_callpolice:SetColor(Color(255,255,255))
  118. function urgencesbutton_callpolice:Paint(w,h)
  119. if (urgencesbutton_callpolice:IsDown()) then
  120. urgencesbutton_callpolice:SetColor(Color(150,150,150))
  121. elseif( urgencesbutton_callpolice:IsHovered()) then
  122. urgencesbutton_callpolice:SetColor(Color(10,147,255,255))
  123. else
  124. urgencesbutton_callpolice:SetColor(Color(255,255,255))
  125. end
  126. end
  127.  
  128. local gouvernementmain = vgui.Create("DPanel", maincollumn)
  129. gouvernementmain:SetSize(200,185)
  130. gouvernementmain:SetPos(x-10-200, 50)
  131. function gouvernementmain:Paint(w,h)
  132. end
  133.  
  134. local gouvernementbutton_addlaw = vgui.Create("DButton", gouvernementmain)
  135. gouvernementbutton_addlaw:SetSize(150,40)
  136. gouvernementbutton_addlaw:SetPos(20,25)
  137. gouvernementbutton_addlaw:SetText("Ajouter une loi")
  138. gouvernementbutton_addlaw:SetColor(Color(255,255,255))
  139. function gouvernementbutton_addlaw:Paint(w,h)
  140. if (gouvernementbutton_addlaw:IsDown()) then
  141. gouvernementbutton_addlaw:SetColor(Color(150,150,150))
  142. elseif( gouvernementbutton_addlaw:IsHovered()) then
  143. gouvernementbutton_addlaw:SetColor(Color(10,147,255,255))
  144. else
  145. gouvernementbutton_addlaw:SetColor(Color(255,255,255))
  146. end
  147. end
  148. gouvernementbutton_addlaw.DoClick = function()
  149. surface.PlaySound( "buttons/button15.wav" )
  150. Derma_StringRequest("", "Ajouter une loi, en écrivant juste en dessous!", "", function( text ) RunConsoleCommand( "say", "/addlaw "..text ) end )
  151. end
  152.  
  153. local gouvernementbutton_deletelaw = vgui.Create("DButton", gouvernementmain)
  154. gouvernementbutton_deletelaw:SetSize(150,40)
  155. gouvernementbutton_deletelaw:SetPos(20,75)
  156. gouvernementbutton_deletelaw:SetText("Supprimer une loi")
  157. gouvernementbutton_deletelaw:SetColor(Color(255,255,255))
  158. function gouvernementbutton_deletelaw:Paint(w,h)
  159. if (gouvernementbutton_deletelaw:IsDown()) then
  160. gouvernementbutton_deletelaw:SetColor(Color(150,150,150))
  161. elseif( gouvernementbutton_deletelaw:IsHovered()) then
  162. gouvernementbutton_deletelaw:SetColor(Color(10,147,255,255))
  163. else
  164. gouvernementbutton_deletelaw:SetColor(Color(255,255,255))
  165. end
  166. end
  167. gouvernementbutton_deletelaw.DoClick = function()
  168. surface.PlaySound( "buttons/button15.wav" )
  169. 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)
  170. end
  171.  
  172. local gouvernementbutton_board = vgui.Create("DButton", gouvernementmain)
  173. gouvernementbutton_board:SetSize(150,40)
  174. gouvernementbutton_board:SetPos(20,125)
  175. gouvernementbutton_board:SetText("Tableau des lois")
  176. gouvernementbutton_board:SetColor(Color(255,255,255))
  177. function gouvernementbutton_board:Paint(w,h)
  178. if (gouvernementbutton_board:IsDown()) then
  179. gouvernementbutton_board:SetColor(Color(150,150,150))
  180. elseif( gouvernementbutton_board:IsHovered()) then
  181. gouvernementbutton_board:SetColor(Color(10,147,255,255))
  182. else
  183. gouvernementbutton_board:SetColor(Color(255,255,255))
  184. end
  185. end
  186. gouvernementbutton_board.DoClick = function()
  187. surface.PlaySound( "buttons/button15.wav" )
  188. Derma_Query( "Êtes vous sûr de vouloir placer un tableau des lois ?", "",
  189. "OUI!", function() RunConsoleCommand( "say", "/placelaws" ) end,
  190. "Non.", function() MsgN( "x" ) end )
  191. end
  192.  
  193. local othermain = vgui.Create("DPanel", maincollumn)
  194. othermain:SetSize(x-50,75)
  195. othermain:SetPos(25,y/2+90)
  196. function othermain:Paint(w,h)
  197. end
  198.  
  199. local x,y = othermain:GetSize()
  200.  
  201. local other_annonce = vgui.Create("DButton", othermain)
  202. other_annonce:SetSize(150,40)
  203. other_annonce:SetPos(x/2-75,y/2-20)
  204. other_annonce:SetText("Faire une annonce")
  205. other_annonce:SetColor(Color(255,255,255))
  206. function other_annonce:Paint(w,h)
  207. if (other_annonce:IsDown()) then
  208. other_annonce:SetColor(Color(150,150,150))
  209. elseif( other_annonce:IsHovered()) then
  210. other_annonce:SetColor(Color(10,147,255,255))
  211. else
  212. other_annonce:SetColor(Color(255,255,255))
  213. end
  214. end
  215. other_annonce.DoClick = function()
  216. surface.PlaySound( "buttons/button15.wav" )
  217. Derma_StringRequest("", "Faite une annonce, en écrivant juste en dessous!","", function( text ) RunConsoleCommand( "say", "/broadcast " .. text ) end,
  218. function( text ) print( "x" ) end)
  219. end
  220.  
  221.  
  222. local name_server = vgui.Create("DLabel", bluebar)
  223. name_server:SetSize(300,30)
  224. name_server:SetPos(10,0)
  225. name_server:SetText("URANIUM COMMUNITY - MENU DU MAIRE")
  226. name_server:SetTextColor(Color(255,255,255))
  227. name_server:SetFont("DermaDefault")
  228. else
  229. ply:ChatPrint("Tu n'as pas le job requis pour accéder à ce menu!")
  230. end
  231. end
  232.  
  233. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement