- Initiateur de la discussion
M
Maviis
Têtard
- Messages
- 1
- Score réaction
- 0
- Points
- 5
Bonjour, j'ai un problème. J'essaye de créer un swep qui, quand on fait clique gauche, ouvre un panel.
Cependant, lorsque je fais clique gauche, il y a plusieurs panels qui s'ouvrent. Pouvez vous m'aider svp?
Voici le code :
Merci d'avance
PS : Photo jointe.
Cependant, lorsque je fais clique gauche, il y a plusieurs panels qui s'ouvrent. Pouvez vous m'aider svp?
Voici le code :
SWEP.PrintName = "Outil d'alerte"
SWEP.Category = "EvoCommunity"
SWEP.Author = "Mavis"
SWEP.Instructions = "XX"
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Weight = 1
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false
SWEP.Slot = 1
SWEP.SlotPos = 2
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.ViewModel = "models/weapons/c_stunstick.mdl"
SWEP.WorldModel = "models/weapons/w_stunbaton.mdl"
SWEP.canReload = true
function SWEPrimaryAttack()
if not CLIENT then return end
if not self.canReload then return end
local ply = self:GetOwner()
if not IsValid( ply ) or not ply:Alive() then return end
-- variables
local w, h = ScrW() * .3, ScrH() * .50
local left_margin = 15
-- frame
local frame = vgui.Create( "DFrame" )
frame:SetSize( w, h )
frameockPadding( left_margin, left_margin * 2, 0, left_margin * .75 )
frame:Center()
frame:SetTitle( "Evo" )
frame:MakePopup()
end
SWEP.Category = "EvoCommunity"
SWEP.Author = "Mavis"
SWEP.Instructions = "XX"
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Weight = 1
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false
SWEP.Slot = 1
SWEP.SlotPos = 2
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.ViewModel = "models/weapons/c_stunstick.mdl"
SWEP.WorldModel = "models/weapons/w_stunbaton.mdl"
SWEP.canReload = true
function SWEPrimaryAttack()
if not CLIENT then return end
if not self.canReload then return end
local ply = self:GetOwner()
if not IsValid( ply ) or not ply:Alive() then return end
-- variables
local w, h = ScrW() * .3, ScrH() * .50
local left_margin = 15
-- frame
local frame = vgui.Create( "DFrame" )
frame:SetSize( w, h )
frameockPadding( left_margin, left_margin * 2, 0, left_margin * .75 )
frame:Center()
frame:SetTitle( "Evo" )
frame:MakePopup()
end
Merci d'avance
PS : Photo jointe.
Pièces jointes
- 1671896429125.png638 KB Vues: 8