• Derma HELP!
    8 replies, posted
Hay i want to make a basic derma menu with a drop down that has several spawn icons that i can use to spawn stuff but im tarded so i have no idea how to do this D: help plz?
[lua]function proplist() print ("List Opening") local props = {} props[1] = "models/props_junk/garbage_milkcarton002a.mdl" props[2] = "models/props_junk/PopCan01a.mdl" props[3] = "models/props_junk/garbage_takeoutcarton001a.mdl" props[4] = "models/props_junk/watermelon01.mdl" props[5] = "models/props_junk/garbage_metalcan001a.mdl" props[6] = "models/props_lab/box01a.mdl" props[7] = "models/props_lab/box01b.mdl" -- You can add more such as props[8] = "models/path/model.mdl" to add your own. local slframe = vgui.Create("DFrame") local IconList = vgui.Create("DPanelList", slframe) slframe:Center() slframe:SetSize(250,200) slframe:SetTitle("Prop Catalog") slframe:MakePopup() IconList:EnableVerticalScrollbar( true ) IconList:EnableHorizontal( true ) IconList:SetPadding( 4 ) IconList:SetPos(10,30) IconList:SetSize(200,160) for k,v in pairs(props) do local icon = vgui.Create( "SpawnIcon", IconList ) icon:SetModel( v ) IconList:AddItem( icon ) icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v) end end end concommand.Add("slist", proplist) function GM:OnSpawnMenuOpen( ply ) LocalPlayer():ConCommand("slist") end[/lua]
[QUOTE=DocDoomsday;21687783][lua]function proplist() print ("List Opening") local props = {} props[1] = "models/props_junk/garbage_milkcarton002a.mdl" props[2] = "models/props_junk/PopCan01a.mdl" props[3] = "models/props_junk/garbage_takeoutcarton001a.mdl" props[4] = "models/props_junk/watermelon01.mdl" props[5] = "models/props_junk/garbage_metalcan001a.mdl" props[6] = "models/props_lab/box01a.mdl" props[7] = "models/props_lab/box01b.mdl" -- You can add more such as props[8] = "models/path/model.mdl" to add your own. local slframe = vgui.Create("DFrame") local IconList = vgui.Create("DPanelList", slframe) slframe:Center() slframe:SetSize(250,200) slframe:SetTitle("Prop Catalog") slframe:MakePopup() IconList:EnableVerticalScrollbar( true ) IconList:EnableHorizontal( true ) IconList:SetPadding( 4 ) IconList:SetPos(10,30) IconList:SetSize(200,160) for k,v in pairs(props) do local icon = vgui.Create( "SpawnIcon", IconList ) icon:SetModel( v ) IconList:AddItem( icon ) icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v) end end end concommand.Add("slist", proplist) function GM:OnSpawnMenuOpen( ply ) LocalPlayer():ConCommand("slist") end[/lua][/QUOTE] How do i open this in game Also it goes in lua autorun client right?
[QUOTE=jgwetworth;21687812]How do i open this in game Also it goes in lua autorun client right?[/QUOTE] Its for a gamemode, it would go in a cl file for the gamemode like cl_init
[QUOTE=DocDoomsday;21687842]Its for a gamemode, it would go in a cl file for the gamemode like cl_init[/QUOTE] so i just paste it right in their? at the bottom after "end" and when its in their how do i open it
[QUOTE=jgwetworth;21687862]so i just paste it right in their? at the bottom after "end" and when its in their how do i open it[/QUOTE] press Q
[QUOTE=DocDoomsday;21687955]press Q[/QUOTE] Tryed That Same Old Menu [editline]08:41AM[/editline] /*--------------------------------------------------------- Sandbox Gamemode This is GMod's default gamemode ---------------------------------------------------------*/ include( 'shared.lua' ) include( 'cl_spawnmenu.lua' ) include( 'cl_notice.lua' ) include( 'cl_hints.lua' ) include( 'cl_worldtips.lua' ) include( 'cl_scoreboard.lua' ) include( 'cl_quicktool.lua' ) function GM:Initialize() self.BaseClass:Initialize() end function GM:LimitHit( name ) Msg("You have hit the ".. name .." limit!\n") self:AddNotify( "#SBoxLimit_"..name, NOTIFY_ERROR, 6 ) surface.PlaySound( "buttons/button10.wav" ) end function GM:OnUndo( name, strCustomString ) Msg( name .." undone\n" ) if ( !strCustomString ) then self:AddNotify( "#Undone_"..name, NOTIFY_UNDO, 2 ) else self:AddNotify( strCustomString, NOTIFY_UNDO, 2 ) end // Find a better sound :X surface.PlaySound( "buttons/button15.wav" ) end function GM:OnCleanup( name ) Msg( name .." cleaned\n" ) self:AddNotify( "#Cleaned_"..name, NOTIFY_CLEANUP, 5 ) // Find a better sound :X surface.PlaySound( "buttons/button15.wav" ) end function GM:UnfrozeObjects( num ) Msg( "Unfroze "..num.." Objects\n" ) self:AddNotify( "Unfroze "..num.." Objects", NOTIFY_GENERIC, 3 ) // Find a better sound :X surface.PlaySound( "npc/roller/mine/rmine_chirp_answer1.wav" ) end function GM:HUDPaint() self:PaintWorldTips() // Draw all of the default stuff self.BaseClass:HUDPaint() self:PaintNotes() end /*--------------------------------------------------------- Draws on top of VGUI.. ---------------------------------------------------------*/ function GM:PostRenderVGUI() self.BaseClass:PostRenderVGUI() end function proplist() print ("List Opening") local props = {} props[1] = "models/props_junk/garbage_milkcarton002a.mdl" props[2] = "models/props_junk/PopCan01a.mdl" props[3] = "models/props_junk/garbage_takeoutcarton001a.mdl" props[4] = "models/props_junk/watermelon01.mdl" props[5] = "models/props_junk/garbage_metalcan001a.mdl" props[6] = "models/props_lab/box01a.mdl" props[7] = "models/props_lab/box01b.mdl" -- You can add more such as props[8] = "models/path/model.mdl" to add your own. local slframe = vgui.Create("DFrame") local IconList = vgui.Create("DPanelList", slframe) slframe:Center() slframe:SetSize(250,200) slframe:SetTitle("Prop Catalog") slframe:MakePopup() IconList:EnableVerticalScrollbar( true ) IconList:EnableHorizontal( true ) IconList:SetPadding( 4 ) IconList:SetPos(10,30) IconList:SetSize(200,160) for k,v in pairs(props) do local icon = vgui.Create( "SpawnIcon", IconList ) icon:SetModel( v ) IconList:AddItem( icon ) icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v) end end end concommand.Add("slist", proplist) function GM:OnSpawnMenuOpen( ply ) LocalPlayer():ConCommand("slist") end _______________ Thats what it looks like but it deletes the part u gave me every time
Because sandbox is default GFC or whatever will fix it...it's for custom gamemodes
^This^ You cant edit Sandbox; each time you run it, it runs the default files, so everything you edited in sandbox files, gets deleted.
Sorry, you need to Log In to post a reply to this thread.