Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include('shared.lua')
- surface.CreateFont( "HUDNumber5", {
- font = "HudNumbers",
- size = 13,
- weight = 500,
- } )
- function pubano ()
- local DermaFrame = vgui.Create( "DFrame" )
- DermaFrame:SetPos( ScrW()/2-150, ScrH()/2-150 )
- DermaFrame:SetSize( 375, 375 )
- DermaFrame:SetTitle( "NPC AYPUB" )
- DermaFrame:SetVisible( true )
- DermaFrame:MakePopup()
- DermaFrame:ShowCloseButton( false )
- local MainPanel = vgui.Create("DPanel", DermaFrame)
- MainPanel:SetSize(DermaFrame:GetWide(), DermaFrame:GetTall())
- MainPanel.Paint = function(self)
- draw.RoundedBox( 0, 0, 0, MainPanel:GetWide(), MainPanel:GetTall(), Color( 255, 255, 255, 250))
- end
- local CloseBtn = vgui.Create("DButton", DermaFrame)
- CloseBtn:SetSize(MainPanel:GetWide() / 8,MainPanel:GetTall() / 9)
- CloseBtn:AlignRight(0)
- CloseBtn:AlignTop(0)
- CloseBtn:SetText("")
- CloseBtn.Paint = function(self)
- draw.RoundedBox( 0, 0, 0, MainPanel:GetWide(), MainPanel:GetTall(), Color( 255, 0, 0, 225) )
- draw.SimpleText("X","Trebuchet24",MainPanel:GetWide() / 23,MainPanel:GetTall() / 45,Color(255,255,255,255),TEXT_ALIGN_LEFT)
- if CloseBtn:IsHovered() then
- draw.RoundedBox( 0, 0, 0, MainPanel:GetWide(), MainPanel:GetTall(), Color( 45, 0, 0, 225))
- draw.SimpleText("X","Trebuchet24",MainPanel:GetWide() / 23,MainPanel:GetTall() / 45,Color(255,255,255,255),TEXT_ALIGN_LEFT)
- end
- end
- CloseBtn.DoClick = function(self)
- DermaFrame:Close()
- end
- DButtonAdvert = vgui.Create("DButton",DermaFrame)
- DButtonAdvert:SetText("Advert")
- DButtonAdvert:SetParent( DermaFrame )
- DButtonAdvert:SetPos(100,100)
- DButtonAdvert:SetTextColor( Color( 255, 255, 255, 255 ) )
- DButtonAdvert:SetFont("Trebuchet24")
- DButtonAdvert:SetSize(175,75)
- DButtonAdvert.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 225 ) )
- end
- DButtonAdvert.DoClick = function()
- local FrameAdvert = vgui.Create( "DFrame" )
- FrameAdvert:SetSize( 400, 200 )
- FrameAdvert:SetTitle( "Advert" )
- FrameAdvert:Center()
- FrameAdvert:MakePopup()
- FrameAdvert.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 255 ) )
- end
- local TextEntryAdvert = vgui.Create( "DTextEntry", FrameAdvert )
- TextEntryAdvert:SetPos( 25, 50 )
- TextEntryAdvert:SetSize( 300, 25 )
- TextEntryAdvert:SetText("Taper votre Advert puis faite entrer")
- TextEntryAdvert.OnEnter = function( self )
- text = self:GetValue()
- net.Start( "npcayz" )
- net.WriteString( text )
- net.SendToServer()
- end
- DButtonpub = vgui.Create("DButton",DermaFrame)
- DButtonpub:SetText("100€")
- DButtonpub:SetParent( FrameAdvert )
- DButtonpub:SetPos(100,100)
- DButtonpub:SetTextColor( Color( 255, 255, 255, 255 ) )
- DButtonpub:SetFont("Trebuchet24")
- DButtonpub:SetSize(100,50)
- DButtonpub.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 234, 255, 0, 225 ) )
- end
- DButtonpub.DoClick = function()
- TextEntryAdvert:GetValue()
- end
- end
- DermaButtonAno = vgui.Create("DButton",DermaFrame)
- DermaButtonAno:SetText("Anonyme")
- DermaButtonAno:SetParent( DermaFrame )
- DermaButtonAno:SetPos(100,200)
- DermaButtonAno:SetTextColor( Color( 255, 255, 255, 255 ) )
- DermaButtonAno:SetFont("Trebuchet24")
- DermaButtonAno:SetSize(175,75)
- DermaButtonAno.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 225 ) )
- end
- DermaButtonAno.DoClick = function()
- local FrameAno = vgui.Create( "DFrame" )
- FrameAno:SetSize( 400, 200 )
- FrameAno:SetTitle( "Anonyme" )
- FrameAno:Center()
- FrameAno:MakePopup()
- FrameAno.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 255 ) )
- end
- local TextEntryAno = vgui.Create( "DTextEntry", FrameAno )
- TextEntryAno:SetPos( 25, 50 )
- TextEntryAno:SetSize( 300, 25 )
- TextEntryAno:SetText("Taper votre message Anonyme puis faite entrer")
- TextEntryAno.OnEnter = function( self )
- text = self:GetValue()
- net.Start( "npcayzano" )
- net.WriteString( text )
- net.SendToServer()
- end
- DermaFrame:Close()
- end
- end
- usermessage.Hook("pubano", pubano)
- hook.Add("PostDrawOpaqueRenderables", "pubano", function()
- for _, ent in pairs (ents.FindByClass("npc_pubano")) do
- if ent:GetPos():Distance(LocalPlayer():GetPos()) < 1000 then
- local Ang = ent:GetAngles()
- Ang:RotateAroundAxis( Ang:Forward(), 90)
- Ang:RotateAroundAxis( Ang:Right(), -90)
- cam.Start3D2D(ent:GetPos()+ent:GetUp()*79, Ang, 0.20)
- draw.SimpleTextOutlined( 'NPC AYPUB', "HUDNumber5", 0, 0, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
- cam.End3D2D()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement