Bug NPC

  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
[ERROR] lua/includes/modules/usermessage.lua:87: attempt to call field 'Function' (a nil value)
1. unknown - lua/includes/modules/usermessage.lua:87


Code:
include('shared.lua')
if CLIENT then
local function HealNPCM()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end
usermessage.Hook("fermier",HealNPCM)
surface.CreateFont( "Large", { font = "Trebuchet24", size = 30, weight = 300, antialias = true,
} )
SNPC = SNPC or {}
function SNPC.DrawText() for _, ent in pairs (ents.FindByClass("vendeurdivers")) do if ent:GetPos():Distance(LocalPlayer():GetPos()) < 500 then local Ang = LocalPlayer():GetAngles() Ang:RotateAroundAxis( Ang:Forward(), 90) Ang:RotateAroundAxis( Ang:Right(), -90) Ang:RotateAroundAxis( Ang:Right(), -180) cam.Start3D2D(ent:GetPos()+ent:GetUp()*80, Ang, 0.20) draw.SimpleTextOutlined( "Vendeur d'objets", "Large", 0, 0, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255)) cam.End3D2D() end
end
hook.Add("PostDrawOpaqueRenderables", "NPC_TEXT", SNPC.DrawText)
end
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
Bonsoir,
Pouvons avoir plus d'information(s) ?
Comme par exemple, si ton erreur s'affiche lorsque tu te connecte au serveur ou alors lorsque tu tente d'accéder au PNJ ?
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Mistico à dit:
Bonsoir,
Pouvons avoir plus d'information(s) ?
Comme par exemple, si ton erreur s'affiche lorsque tu te connecte au serveur ou alors lorsque tu tente d'accéder au PNJ ?
Quand je fait e sur mon npc
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
Quelle est le nom de l'addon que tu utilise ?
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Mistico à dit:
Quelle est le nom de l'addon que tu utilise ?
mais c'est un addon presque codé tout par moi alors le nom de laddon c'est vendeurdivers
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
Regarde si cela fonctionne :
Code:
include('shared.lua')
if CLIENT then
local function HealNPCM()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end
usermessage.Hook("fermier",HealNPCM)
surface.CreateFont( "Large", { font = "Trebuchet24", size = 30, weight = 300, antialias = true,
} )
SNPC = SNPC or {}
function SNPC.DrawText() for _, ent in pairs (ents.FindByClass("vendeurdivers")) do if ent:GetPos():Distance(LocalPlayer():GetPos()) < 500 then local Ang = LocalPlayer():GetAngles() Ang:RotateAroundAxis( Ang:Forward(), 90) Ang:RotateAroundAxis( Ang:Right(), -90) Ang:RotateAroundAxis( Ang:Right(), -180) cam.Start3D2D(ent:GetPos()+ent:GetUp()*80, Ang, 0.20) draw.SimpleTextOutlined( "Vendeur d'objets", "Large", 0, 0, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255)) cam.End3D2D() end
end
hook.Add("PostDrawOpaqueRenderables", "NPC_TEXT", SNPC.DrawText)
end
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Mistico à dit:
Regarde si cela fonctionne :
Code:
include('shared.lua')
if CLIENT then
local function HealNPCM()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end
usermessage.Hook("fermier",HealNPCM)
surface.CreateFont( "Large", { font = "Trebuchet24", size = 30, weight = 300, antialias = true,
} )
SNPC = SNPC or {}
function SNPC.DrawText() for _, ent in pairs (ents.FindByClass("vendeurdivers")) do if ent:GetPos():Distance(LocalPlayer():GetPos()) < 500 then local Ang = LocalPlayer():GetAngles() Ang:RotateAroundAxis( Ang:Forward(), 90) Ang:RotateAroundAxis( Ang:Right(), -90) Ang:RotateAroundAxis( Ang:Right(), -180) cam.Start3D2D(ent:GetPos()+ent:GetUp()*80, Ang, 0.20) draw.SimpleTextOutlined( "Vendeur d'objets", "Large", 0, 0, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255)) cam.End3D2D() end
end
hook.Add("PostDrawOpaqueRenderables", "NPC_TEXT", SNPC.DrawText)
end
ta changé quoi%
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
J'ai modifier le DermaButton2.Paint
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Mistico à dit:
Regarde si cela fonctionne :
Code:
include('shared.lua')
if CLIENT then
local function HealNPCM()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end
usermessage.Hook("fermier",HealNPCM)
surface.CreateFont( "Large", { font = "Trebuchet24", size = 30, weight = 300, antialias = true,
} )
SNPC = SNPC or {}
function SNPC.DrawText() for _, ent in pairs (ents.FindByClass("vendeurdivers")) do if ent:GetPos():Distance(LocalPlayer():GetPos()) < 500 then local Ang = LocalPlayer():GetAngles() Ang:RotateAroundAxis( Ang:Forward(), 90) Ang:RotateAroundAxis( Ang:Right(), -90) Ang:RotateAroundAxis( Ang:Right(), -180) cam.Start3D2D(ent:GetPos()+ent:GetUp()*80, Ang, 0.20) draw.SimpleTextOutlined( "Vendeur d'objets", "Large", 0, 0, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255)) cam.End3D2D() end
end
hook.Add("PostDrawOpaqueRenderables", "NPC_TEXT", SNPC.DrawText)
end
non sa marche pas
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
att je vais reboot....
Passe par http://wiki.garrysmod.com/page/Category:net je t'en ai déjà parler sur ton précédent topic ...
au lieu de usermessage
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
thepsyca à dit:
Passe par http://wiki.garrysmod.com/page/Category:net je t'en ai déjà parler sur ton précédent topic ...
au lieu de usermessage
bah jutulise deja sa ...
juste je sais pas comment lutuliser pour l'ouvrir
si quelqun serait fixer le code
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
Je me douter que ce n'aller pas fonctionner, car j'ai remit la même chose .
Si je peut t'aider : Ton script n'arrive pas à déterminer le (btn) de ta fonction.
Donc si c'est vraiment toi qui as créer le script, tu devrais savoir comment faire ;)
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
Esce-que je pourrais avoir d'autre fichier ?
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Mistico à dit:
Je me douter que ce n'aller pas fonctionner, car j'ai remit la même chose .
Si je peut t'aider : Ton script n'arrive pas à déterminer le (btn) de ta fonction.
Donc si c'est vraiment toi qui as créer le script, tu devrais savoir comment faire ;)
c'est pas sa qui fait lerreur cest le usrmessage.
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
bah jutulise deja sa ...
juste je sais pas comment lutuliser pour l'ouvrir
si quelqun serait fixer le code
Code:
local function HealNPCM()
supprime le local et non tu utilise usermessage donc passe en net
Code:
usermessage.Hook("fermier",HealNPCM)
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
thepsyca à dit:
Code:
local function HealNPCM()
supprime le local et non tu utilise usermessage donc passe en net
Code:
usermessage.Hook("fermier",HealNPCM)
je sais pas comment je vien de debuter sa ya 2 jours la
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
je sais pas comment je vien de debuter sa ya 2 jours la
Code:
net.Receive( "HealNPCM", function()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end)
Côté use :

util.AddNetworkString("HealNPCM")
net.Start( "HealNPCM" )
net.Send( caller)
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
thepsyca à dit:
Code:
net.Receive( "HealNPCM", function()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end)
Côté use :

util.AddNetworkString("HealNPCM")
net.Start( "HealNPCM" )
net.Send( caller)
merci pour ce code wow il a broke mon addon...
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
ERROR] addons/pecheur/lua/entities/vendeurdivers/cl_init.lua:213: ')' expected (to close '(' at line 1) near 'DermaImageButton'
1. unknown - addons/pecheur/lua/entities/vendeurdivers/cl_init.lua:0
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
thepsyca à dit:
Code:
net.Receive( "HealNPCM", function()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end)
Côté use :

util.AddNetworkString("HealNPCM")
net.Start( "HealNPCM" )
net.Send( caller)
[ERROR] addons/pecheur/lua/entities/vendeurdivers/init.lua:27: Tried to use a NULentity!
1. Send - [C]:-1
2. unknown - addons/pecheur/lua/entities/vendeurdivers/init.lua:27
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
ERROR] addons/pecheur/lua/entities/vendeurdivers/cl_init.lua:213: ')' expected (to close '(' at line 1) near 'DermaImageButton'
1. unknown - addons/pecheur/lua/entities/vendeurdivers/cl_init.lua:0
Code:
net.Receive( "HealNPCM", function()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
DermaImageButton2 = vgui.Create( "DImage", frame )
DermaImageButton2:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton2:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton2:SizeToContents() -- OPTIONAL: Use instead of SetSize if you want to resize automatically ( without stretching )
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255)) Button2:SetIcon("icon16/star.png") end -- Set the size
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaImageButton = vgui.Create( "DImage", frame2 )
DermaImageButton:SetPos( 180-48, 4 ) -- Set position
--DermaImageButton:SetSize( 16, 16 ) // OPTIONAL: Use instead of SizeToContents() if you know/want to fix the size
DermaImageButton:SetImage( "icon16/script.png" ) -- Set the material - relative to /materials/ directory
DermaImageButton:SizeToContents()
end)
et utilise
http://wiki.garrysmod.com/page/surface/PlaySound
au lieu de emitsound
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
[ERROR] addons/pecheur/lua/entities/vendeurdivers/init.lua:27: Tried to use a NULentity!
1. Send - [C]:-1
2. unknown - addons/pecheur/lua/entities/vendeurdivers/init.lua:27
envoie ton init.lua
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Code:
AddCSLuaFile('cl_init.lua')
AddCSLuaFile('shared.lua')
include('shared.lua')
function ENT:Initialize( ) self:SetModel( "models/Humans/Group03m/male_07.mdl" ) self:SetHullType( HULL_HUMAN ) self:SetHullSizeNormal( ) self:SetNPCState( NPC_STATE_SCRIPT ) self:SetSolid( SOLID_BBOX ) bit.bor( CAP_ANIMATEDFACE , CAP_TURN_HEAD) self:SetUseType( SIMPLE_USE ) self:DropToFloor() self:SetMaxYawSpeed( 90 )
end
function ENT:AcceptInput( Name, Activator, Caller ) if Name == "Use" and Caller:IsPlayer() then util.AddNetworkString("HealNPCM")
net.Start( "HealNPCM" )
net.Send( caller) end
end
if SERVER then util.AddNetworkString("fermier.hache") net.Receive("fermier.hache", function(bits, ply) if ply:getDarkRPVar("money") < 200 then ply:AddText("[Shop] Vous avez pas assez d'argent") elseif ply:getDarkRPVar("money") > 200 then ply:Give("axe") ply:addMoney(-200) end end) util.AddNetworkString("pelle") net.Receive("pelle", function(bits, ply) if ply:getDarkRPVar("money") < 200 then elseif (ply:getDarkRPVar("money") > 200) then ply:Give("shovel") ply:addMoney(-200) end end) util.AddNetworkString("poisson") net.Receive("poisson", function(bits, ply) if ply:getDarkRPVar("money") < 300 then elseif (ply:getDarkRPVar("money") > 300) then ply:Give("fishing_rod") ply:addMoney(-300) end end) util.AddNetworkString("lockpick") net.Receive("lockpick", function(bits, ply) if ply:getDarkRPVar("money") < 500 then elseif (ply:getDarkRPVar("money") > 500) then ply:Give("lockpick") ply:addMoney(-500) end end) util.AddNetworkString("mineur") net.Receive("mineur", function(bits, ply) if ply:getDarkRPVar("money") < 200 then elseif (ply:getDarkRPVar("money") > 200) then ply:Give("pickaxe") ply:addMoney(-200) end end) util.AddNetworkString("armor") net.Receive("armor", function(bits, ply) if ply:getDarkRPVar("money") < 300 then elseif (ply:getDarkRPVar("money") > 300) then ply:SetArmor(100) ply:addMoney(-300) elseif (ply:Armor() < 100) then end end)
end
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
Code:
AddCSLuaFile('cl_init.lua')
AddCSLuaFile('shared.lua')
include('shared.lua')
util.AddNetworkString("HealNPCM")
function ENT:Initialize( ) self:SetModel( "models/Humans/Group03m/male_07.mdl" ) self:SetHullType( HULL_HUMAN ) self:SetHullSizeNormal( ) self:SetNPCState( NPC_STATE_SCRIPT ) self:SetSolid( SOLID_BBOX ) bit.bor( CAP_ANIMATEDFACE , CAP_TURN_HEAD) self:SetUseType( SIMPLE_USE ) self:DropToFloor() self:SetMaxYawSpeed( 90 )
end
function ENT:AcceptInput( Name, Activator, Caller ) if Name == "Use" and Caller:IsPlayer() then
net.Start( "HealNPCM" )
net.Send( Caller) end
end
if SERVER then util.AddNetworkString("fermier.hache") net.Receive("fermier.hache", function(bits, ply) if ply:getDarkRPVar("money") < 200 then ply:AddText("[Shop] Vous avez pas assez d'argent") elseif ply:getDarkRPVar("money") > 200 then ply:Give("axe") ply:addMoney(-200) end end) util.AddNetworkString("pelle") net.Receive("pelle", function(bits, ply) if ply:getDarkRPVar("money") < 200 then elseif (ply:getDarkRPVar("money") > 200) then ply:Give("shovel") ply:addMoney(-200) end end) util.AddNetworkString("poisson") net.Receive("poisson", function(bits, ply) if ply:getDarkRPVar("money") < 300 then elseif (ply:getDarkRPVar("money") > 300) then ply:Give("fishing_rod") ply:addMoney(-300) end end) util.AddNetworkString("lockpick") net.Receive("lockpick", function(bits, ply) if ply:getDarkRPVar("money") < 500 then elseif (ply:getDarkRPVar("money") > 500) then ply:Give("lockpick") ply:addMoney(-500) end end) util.AddNetworkString("mineur") net.Receive("mineur", function(bits, ply) if ply:getDarkRPVar("money") < 200 then elseif (ply:getDarkRPVar("money") > 200) then ply:Give("pickaxe") ply:addMoney(-200) end end) util.AddNetworkString("armor") net.Receive("armor", function(bits, ply) if ply:getDarkRPVar("money") < 300 then elseif (ply:getDarkRPVar("money") > 300) then ply:SetArmor(100) ply:addMoney(-300) elseif (ply:Armor() < 100) then end end)
end
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
ta rien ecrit tu sais
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
ta rien ecrit tu sais
non j'ai changé de place, et tu sais que si ton joueur a exemple 200 d'argents il ne peut pas acheter ?
 
Mistico

Mistico

Geek
Messages
44
Score réaction
2
Points
95
  • J'aime
Réactions: PierreB
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
thepsyca à dit:
non j'ai changé de place, et tu sais que si ton joueur a exemple 200 d'argents il ne peut pas acheter ?
tu veux dire quoi par la
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
le code est bien fait
net.Receive("fermier.hache", function(bits, ply)
if ply:getDarkRPVar("money") < 200 then
ply:AddText("[Shop] Vous avez pas assez d'argent")
elseif ply:getDarkRPVar("money") > 200 then
ply:Give("axe")
ply:addMoney(-200)
end
end) ...
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
==

Est égal à

>

Est supérieur à

<

Est inférieur à

>=

Est supérieur ou égal à

<=

Est inférieur ou égal à

!=

Est différent de
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
le code est bien fait
net.Receive("fermier.hache", function(bits, ply)
if ply:getDarkRPVar("money") < 200 then
ply:AddText("[Shop] Vous avez pas assez d'argent")
elseif ply:getDarkRPVar("money") > 200 then
ply:Give("axe")
ply:addMoney(-200)
end
end) ...
traduction de ton code :

Si joueur a moins de 200 = pas achat
Si joueur a 200 = pas achat
Si joueur a plus de 200 = achat
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
thepsyca à dit:
==

Est égal à

>

Est supérieur à

<

Est inférieur à

>=

Est supérieur ou égal à

<=

Est inférieur ou égal à

!=

Est différent de
est-ce que tu pourrais le fixer et lenvoyer
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
est-ce que tu pourrais le fixer et lenvoyer
Code:
net.Receive("fermier.hache", function(bits, ply)
if ply:getDarkRPVar("money") < 200 then
ply:AddText("[Shop] Vous avez pas assez d'argent")
elseif ply:getDarkRPVar("money") >= 200 then
ply:Give("axe")
ply:addMoney(-200)
end
end)
 
PierreB

PierreB

Geek suprême
Messages
342
Score réaction
64
Points
130
Dynastix à dit:
ERROR] addons/pecheur/lua/entities/vendeurdivers/cl_init.lua:213: ')' expected (to close '(' at line 1) near 'DermaImageButton'
1. unknown - addons/pecheur/lua/entities/vendeurdivers/cl_init.lua:0
Il a rien broke du tout ca se répare en deux secondes ca sérieusement meme un configurateur saurait le faire..
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
PierreB à dit:
Il a rien broke du tout ca se répare en deux secondes ca sérieusement meme un configurateur saurait le faire..
Je sais ...
 
  • Initiateur de la discussion
Dynastix

Dynastix

Geek
Messages
103
Score réaction
2
Points
55
Code:
-- Put your Lua here
net.Receive( "HealNPCM", function()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255))
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
ca me donne un erreur
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Dynastix à dit:
Code:
-- Put your Lua here
net.Receive( "HealNPCM", function()
local pmoney = LocalPlayer():getDarkRPVar("money")
local frame = vgui.Create( "DFrame" )
frame:AlphaTo(255, 4, 1)
frame:SetSize( 300, 320 )
frame:SetBackgroundBlur(50)
frame:Center()
frame:MakePopup()
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetTitle("Vendeur d'objets - Page 1")
local Close = vgui.Create("DButton", frame) Close:SetSize(40, 15) Close:SetPos(300-48, 8) Close:SetText("X") Close:SetTooltip("Fermer") Close:SetTextColor(Color(0,0,0,255)) Close.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close.DoClick = function() frame:Close() end Close.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close.OnCursorExited = function(self) self.hover = false end
local lbl3 = vgui.Create( "DLabel", frame )
lbl3:SetPos( 80, 200 )
lbl3:SetSize( 200, 200 )
lbl3:SetText( "Vous avez : €" .. pmoney )
lbl3:SetFont( "Trebuchet24" )
lbl3:SetWrap( true )
lbl3:SetParent(frame)
frame.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local DermaButton = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton:SetText( "Acheter une hache 200€" ) -- Set the text on the button
DermaButton:SetPos( 25, 50 ) -- Set the position on the frame
DermaButton:SetSize( 250, 30 )
DermaButton.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton:GetWide(), DermaButton:GetTall() ) DermaButton:SetTextColor(Color(255,255,255)) DermaButton:SetIcon("icon16/star.png") end -- Set the size
DermaButton.DoClick = function() net.Start("fermier.hache") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
local DermaButton2 = vgui.Create( "DButton", frame )
DermaButton2:SetText( "Acheter une pelle 200€" ) -- Set the text on the button
DermaButton2:SetPos( 25, 100 ) -- Set the position on the frame
DermaButton2:SetSize( 250, 30 ) -- Set the size
DermaButton2.DoClick = function() net.Start("pelle") net.SendToServer()
end
DermaButton2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton2:GetWide(), DermaButton2:GetTall() ) DermaButton2:SetTextColor(Color(255,255,255)) DermaButton2:SetIcon("icon16/star.png") end
local DermaButton3 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton3:SetText( "Acheter une canne a peche 200€" ) -- Set the text on the button
DermaButton3:SetPos( 25, 150 ) -- Set the position on the frame
DermaButton3:SetSize( 250, 30 ) -- Set the size
DermaButton3.DoClick = function()
LocalPlayer():EmitSound("buttons/button24.wav") net.Start("poisson") net.SendToServer()
end
DermaButton3.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton3:GetWide(), DermaButton3:GetTall() ) DermaButton3:SetTextColor(Color(255,255,255)) DermaButton3:SetImage("icon16/star.png") end
local DermaButton4 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton4:SetText( "Acheter une pioche 200€" ) -- Set the text on the button
DermaButton4:SetPos( 25, 200 ) -- Set the position on the frame
DermaButton4:SetSize( 250, 30 ) -- Set the size
DermaButton4.DoClick = function() net.Start("mineur") net.SendToServer() LocalPlayer():EmitSound("buttons/button24.wav")
end
DermaButton4.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, DermaButton4:GetWide(), DermaButton4:GetTall() ) DermaButton4:SetTextColor(Color(255,255,255)) DermaButton4:SetIcon("icon16/star.png") end
local DermaButton5 = vgui.Create( "DButton", frame ) -- Create the button and parent it to the frame
DermaButton5:SetText( "Page suivante" ) -- Set the text on the button
DermaButton5:SetPos( 70, 250 ) -- Set the position on the frame
DermaButton5:SetSize( 150, 30 ) -- Set the size
DermaButton5.DoClick = function() frame:Close()
local frame2 = vgui.Create( "DFrame" )
frame2:SetSize( 300, 290 )
frame2:Center()
frame2:MakePopup()
frame2:SetDraggable(false)
frame2:ShowCloseButton(false)
local Close2 = vgui.Create("DButton", frame2) Close2:SetSize(40, 15) Close2:SetPos(300-48, 8) Close2:SetText("X") Close2:SetTooltip("Fermer") Close2:SetTextColor(Color(0,0,0,255)) Close2.Paint = function(self,w,h) draw.RoundedBox(3, 0, 0, w, h, Color(230, 92, 78) ) end Close2.DoClick = function() frame2:Close() end Close2.OnCursorEntered = function(self) surface.PlaySound("UI/buttonrollover.wav") self.hover = true end Close2.OnCursorExited = function(self) self.hover = false end end
local lbl = vgui.Create( "DLabel", frame2 )
lbl:SetPos( 80, 170 )
lbl:SetSize( 200, 200 )
lbl:SetText( "Vous avez : €" .. pmoney )
lbl:SetFont( "Trebuchet24" )
lbl:SetWrap( true )
lbl:SetParent(frame2)
frame2:SetTitle("Vendeur d'objets - Page 2")
frame2.Paint = function( self, w, h ) Derma_DrawBackgroundBlur(self,3,3) draw.RoundedBox( 5, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local Button1 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button1:SetText( "Acheter un lockpick 500€" ) -- Set the text on the button
Button1:SetPos( 25, 50 ) -- Set the position on the frame
Button1:SetSize( 250, 30 ) -- Set the size
Button1.DoClick = function() LocalPlayer():EmitSound("buttons/button24.wav") net.Start("lockpick") net.SendToServer()
end
Button1.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button1:GetWide(), Button1:GetTall() ) Button1:SetTextColor(Color(255,255,255))
Button1:SetIcon("icon16/star.png") end
local Button2 = vgui.Create( "DButton", frame2 ) -- Create the button and parent it to the frame
Button2:SetText( "Acheter de l'armure" ) -- Set the text on the button
Button2:SetPos( 25, 100 ) -- Set the position on the frame
Button2:SetSize( 250, 30 )
Button2.Paint = function (btn) surface.SetDrawColor( 44, 62, 80 ) surface.DrawRect( 0, 0, Button2:GetWide(), Button2:GetTall() ) Button2:SetTextColor(Color(255,255,255))
Button2.DoClick = function() net.Start("armor") net.SendToServer()
LocalPlayer():EmitSound("buttons/button24.wav")
end
ca me donne un erreur
il te manque un end) pour fermer le net.receive
 
Discord d'entraide
Rejoignz-nous sur Discord