S-Context Menu

  • Initiateur de la discussion fritziar
  • Date de début
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
Bonjour,
Hier je suis tombé sur des addons release par la communauté Springcity, Les Addons Release
je me suis donc interessé à l'addon S-contex menu :
20180829150828_1.jpg

je voulais savoir si il y avait moyen de le mètre en blur (le materiel blur) si oui comment :))

Merci d'avance pour vos réponses.
 
midou4141

midou4141

Geek
Messages
140
Score réaction
13
Points
65
fritziar à dit:
Bonjour,
Hier je suis tombé sur des addons release par la communauté Springcity, Les Addons Release
je me suis donc interessé à l'addon S-contex menu :Regarde la pièce jointe 9452
je voulais savoir si il y avait moyen de le mètre en blur (le materiel blur) si oui comment :))

Merci d'avance pour vos réponses.
Im faut changer les couleurs
 
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
midou4141 à dit:
Im faut changer les couleurs
Ducoup je devrais mettre quel couleur pour arriver au blur ?
 
midou4141

midou4141

Geek
Messages
140
Score réaction
13
Points
65
une autre personne peut s'en occuper je doit y'aller faire un truc :D
 
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
midou4141 à dit:
une autre personne peut s'en occuper je doit y'aller faire un truc :D
oke :/
 
slownls

slownls

Helpeur Divin
Messages
1 853
Score réaction
1 079
Points
465
@Slawer
 
M

Membre supprimé 70413

Anonyme
slownls à dit:
C'est mon addon mais release par le client, il n'y aura pas de support.
 
slownls

slownls

Helpeur Divin
Messages
1 853
Score réaction
1 079
Points
465
Slawer à dit:
C'est mon addon mais release par le client, il n'y aura pas de support.
Fait pas le gars, tu as juste la flemme ^^
 
  • J'aime
Réactions: NoaGamingFR et remi lemaire
midou4141

midou4141

Geek
Messages
140
Score réaction
13
Points
65
en vraie moi aussi j'ai la flemme :/
 
Aiiden

Aiiden

Geek suprême
Messages
63
Score réaction
34
Points
130
midou4141 à dit:
en vraie moi aussi j'ai la flemme :/
Tu sais même pas faire arrête de faire genre
 
midou4141

midou4141

Geek
Messages
140
Score réaction
13
Points
65
Aiiden à dit:
Tu sais même pas faire arrête de faire genre
ses pas trés compliquer de changer des couleur
 
Aiiden

Aiiden

Geek suprême
Messages
63
Score réaction
34
Points
130
midou4141 à dit:
ses pas trés compliquer de changer des couleur
Tu sais pas changer en blur
 
Valfunde

Valfunde

Helpeur Divin
Messages
3 800
Score réaction
1 235
Points
450
midou4141 à dit:
ses pas trés compliquer de changer des couleur
C'est pas une couleur mdr
 
  • J'aime
Réactions: NoaGamingFR, RedTroz et thepsyca
ally

ally

Geek suprême
Messages
337
Score réaction
64
Points
100
Je ne sais pas trop si c'est sa que tu cherches ou non?
https://gmod.facepunch.com/f/gmoddev/mtdf/I-need-help-making-a-blurred-derma-panel/1/
ou
https://forum.facepunch.com//f/gmoddev/lcev/HUD-Blur/1/
 
  • Banni
Hoper

Hoper

Geek suprême
Messages
510
Score réaction
233
Points
130
fritziar à dit:
Bonjour,
Hier je suis tombé sur des addons release par la communauté Springcity, Les Addons Release
je me suis donc interessé à l'addon S-contex menu :Regarde la pièce jointe 9452
je voulais savoir si il y avait moyen de le mètre en blur (le materiel blur) si oui comment :))

Merci d'avance pour vos réponses.
yep c'étais l'addons de notre serveur SpringCity avec l'ampoule.

Ducoup remplace tout le fichier s-context-menu\lua\autorun\client\cl_s_custom_context_menu.lua

par ça :


C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(self, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)
 
  • J'aime
Réactions: midou4141
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
Hoper à dit:
yep c'étais l'addons de notre serveur SpringCity avec l'ampoule.

Ducoup remplace tout le fichier s-context-menu\lua\autorun\client\cl_s_custom_context_menu.lua

par ça :


C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(self, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)

20180829173924_1.jpg


doesn't work :/
 
  • Banni
Hoper

Hoper

Geek suprême
Messages
510
Score réaction
233
Points
130
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
midou4141

midou4141

Geek
Messages
140
Score réaction
13
Points
65
RT
 
M

Membre supprimé 98332

Anonyme
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(s, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)
J'AI PAS TESTE MAIS CA DEVRAIT MARCHER
 
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
EpicGaby à dit:
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(s, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)
J'AI PAS TESTE MAIS CA DEVRAIT MARCHER
CA MARCHE MERCI
 
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
EpicGaby à dit:
dèrniere question si je vuex changer par exemple le bouton Site en blur je fais comment ?
20180829191221_1.jpg
 
M

Membre supprimé 98332

Anonyme
fritziar à dit:
dèrniere question si je vuex changer par exemple le bouton Site en blur je fais comment ? Regarde la pièce jointe 9459
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(s, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) DrawBlur(s, 10) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)
TIENS JE SAIS TOUJOURS PAS SI CA MARCHE CAR JE N'EST PAS LE TEMPS DE TESTER, NORMALEMENT IL NE DEVRAIT Y AVOIR AUCUN SOUCIS!
 
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
EpicGaby à dit:
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(s, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) DrawBlur(s, 10) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)
TIENS JE SAIS TOUJOURS PAS SI CA MARCHE CAR JE N'EST PAS LE TEMPS DE TESTER, NORMALEMENT IL NE DEVRAIT Y AVOIR AUCUN SOUCIS!
Ca marche po ://
 
  • J'aime
Réactions: Membre supprimé 98332
M

Membre supprimé 98332

Anonyme
fritziar à dit:
Ca marche po ://
C'est à dire ?

EDIT :

Ha, je viens de comprendre.
Joue avec les couleurs de ton bouton, et surtout avec sa transparence :
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156, 100)
local button_color_hover = Color(100, 100, 100, 100)
local headers_color = Color(100, 100, 100)
Les variables que tu dois modifier sont button_color et button_color_hover.
Modifie les derniers nombres des structures Color.
 
Dernière modification par un modérateur:
  • Initiateur de la discussion
fritziar

fritziar

Bambi
Messages
24
Score réaction
2
Points
30
EpicGaby à dit:
C'est à dire ?

EDIT :

Ha, je viens de comprendre.
Joue avec les couleurs de ton bouton, et surtout avec sa transparence :
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156, 100)
local button_color_hover = Color(100, 100, 100, 100)
local headers_color = Color(100, 100, 100)
Les variables que tu dois modifier sont button_color et button_color_hover.
Modifie les derniers nombres des structures Color.

Ok Merci Beaucoup its working
 
  • Banni
Hoper

Hoper

Geek suprême
Messages
510
Score réaction
233
Points
130
EpicGaby à dit:
C#:
local background_color = Color(66,66,66,200)
local separator_color = Color(30, 30, 30)
local button_color = Color(156, 156, 156)
local button_color_hover = Color(100, 100, 100)
local headers_color = Color(100, 100, 100)
local gunDealer = {"Vendeur d'Armes","Quincailler"}
local blur = Material("pp/blurscreen")
local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 3 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end
end
surface.CreateFont("SlawerContextFontButtons",{ size = ScrH() * 0.017 , font = "Roboto"})
surface.CreateFont("SlawerContextFontTitles",{ size = ScrH() * 0.028 , font = "Roboto"})
surface.CreateFont("SlawerContextFontServInfo",{ size = ScrH() * 0.02 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemTitle",{ size = ScrH() * 0.015 , font = "Roboto"})
surface.CreateFont("SlawerContextFontSItemPrice",{ size = ScrH() * 0.011 , font = "Roboto"})
local function validAction(text,func) frameActionValidBeforeStart = vgui.Create("DFrame") frameActionValidBeforeStart:SetSize(300,110) frameActionValidBeforeStart:Center() frameActionValidBeforeStart:MakePopup() frameActionValidBeforeStart:SetTitle("") frameActionValidBeforeStart:ShowCloseButton(false) frameActionValidBeforeStart.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) draw.SimpleText(text,"SlawerContextFontTitles",w/2,5,Color(255,255,255),TEXT_ALIGN_CENTER) end validFrameActionTextEntryToAmountOrText = vgui.Create("DTextEntry",frameActionValidBeforeStart) validFrameActionTextEntryToAmountOrText:SetSize(frameActionValidBeforeStart:GetWide() - 10,30) validFrameActionTextEntryToAmountOrText:SetPos(5,40) local accept = vgui.Create("DButton",frameActionValidBeforeStart) accept:SetPos(3,75) accept:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) accept:SetText("") accept.Paint = function(s,w,h) if accept:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("EFFECTUER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end accept.DoClick = func local deny = vgui.Create("DButton",frameActionValidBeforeStart) deny:SetPos(frameActionValidBeforeStart:GetWide() / 2 + 3,75) deny:SetSize(frameActionValidBeforeStart:GetWide() / 2 - 6,30) deny:SetText("") deny.Paint = function(s,w,h) if deny:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ANNULER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end deny.DoClick = func deny.DoClick = function() frameActionValidBeforeStart:Close() end
end
hook.Add("OnContextMenuOpen","SCustomContextMenuHookOpen",function() gui.EnableScreenClicker(true) sFrameContextMenu = vgui.Create("DFrame") sFrameContextMenu:ShowCloseButton(false) sFrameContextMenu:SetTitle("") sFrameContextMenu:SetSize(ScrW() * 0.27,ScrH()) sFrameContextMenu:SetPos(ScrW() - sFrameContextMenu:GetWide(),0) sFrameContextMenu.Paint = function(s,w,h) DrawBlur(s, 10) draw.RoundedBox(0,0,0,w,h,background_color) -- SEPARATEUR draw.RoundedBox(0,0,ScrH() * 0.15,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.25,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.47,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.622,w,ScrH() * 0.005,separator_color) draw.RoundedBox(0,0,ScrH() * 0.7,w,ScrH() * 0.005,separator_color) -- Titre Magasin draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.265,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("MAGASIN","SlawerContextFontTitles",w/2,ScrH() * 0.2815,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) -- Titre Serveur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.482,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("SERVEUR","SlawerContextFontTitles",w/2,ScrH() * 0.5,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.SimpleText("JOUEURS EN LIGNE : " .. #player.GetAll(),"SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local eco = 0 for k,v in pairs(player.GetAll()) do eco = eco + v:getDarkRPVar("money") end draw.SimpleText("ÉCONOMIE : " .. eco .. "$","SlawerContextFontServInfo",ScrW() * 0.005,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER) local police = 0 for k,v in pairs(player.GetAll()) do if v:isCP() then police = police + 1 end end draw.SimpleText("FORCES DE L'ORDRES : " .. police,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.54,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) local admin = 0 for k,v in pairs(player.GetAll()) do if v:IsAdmin() then admin = admin + 1 end end draw.SimpleText("STAFF EN LIGNE : " .. admin,"SlawerContextFontServInfo",ScrW() * 0.265,ScrH() * 0.565,Color(255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER) -- Titre Joueur draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.71,ScrW() * 0.26,ScrH() * 0.035,headers_color) draw.SimpleText("JOUEUR","SlawerContextFontTitles",w/2,ScrH() * 0.7275,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.75,ScrW() * 0.1,ScrH() * 0.27,headers_color) draw.SimpleText("NOM : " .. LocalPlayer():GetName(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.76,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("ARGENT : " .. LocalPlayer():getDarkRPVar("money") .. "$","SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.78,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("MÉTIER : " .. LocalPlayer():getDarkRPVar("job"),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.80,Color(255,255,255),TEXT_ALIGN_LEFT) local time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) local timeSuit = "m" if time >= 60 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 ) timeSuit = "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 ) .. "m" if time >= 24 then time = math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60 / 24 ) timeSuit = "j " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60 / 60) .. "h " .. math.Round( (CurTime() - LocalPlayer():GetNWInt("SConnectTimeContextMenu")) / 60) .. "m" end end draw.SimpleText("TEMPS DE JEU : " .. time .. timeSuit,"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.82,Color(255,255,255),TEXT_ALIGN_LEFT) draw.SimpleText("RANG : " .. LocalPlayer():GetUserGroup(),"SlawerContextFontServInfo",ScrW() * 0.11,ScrH() * 0.84,Color(255,255,255),TEXT_ALIGN_LEFT) end local imageLogoCLickable = vgui.Create( "DImageButton", sFrameContextMenu ) imageLogoCLickable:SetPos( ScrW() * 0.080, ScrH() * -0.014 ) imageLogoCLickable:SetSize( ScrW() * 0.11, ScrH() * 0.18 ) imageLogoCLickable:SetImage( "materials/spring-city-logo-context-menu.png" ) imageLogoCLickable.DoClick = function() gui.OpenURL("http://springcity.fr") end local function actionButton(px,py,sx,sy,text,font,action) local actionButtonButton = vgui.Create("DButton",sFrameContextMenu) actionButtonButton:SetPos(px,py) actionButtonButton:SetSize(sx,sy) actionButtonButton:SetText("") actionButtonButton.Paint = function(s,w,h) if actionButtonButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,button_color_hover) else draw.RoundedBox(0,0,0,w,h,button_color) end draw.SimpleText(text,font,w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end actionButtonButton.DoClick = action end actionButton(ScrW() * 0.005,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARMES","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /dropweapon") end) actionButton(ScrW() * 0.095,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"JETER ARGENT","SlawerContextFontButtons",function() validAction("Jeter de l'argent",function() LocalPlayer():ConCommand("say /dropmoney " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.185,ScrH() * 0.17,ScrW() * 0.08,ScrH() * 0.03,"DONNER ARGENT","SlawerContextFontButtons",function() validAction("Donner de l'argent",function() LocalPlayer():ConCommand("say /give " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.005,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"ECRIRE UNE LETTRE","SlawerContextFontButtons",function() validAction("Ecrire une lettre",function() LocalPlayer():ConCommand("say /write " .. validFrameActionTextEntryToAmountOrText:GetText()) frameActionValidBeforeStart:Close() end) end) actionButton(ScrW() * 0.095,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"APPELER UN TAXI","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say /taxi") end) actionButton(ScrW() * 0.185,ScrH() * 0.205,ScrW() * 0.08,ScrH() * 0.03,"OUVRIR LA BOUTIQUE","SlawerContextFontButtons",function() LocalPlayer():ConCommand("say !boutique") end) actionButton(ScrW() * 0.005,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"SITE","SlawerContextFontButtons",function() gui.OpenURL("http://springcity.fr") end) actionButton(ScrW() * 0.095,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"WORKSHOP","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=881738171") end) actionButton(ScrW() * 0.185,ScrH() * 0.585,ScrW() * 0.08,ScrH() * 0.03,"GROUPE STEAM","SlawerContextFontButtons",function() gui.OpenURL("http://steamcommunity.com/groups/springcity") end) actionButton(ScrW() * 0.005,ScrH() * 0.635,ScrW() * 0.26,ScrH() * 0.06,"MAGASIN D'ARMES","SlawerContextFontTitles",function() if !(table.HasValue(gunDealer,team.GetName(LocalPlayer():Team()))) then chat.AddText(Color(255,0,0),"Vous n'avez pas le bon métier") return end local weapon = vgui.Create("DPanel",sFrameContextMenu) weapon:SetSize(sFrameContextMenu:GetWide(),sFrameContextMenu:GetTall()) weapon:SetPos(0,ScrH() * 0.155) weapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,background_color) -- Magasin d'armes draw.RoundedBox(0,ScrW() * 0.005,ScrH() * 0.01,ScrW() * 0.26,ScrH() * 0.035,button_color) draw.SimpleText("MAGASIN D'ARMES","SlawerContextFontTitles",w/2,ScrH() * 0.026,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end local categoryWeaponsList = vgui.Create( "DPanelList", weapon ) categoryWeaponsList:SetPos( ScrW() * 0.005,ScrH() * 0.05 ) categoryWeaponsList:SetSize( weapon:GetWide() - ScrW() * 0.01, weapon:GetTall() - ScrH() * 0.212 ) categoryWeaponsList:SetSpacing( 3 ) categoryWeaponsList:EnableHorizontal( false ) categoryWeaponsList:EnableVerticalScrollbar( true ) categoryWeaponsList.Paint = function(s,w,h) --draw.RoundedBox(0,0,0,w,h,Color(0,0,0)) end local sbar = categoryWeaponsList.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k,v in pairs(DarkRP.getCategories().weapons) do local cateItemNumber = 0 local header = vgui.Create("DPanel",categoryWeaponsList) header:SetSize(categoryWeaponsList:GetWide(),ScrH() * 0.04) header.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(100,100,100)) draw.SimpleText(v.name,"SlawerContextFontTitles",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end categoryWeaponsList:AddItem(header) local categoryWeapon = vgui.Create( "DPanelList", categoryWeaponsList ) categoryWeapon:SetSize( 50, ScrH() * 0.32 ) categoryWeapon:SetPos( 0, ScrH() * 0 ) categoryWeapon:SetSpacing( 3 ) categoryWeapon:EnableHorizontal( false ) categoryWeapon:EnableVerticalScrollbar( true ) categoryWeapon.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0,0)) end local sbar = categoryWeapon.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for _,e in pairs(CustomShipments) do if v.name == e.category then local ShowThisItem = true if istable(e.allowed) and not table.HasValue( e.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then cateItemNumber = cateItemNumber + 1 local panel = vgui.Create("DPanel",categoryWeapon) panel:SetSize(0,ScrH() * 0.06) panel:SetText(e.name) panel.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.SimpleText(e.name,"SlawerContextFontTitles",ScrW() * 0.038,ScrH() * 0.001,Color(255,255,255)) draw.SimpleText("Prix: " .. e.price .. "€","SlawerContextFontServInfo",ScrW() * 0.038,ScrH() * 0.03,Color(255,255,255)) end local icon = vgui.Create("SpawnIcon",panel) icon:SetPos(ScrW() * 0.001,ScrW() * 0.001) icon:SetSize(ScrW() * 0.0325,ScrW() * 0.0325) icon:SetModel(e.model) local buyButton = vgui.Create("DButton",panel) buyButton:SetPos(ScrW() * 0.18,ScrH() * 0.03) buyButton:SetSize(ScrW() * 0.06,ScrH() * 0.025) buyButton:SetText("") buyButton.Paint = function(s,w,h) if buyButton:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end draw.SimpleText("ACHETER","SlawerContextFontSItemTitle",w/2,h/2,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end buyButton.DoClick = function() if not e.noship then LocalPlayer():ConCommand("darkrp buyshipment " .. e.name) else LocalPlayer():ConCommand("darkrp buy " .. e.name) end end categoryWeapon:AddItem(panel) end end end categoryWeaponsList:AddItem(categoryWeapon) if cateItemNumber == 0 then header:Remove() categoryWeapon:Remove() end end end) local MagasinMenu = vgui.Create( "DPanelList", sFrameContextMenu ) MagasinMenu:SetPos( ScrW() * 0.005,ScrH() * 0.305 ) MagasinMenu:SetSize( ScrW() * 0.26,ScrH() * 0.16 ) MagasinMenu:SetSpacing( 1 ) MagasinMenu:EnableHorizontal( true ) MagasinMenu:EnableVerticalScrollbar( true ) --MagasinMenu.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(255,0,0)) end local sbar = MagasinMenu.VBar function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 73, 73, 73 ) ) end for k, v in pairs(DarkRPEntities) do local ShowThisItem = true if istable(v.allowed) and not table.HasValue( v.allowed, LocalPlayer():Team() ) then ShowThisItem = false end if ShowThisItem then local test = vgui.Create("DPanel",MagasinMenu) test:SetSize(MagasinMenu:GetWide() / 2 - 2,ScrH() * 0.06) test.Paint = function(s,w,h) draw.RoundedBox(0,0,0,w,h,Color(80, 80, 80)) draw.RoundedBox(0,0,0,ScrW() * 0.033,ScrW() * 0.033,Color(70, 70, 70)) draw.SimpleText(string.upper(v.name),"SlawerContextFontSItemTitle",ScrW() * 0.038,ScrH() * 0.002,Color(255,255,255)) draw.SimpleText("Prix: " .. v.price .. "$","SlawerContextFontSItemPrice",ScrW() * 0.038,ScrH() * 0.018,Color(255,255,255)) end local model = vgui.Create("SpawnIcon",test) model:SetSize(ScrW() * 0.033,ScrW() * 0.033) model:SetModel(v.model) local buy = vgui.Create("DButton",test) buy:SetSize(ScrW() * 0.06,ScrH()* 0.02) buy:SetPos(ScrW() * 0.038,ScrH()*0.035) buy:SetText("Acheter") buy:SetTextColor(Color(255,255,255)) buy.Paint = function(s,w,h) if buy:IsHovered() then draw.RoundedBox(0,0,0,w,h,Color(100, 100, 100)) else draw.RoundedBox(0,0,0,w,h,Color(156, 156, 156)) end end buy.DoClick = function() LocalPlayer():ConCommand("darkrp " .. v.cmd) end MagasinMenu:AddItem(test) end end local icon = vgui.Create( "DModelPanel", sFrameContextMenu ) icon:SetPos(ScrW() * 0.005,ScrH() * 0.75) icon:SetSize( ScrW() * 0.1,ScrH() * 0.24 ) icon:SetModel( LocalPlayer():GetModel() ) icon:SetFOV(15,0) icon:SetCamPos( Vector( 210,-30, 60 ) ) function icon:LayoutEntity( ent ) return end return ""
end)
hook.Add("OnContextMenuClose","SCustomContextMenuHookClose",function() gui.EnableScreenClicker(false) if IsValid(sFrameContextMenu) then sFrameContextMenu:Close() end
end)
J'AI PAS TESTE MAIS CA DEVRAIT MARCHER

bah cest le même code que le miens nan
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
  • J'aime
Réactions: Membre supprimé 98332
M

Membre supprimé 98332

Anonyme
Hoper à dit:
bah cest le même code que le miens nan
Dans ton code, le mot-clé "self" n'était pas défini, l'objet est passé en argument à la fonction sous la variable "s".
 
  • Banni
Hoper

Hoper

Geek suprême
Messages
510
Score réaction
233
Points
130
EpicGaby à dit:
Dans ton code, le mot-clé "self" n'était pas défini, l'objet est passé en argument à la fonction sous la variable "s".
ah ok un truc un bête
 
sachadlc

sachadlc

Nouveau né
Messages
17
Score réaction
1
Points
20
Salut comment on change Le metiers pour ouvrire le vendeur d arme ?
 
F

feed

Geek
Messages
14
Score réaction
0
Points
75
Salut !
Dans mon s-context-menu j'aimerais pouvoir faire un clique droit sur les items quand on l'ouvre,
j'ai vue que tu pouvais le faire sur certain serv, la modif est un code ?
ou autre ?
Quelqu’un a une solution ?! ;
merci à tous
 
Mattsei

Mattsei

Nouveau né
Messages
1
Score réaction
0
Points
20
Bonjour;
Est-ce que quelqu'un aurait encore l'addon "S-Context menu" à me passer car j'ai cherché partout mais je n'ai pas trouvé où le télécharger ?
 
noah_ballas

noah_ballas

GMod4Life
Messages
114
Score réaction
24
Points
125
Pareil pour moi si des personne aurais la référence svp
 
Love Gmod

Love Gmod

Geek suprême
Messages
164
Score réaction
16
Points
115
Évitez de UP des vieux topics, si vous cliquez sur le lien vous verrez par vous même que l'addon à été supprimé et l'auteur de la redistribution a été banni
 
Discord d'entraide
Rejoignz-nous sur Discord