1. Post #241
    and you're banding me :(
    animorten's Avatar
    May 2007
    100 Posts
    Hey,
    How i get the sound duration of an "mp3" file, because
     SoundDuration() 
    works only for "wav" files ?

    best regards,

    |Royal|
    If a binary module is okay
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Winner Winner x 1Useful Useful x 1Friendly Friendly x 1 (list)

  2. Post #242
    Please waste more of your money changing this title again.
    Gmod4ever's Avatar
    August 2005
    6,784 Posts
    Well, it's a minor issue, so if it's not really resolvable, it's no big deal.

    Does anyone know of a way to make the particles draw behind the box, though? The particles are being drawn in the ENT:Draw() code, and is right above the code for the box itself. This is how it looks now:



    As you can see, the particles are being drawn in front of the box.
    Reposting this, since I would like to know if anyone has any ideas. Thanks.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #243
    JustSoFaded's Avatar
    December 2011
    432 Posts
    Reposting this, since I would like to know if anyone has any ideas. Thanks.
    Get rid of that ugly ass material and rounded box in the bottom left hand corner.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 3Agree Agree x 3 (list)

  4. Post #244
    Please waste more of your money changing this title again.
    Gmod4ever's Avatar
    August 2005
    6,784 Posts
    Get rid of that ugly ass material and rounded box in the bottom left hand corner.
    Thanks for the constructive feedback.

    Now how about the actual question?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Useful Useful x 1 (list)

  5. Post #245
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,754 Posts
    Thanks for the constructive feedback.

    Now how about the actual question?
    Well he's right, the material still looks dumb and the bar just looks bad. Even if it didn't answer your question he was giving you the advice you need to hear.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #246
    Gold Member
    ralle105's Avatar
    October 2005
    4,648 Posts
    Reposting this, since I would like to know if anyone has any ideas. Thanks.
    Use the stencil buffer and draw the box first. Unless you want the particles to come out of the box rather than being behind it.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  7. Post #247
    SFArial's Avatar
    May 2009
    1,213 Posts
    Reposting this, since I would like to know if anyone has any ideas. Thanks.
    You should check if the particle material has ignorez in its vmt code.
    Reply With Quote Edit / Delete Windows 7 Hungary Show Events Agree Agree x 1 (list)

  8. Post #248
    Please waste more of your money changing this title again.
    Gmod4ever's Avatar
    August 2005
    6,784 Posts
    Use the stencil buffer and draw the box first. Unless you want the particles to come out of the box rather than being behind it.
    I would like the particles to be coming from inside the box if I can help it, but behind it is still better than in front of it.

    Edited:

    You should check if the particle material has ignorez in its vmt code.
    I'll check real fast.

    Code:
    "UnlitGeneric"
    {
    	"$basetexture" "sprites/light_glow02"
    	"$additive" "1"
    	"$translucent" "1"
    	"$vertexcolor" "1"
    }
    Doesn't seem like it. Anything else there that may be causing it?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  9. Post #249
    SFArial's Avatar
    May 2009
    1,213 Posts
    Maybe it's just the way quads are rendered. Or you could try drawing it in another rendering hook.
    Reply With Quote Edit / Delete Windows 7 Hungary Show Events

  10. Post #250
    shadowndacorner's Avatar
    May 2011
    195 Posts
    Is there a way to detect if the mouse cursor is enabled?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  11. Post #251

    January 2012
    131 Posts
    I don't think there's a specific function for that. At least I didn't find it on the wiki. But you could probably do a simple detour.

    gui.ScreenClickerEnabled = false
    
    local EnableScreenClicker_Old = gui.EnableScreenClicker
    function gui.EnableScreenClicker( enable )
        EnableScreenClicker_Old( enable )
        gui.ScreenClickerEnabled = enable
    end
    
    function gui.ScreenClickerEnabled()
        return gui.ScreenClickerEnabled()
    end
    
    Reply With Quote Edit / Delete Windows 7 Estonia Show Events

  12. Post #252
    CapsAdmin's Avatar
    August 2005
    3,971 Posts
    Reposting this, since I would like to know if anyone has any ideas. Thanks.
    For your previous question, even if you figured it out, I advice you to use a matrix and rotate the matrix instead of each face individually. It's cleaner and easier to manage.

    local mat = Matrix()
    mat:SetPos(box_pos)
    mat:SetAngles(box_ang)
    mat:Scale(box_scale)
    
    cam.PushModelMatrix(mat)
    	*draw box with normals*
    cam.PopModelMatrix()
    

    As for the emitter, do this

    local emitter = ParticleEmitter(vector_origin)
    emitter:SetNoDraw(true)
    
    function DrawBox(pos)
    	emitter:SetPos(pos)
    	emitter:Draw()
    	*box draw code*
    end
    

    would be behind of course

    Edited:

    Is there a way to detect if the mouse cursor is enabled?
    boolean vgui.CursorVisible()

    Edited:

    I would like the particles to be coming from inside the box if I can help it, but behind it is still better than in front of it.

    Edited:



    I'll check real fast.

    Code:
    "UnlitGeneric"
    {
    	"$basetexture" "sprites/light_glow02"
    	"$additive" "1"
    	"$translucent" "1"
    	"$vertexcolor" "1"
    }
    Doesn't seem like it. Anything else there that may be causing it?
    in what hook are you drawing it?
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Lua Helper Lua Helper x 1 (list)

  13. Post #253
    Gold Member
    maurits150's Avatar
    February 2007
    1,816 Posts
    Is it possible to transmit bytecode (or whatever images use) over console commands? I'm trying to make a system that makes a screenshot using the jpeg command and uploads it to the server, but I'm getting incomplete data on the receiving end. I honesty can't wait for the net libary because concommands are terrible..
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  14. Post #254
    Gold Member
    ralle105's Avatar
    October 2005
    4,648 Posts
    I tried making concommands handle binary data and trust me, it's not something you want to do. The overhead was like double the size of the actual data and even then it was not finished. I recon it'd have to be something like 5 times the size of the data in overhead for it to work fully.

    Edited:

    So yeah, wait for the net library.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Informative Informative x 1 (list)

  15. Post #255
    CapsAdmin's Avatar
    August 2005
    3,971 Posts
    Is it possible to transmit bytecode (or whatever images use) over console commands? I'm trying to make a system that makes a screenshot using the jpeg command and uploads it to the server, but I'm getting incomplete data on the receiving end. I honesty can't wait for the net libary because concommands are terrible..
    you can use http.Get and store the data in the header, and have a socket on the server which receives it if you don't wanna wait
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Friendly Friendly x 1 (list)

  16. Post #256
    ~ ducks ~
    Kwaq's Avatar
    April 2011
    2,327 Posts
    i havent really made anything in lua before

    i want to make it so if a player ducks whilst touching the ground its instant

    if pl:IsOnGround() then
    self:SetDuckSpeed(0)
    self:SetUnDuckSpeed(0) else
    self:SetDuckSpeed(0.4)
    self:SetUnDuckSpeed(0.3)
    end

    what am i doing wrong? its in player_extension on a blank fretta gamemode
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  17. Post #257
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,114 Posts
    Can we have the full code to the function/hook?
    Reply With Quote Edit / Delete Windows 7 Spain Show Events

  18. Post #258
    ~ ducks ~
    Kwaq's Avatar
    April 2011
    2,327 Posts
    oh i just realised im putting it into function meta:OnSpawn()

    what kind of function do i make so that whenever a player touches the ground that gets called?

    and is that going to be a really dumb way to do it
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  19. Post #259
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,114 Posts
    Put it in Think.
    Reply With Quote Edit / Delete Windows 7 Spain Show Events Agree Agree x 1 (list)

  20. Post #260

    June 2011
    80 Posts
    For some reason I can't wrap my head around as to how to do this. I have a round system that I just finished but I want there to be a timer on the screen to count down the time between each round. I know it's with vgui I can do all that I just don't know how to get it to count down by minutes instead of numbers.

    I want: 1 : 30 seconds.
    Instead of 90 seconds.

    How would I do this? Right now I have a simple timer waiting to start the next round but I need to output the time in mnutes and seconds.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #261
    Gold Member
    highvoltage's Avatar
    May 2009
    1,797 Posts
    For some reason I can't wrap my head around as to how to do this. I have a round system that I just finished but I want there to be a timer on the screen to count down the time between each round. I know it's with vgui I can do all that I just don't know how to get it to count down by minutes instead of numbers.

    I want: 1 : 30 seconds.
    Instead of 90 seconds.

    How would I do this? Right now I have a simple timer waiting to start the next round but I need to output the time in mnutes and seconds.
    Here is basically what I use in my HUD:
    --time = the time left in the round
    local minutes = math.floor(time / 60);
    if (minutes < 1) then minutes = 0 end
    local seconds = math.floor(time % 60);
    if (seconds < 10) then seconds = "0"..seconds end
    local DisplayTime = minutes.." : "..seconds
    draw.SimpleTextOutlined(DisplayTime, "HUDNumber5",6, 6, Color(235, 235, 235, 255), 0, 0, 1, Color(25,25,25,255))
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  22. Post #262

    June 2011
    80 Posts
    Here is basically what I use in my HUD:
    --time = the time left in the round
    local minutes = math.floor(time / 60);
    if (minutes < 1) then minutes = 0 end
    local seconds = math.floor(time % 60);
    if (seconds < 10) then seconds = "0"..seconds end
    local DisplayTime = minutes.." : "..seconds
    draw.SimpleTextOutlined(DisplayTime, "HUDNumber5",6, 6, Color(235, 235, 235, 255), 0, 0, 1, Color(25,25,25,255))
    I will try to work with this, thanks a lot dude.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  23. Post #263
    Please waste more of your money changing this title again.
    Gmod4ever's Avatar
    August 2005
    6,784 Posts
    For some reason I can't wrap my head around as to how to do this. I have a round system that I just finished but I want there to be a timer on the screen to count down the time between each round. I know it's with vgui I can do all that I just don't know how to get it to count down by minutes instead of numbers.

    I want: 1 : 30 seconds.
    Instead of 90 seconds.

    How would I do this? Right now I have a simple timer waiting to start the next round but I need to output the time in mnutes and seconds.
    string.ToMinutesSeconds(time_in_seconds)



    Edited:

    As for the emitter, do this

    local emitter = ParticleEmitter(vector_origin)
    emitter:SetNoDraw(true)
    
    function DrawBox(pos)
    	emitter:SetPos(pos)
    	emitter:Draw()
    	*box draw code*
    end
    

    would be behind of course

    Edited:



    in what hook are you drawing it?
    Drawing behind would be better than nothing.

    And the particles are being drawn in the ENT:Draw() hook. I tried setting the entity's render type to translucent and changing the Draw() to DrawTranslucent(), but it didn't really fix matters.

    The draw order is

    Code:
    function ENT:Draw()
    Particle
    Box
    end
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  24. Post #264
    daranable's Avatar
    November 2011
    10 Posts
    For some reason I can't wrap my head around as to how to do this. I have a round system that I just finished but I want there to be a timer on the screen to count down the time between each round. I know it's with vgui I can do all that I just don't know how to get it to count down by minutes instead of numbers.

    I want: 1 : 30 seconds.
    Instead of 90 seconds.

    How would I do this? Right now I have a simple timer waiting to start the next round but I need to output the time in mnutes and seconds.
    Another way to handle this is this:

    Code:
    output = string.format( "%02d:%02d", math.floor( seconds / 60 ), seconds % 60 )
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  25. Post #265
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,819 Posts
    Another alternate:

    Code:
    output = os.date( "%M:%S", seconds )
    Putting in 90 would yield 1:30, for example.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  26. Post #266
    ~ ducks ~
    Kwaq's Avatar
    April 2011
    2,327 Posts
    im trying to make a function where

    on func_door OnOpen
    set self (the door that has been opened)
    alpha 100 and set collision to passable for 5 seconds

    Basically I'm trying to fix doors in a map so that players can pass through it without getting stuck when it opens (when a player first touches it), then when it closes after 5 seconds it returns to normal state.


    I know the commands and stuff to do this but I have no idea how to structure that in lua, I tried a few different ways but I guess I just don't get it yet? I'm not sure how I can set the collision type of a door either so any help is greatly appreciated!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  27. Post #267
    Awesome Gmod Servers!
    brandonj4's Avatar
    September 2011
    2,073 Posts
    I'm trying to make a round system but have no idea where to start..
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  28. Post #268

    July 2011
    222 Posts
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  29. Post #269
    Fantym420's Avatar
    October 2010
    896 Posts
    I'm trying to make a round system but have no idea where to start..
    I made a round system that works off custom hooks, maybe this will give you some ideas feel free to use it, it works I used it in my Meteor defense game mode.

    -- Gamemode Base Functions -- Rounds
    -- ========================================================================================
    --   Hooks:
    --			PreRound : This is called every 5 seconds before the round starts (setup for a round)
    --				Variables : Players (table) , TimeUntilStart (number)
    --
    --	          Hook Example: Will print the time till round start for every player.
    --  	        	hook.Add("PreRound", "myPreRound", function ( plys, time ) for k, v in pairs(plys) do v:ChatPrint("Round Starting in " .. tostring(time)) end )
    --
    --			RoundStart : This is called once when the timer for the round starts 
    --				Variables : Players
    --
    --      	    Hook Example: Will print "Round Started!" for every player.
    --          		hook.Add("RoundStart", "myRoundStart", function ( plys ) for k, v in pairs(plys) do v:ChatPrint("Round Started!") end )
    --
    --			RoundEnd : This is called once as the round ends (timer hits)
    --				Variables : Players
    --
    --          	Hook Example: Will print "Round Finished!" for every player.
    --          		hook.Add("RoundEnd", "myRoundEnd", function ( plys ) for k, v in pairs(plys) do v:ChatPrint("Round Finished!") end )
    --
    --			PostRound : This is called every 5 seconds after the round has ended ( for score stuff)
    --				Variables : Players, TimeUntilEnd
    --
    --       	   Hook Example: Will print the time till PreRound start for every player.
    --          		hook.Add("PreRound", "myPreRound", function ( plys, time ) for k, v in pairs(plys) do v:ChatPrint("Pre Round Will start In " .. tostring(time)) end )
    
    --	 Functions:
    --			* All time is in seconds
    --			SetPreRoundTime( time ) - Sets the Current Length of the PreRound
    --			GetPreRoundTime() - Gets the Current Length of the PreRound
    --
    --			SetPreRoundInterval( time) -- Sets the Callback Rate on the PreRound
    --			GetPreRoundInterval() -- Gets the Callback Rate on the PreRound
    --
    --			SetRoundTime( time ) - Sets the Length of the round (must be set before the Round starts, if set durring the round it will affect the next round)
    --			GetRoundTime() - Gets the Current Round Length
    --
    --			SetPostRoundTime( time ) - Sets the length of the PostRound
    --			GetPostRoundTime() - Gets the length of the PostRound
    --
    --			SetPostRoundInterval( time ) - Set the Callback Rate on the PostRound
    -- 			GetPostRoundInterval() - Gets the Callback Rate on the PostRound
    --
    --			DidPreOnce() - Returns true if the Current PreRound has been called once
    --			DidPostOnce() - Return true if the Current PostRound has been called once
    --
    --			StartRound() - forces round to start
    --			EndRound() - forces end of round
    --			
    --			RoundTimeRemaining() - Returns the time left in the round, or -1 if no round is running.
    --
    
    if !SERVER then return end
    
    -- Cleanup incase we are reloading the script
    if timer.IsTimer("iPreRoundTimer") then timer.Remove("iPreRoundTimer") end
    if timer.IsTimer("iRoundTimer") then timer.Remove("iRoundTimer") end
    if timer.IsTimer("iPostRoundTimer") then timer.Remove("iPostRoundTimer") end
    
    -- Internal Variables with Default Values
    iPreRoundTime = 90
    iPreRoundInterval = 5
    iRoundTime = 120 
    iRoundStarted = -1
    iPostRoundTime = 90
    iPostRoundInterval = 5
    iPlayers = {}
    iPreRan = false
    iPostRan = false
    
    -- Exposed Functions
    function DidPreOnce() return iPreRan end -- Used to Check if it the first PreRound call
    function DidPostOnce() return iPostRan end -- Used to Check if it's the first PostRound call
    function RoundPercentComplete() return 1 - (RoundTimeRemaining() / iRoundTime) end -- Returns the percent in decimal form of the round that is completed
    function RoundPercentCompleteR() return (RoundTimeRemaining() / iRoundTime) end -- Returns the percent in decimal form of the round that is completed
    
    -- Force Round Start
    function StartRound() 
    	timer.Remove("iPreRoundTimer")
    	iRoundStart() 
    end
    
    -- Force Round End
    function EndRound() 
    	timer.Remove("iRoundTimer")
    	iRoundEnd() 
    end
    
    -- Set/Get the length of the PreRound
    function SetPreRoundTime( time ) 
    	if (time >= 0) and !(time == nil) then
    		iPreRoundTime = time
    	end
    end
    function GetPreRoundTime() return iPreRoundTime end
    
    -- Check Time Remaining in the Round
    function RoundTimeRemaining()
    
    	if iRoundStarted == -1 then return 0 end
    	return iRoundTime - (CurTime() - iRoundStarted)
    	
    end
    
    -- Set/Get Pre Round Call Interval
    function SetPreRoundInterval( time ) 
    	if (time >= 0) and !(time == nil) then
    		iPreRoundInterval = time
    	end
    end
    function GetPreRoundInterval() return iPreRoundInterval end
    
    -- Set/Get Round Time
    function SetRoundTime( time ) 
    	if (time >= 0) and !(time == nil) then
    		iRoundTime = time
    	end
    end
    function GetRoundTime() return iRoundTime end
    
    -- Set/Get Length of the Post Round.
    function SetPostRoundTime( time ) 
    	if (time >= 0) and !(time == nil) then
    		iPostRoundTime = time
    	end
    end
    function GetPostRoundTime() return iPostRoundTime end
    
    -- Set/Get PostRound Call Interval
    function SetPostRoundInterval( time ) 
    	if (time >= 0) and !(time == nil) then
    		iPostRoundInterval = time
    	end
    end
    function GetPostRoundInterval() return iPostRoundInterval end
    
    -- Quick Hooks they keep track of the players playing
    --hook.Add( "PlayerAuthed", "fanRoundPlayerAuthed", function ( ply, stid, uid ) table.insert( iPlayers, ply ) end )
    --hook.Add( "PlayerDisconnected", "fanRoundPlayerDisconnected", function ( ply ) table.remove(iPlayers, IndexFromValue(iPlayers, ply)) end )
    
    -- Internal Functions
    
    -- Cleans Bad Entries From the player table
    function iCleanTable( tbl )
    	
    	if table.Count(tbl) < 1 then return end
    	for k, v in pairs(tbl) do
    		if !v:IsValid() or
    		   (v == nil) or
    		   (v == NULL) then 
    			table.remove(tbl, k)
    		end
    	end
    	
    end
    
    -- Get an Index from a table by value
    function IndexFromValue( tbl, value )
    	for k,v in pairs(tbl) do
    		if v == value then return k end
    	end
    	
    	return nil
    end
    
    function iPreRound( time )
    	
    	iPostRan = false
    	
    	if time >= iPreRoundTime then
    		time = 0
    		timer.Remove("iPreRoundTimer")
    		iRoundStart()
    	else
    		iPlayers = player.GetHumans()
    		hook.Call( "PreRound", nil, iPlayers, iPreRoundTime - time)
    		iPreRan = true
    		timer.Remove("iPreRoundTimer")
    		timer.Create("iPreRoundTimer", iPreRoundInterval, 0, iPreRound, time + iPreRoundInterval )
    	end
    end
    
    function iRoundStart()
    	
    	iPreRan = false
    	
    	iRoundStarted = CurTime()
    	
    	if !timer.IsTimer("iRoundTimer") then
    		timer.Create("iRoundTimer", iRoundTime, 0, iRoundEnd )
    	end
    	
    	iPlayers = player.GetHumans()
    	hook.Call( "RoundStart", nil, iPlayers )
    	
    end
    
    function iRoundEnd()
    
    	iRoundStarted = -1
    	timer.Remove("iRoundTimer")
    	
    	iPlayers = player.GetHumans()
    	hook.Call( "RoundEnd", nil, iPlayers )
    	
    	iPostRound( 0 )
    	
    end
    
    function iPostRound( time )
    	
    	if time >= iPostRoundTime then
    		time = 0 
    		timer.Stop("iPostRoundTimer")
    		iPreRound( 0 )
    	else
    		iPlayers = player.GetHumans()
    		hook.Call( "PostRound", nil, iPlayers, iPostRoundTime - time)
    		iPostRan = true
    		timer.Remove("iPostRoundTimer")
    		timer.Create("iPostRoundTimer", iPostRoundInterval, 0, iPostRound, time + iPostRoundInterval)
    	end
    	
    end
    
    -- After Everything is loaded start the round cycle
    iPreRound( 0 )
    

    The code currently assumes that all players in the server are in the round, depending on what you are doing you will need to change the way players are managed.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #270
    Awesome Gmod Servers!
    brandonj4's Avatar
    September 2011
    2,073 Posts
    -snip-
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  31. Post #271
    Gold Member
    Dorkslayz's Avatar
    September 2009
    1,672 Posts
    This problem has only occurred in the GM13 beta, but I dont know how to fix it.

    This happens on all the map's I have tried with my gamemode.

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  32. Post #272
    Title

    August 2009
    300 Posts
    This problem has only occurred in the GM13 beta, but I dont know how to fix it.

    This happens on all the map's I have tried with my gamemode.

    Are you doing anything that changes your skybox in your code? Like moving env_sun etc?

    Anyway, I'm finding no sense in this what-so-ever. I have tried adding another tool like this:

    ToolList["Stuff"][1] = {
    	Controls = "color",
    	ItemName = "color",
    	Command = "gmod_tool color",
    	Text = "#Color"
    }
    

    And this is one which was already made:
    ToolList["Constraints"][1] = {
    	Controls = "axis",
    	ItemName = "axis",
    	Command = "gmod_tool axis",
    	Text = "#Axis"
    }
    

    Yes, the Stuff menu does exist. The tool shows but there is no options for the tool's.

    Well the tool itself works, however there is no options to change anything, it's just grey. (Floodmod).
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  33. Post #273
    Gold Member
    Dorkslayz's Avatar
    September 2009
    1,672 Posts
    Are you doing anything that changes your skybox in your code? Like moving env_sun etc?

    Anyway, I'm finding no sense in this what-so-ever. I have tried adding another tool like this:

    ToolList["Stuff"][1] = {
    	Controls = "color",
    	ItemName = "color",
    	Command = "gmod_tool color",
    	Text = "#Color"
    }
    

    And this is one which was already made:
    ToolList["Constraints"][1] = {
    	Controls = "axis",
    	ItemName = "axis",
    	Command = "gmod_tool axis",
    	Text = "#Axis"
    }
    

    Yes, the Stuff menu does exist. The tool shows but there is no options for the tool's.
    As far as I remember, im not.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  34. Post #274
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,114 Posts
    Mrkrabz: you probably need to supply the CPanel building tool, since I think color doesn't use txt files for controls.
    Reply With Quote Edit / Delete Windows 7 Spain Show Events

  35. Post #275

    January 2012
    131 Posts
    I suppose there isn't an opposite function of GM:PlayerSpawnedProp( Player ply, String model, Entity ent )? Any tips on how to make one? e.g PlayerUndoProp or PlayerRemoveProp?
    Reply With Quote Edit / Delete Windows 7 Estonia Show Events

  36. Post #276
    Best Gamemode Ever
    Deadman123's Avatar
    July 2011
    1,603 Posts
    I suppose there isn't an opposite function of GM:PlayerSpawnedProp( Player ply, String model, Entity ent )? Any tips on how to make one? e.g PlayerUndoProp or PlayerRemoveProp?
    Hook OnEntityRemoved and compare to see if the ent is a prop_physics
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  37. Post #277
    Gold Member
    Dorkslayz's Avatar
    September 2009
    1,672 Posts
    I keep getting this error when the VGUI is meant to appear within my gamemode.

    Code:
    Hook 'CharacterPanels' Failed:  attempt to index local 'characterPanel' (a nil value)
    the code for the section is

    	local characterPanel = vgui.Create( "DFrame" )
    	characterPanel:SetPos( ScrW() / 4, ScrH() / 4 )
    	characterPanel:SetSize( 800, 570 )
    	characterPanel:SetTitle( "Character Creation" )
    	characterPanel:SetVisible( true )
    	characterPanel:SetDraggable( false )
    	characterPanel:ShowCloseButton( false )
            characterPanel:Show()
    

    and the hook code is

    hook.Add( "InitPostEntity", "CharacterPanels", CreateCharacterPanels )
    
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  38. Post #278
    Title

    August 2009
    300 Posts
    My Collapsible category won't display correct:


    It seems as it's not opening rather just moving when you select it. This is the code of one of my category.

            self.PropsCatD = vgui.Create( "DCollapsibleCategory" ) 
            self.PropsCatD:SetSize( (self.LeftX - 10), self.MY ) 
            self.PropsCatD:SetLabel( "Miscellaneus Props" )          
            self.PropsContD = vgui.Create( "DPanelList" )
            self.PropsContD:EnableHorizontal(true)  
            self.PropsContD:SetAutoSize( true )                     
            self.PropsContD:SetSpacing( 5 ) 
            self.PropsContD:SetPadding( 5 )         
            self.PropsCatD:SetContents( self.PropsContD ) 
            self.PropsBackground:AddItem( self.PropsCatD )
    

            self.MX = self:GetWide()
    	self.MY = self:GetTall()
    	self.LeftX = (math.floor((self.MX/2 - 10)/66) * 66) + 11
    
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  39. Post #279
    Upload Images
    kragmars102's Avatar
    April 2011
    731 Posts
    Hi, I've run into a question nobody is able to answer or take the time to answer. Using the TDMcars, some car material skins would jump from 12, suddenly to have 26 files. those extra 14 files don't exist. But this causes a problem, for e.g. If i use skin3.vmt it would apply skin1.vmt and wouldn't allow the use of some skins at all. I've got everything setup properly works fine with other cars except certain one's like the murcielago.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  40. Post #280
    Awesome Gmod Servers!
    brandonj4's Avatar
    September 2011
    2,073 Posts
    function MyCalcView(ply, pos, angles, fov)
        
    	local view = {}
        view.origin = pos-(angles:Forward()*100)
        view.angles = angles
        view.fov = fov
     
        return view
    end
    hook.Add("CalcView", "MyCalcView", MyCalcView)
     
    hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply)
        return true
    end)
    
    How would I get this camera to face my frontside? I tried reversing it and that didn't quite work.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events