• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=Smt;47800082] What are these things called in notepad++? and how can I get them into sublime or atom? I cannot find any sort of name for them [/QUOTE] Code folding For Sublime: Edit -> Code Folding -> Fold/Unfold/Whatever
[QUOTE=Jeff Scott;47800126]Code folding For Sublime: Edit -> Code Folding -> Fold/Unfold/Whatever[/QUOTE] That works sort of well, but is there any sort of package for sublime that specifically adds the lines from start to end of "foldable" blocks? I know it's being pretty picky I just can't find anything in the package manager for sublime, it's one of the few things notepad++ does that I like over anything else I love how it easily shows nested stuff like this [url]http://i.imgur.com/pYdZufX.png[/url]
[img]http://rp.braxnet.org/scr/2015-05-25_17-31-29_65.png[/img] install everything gmod related in sublime, it's worth it also [code]"fade_fold_buttons": false[/code] in user prefs
How would I go about displaying text in Derma that updates constantly? For example, let's say I have a RichText thing in my derma box, and I want it to display the time. The problem I have is that when I create the derma box, the time is only what ever time it was when the box was created.
[code]-- Serverside code util.AddNetworkString( "OpenMenuUniqueName" ) function MakeClientOpenMenu( Pl ) net.Start( "OpenMenuUniqueName" ) net.Send( Pl ) end -- Clientside code net.Receive( "OpenMenuUniqueName", function() local LoseScreen = vgui.Create( "DFrame" ) LoseScreen:SetPos( 100, 100 ) LoseScreen:SetSize( 450, 450 ) LoseScreen:SetTitle( "You Have Lost..." ) LoseScreen:SetVisible( true ) LoseScreen:ShowCloseButton(false) LoseScreen:SetDraggable( true ) LoseScreen:SetDeleteOnClose( false ) LoseScreen:Show() end) [/code] This kinda goes towards James XX, as he provided me with a code example to base this code off of, but this doesn't work(yes, the serverside code is in init.lua and the clientside code is in cl_init.lua). Anyone have any ideas why? Rate this dumb all you want, but remember that I'm not the best coder in the world either
[QUOTE=A Fghtr Pilot;47802899][code]-- Serverside code util.AddNetworkString( "OpenMenuUniqueName" ) function MakeClientOpenMenu( Pl ) net.Start( "OpenMenuUniqueName" ) net.Send( Pl ) end -- Clientside code net.Receive( "OpenMenuUniqueName", function() local LoseScreen = vgui.Create( "DFrame" ) LoseScreen:SetPos( 100, 100 ) LoseScreen:SetSize( 450, 450 ) LoseScreen:SetTitle( "You Have Lost..." ) LoseScreen:SetVisible( true ) LoseScreen:ShowCloseButton(false) LoseScreen:SetDraggable( true ) LoseScreen:SetDeleteOnClose( false ) LoseScreen:Show() end) [/code] This kinda goes towards James XX, as he provided me with a code example to base this code off of, but this doesn't work(yes, the serverside code is in init.lua and the clientside code is in cl_init.lua). Anyone have any ideas why? Rate this dumb all you want, but remember that I'm not the best coder in the world either[/QUOTE] You don't call MakeClientOpenMenu?
[QUOTE=Willox;47802909]You don't call MakeClientOpenMenu?[/QUOTE] Gyah, forgot to say, when I call it via lua_run or in the code itself it doesn't work too
[QUOTE=A Fghtr Pilot;47802923]Gyah, forgot to say, when I call it via lua_run or in the code itself it doesn't work too[/QUOTE] Where are your files located? What parameter do you pass to MakeClientOpenMenu?
[QUOTE=Willox;47802932]Where are your files located? What parameter do you pass to MakeClientOpenMenu?[/QUOTE] What do you mean where are my files located? Of course I have clientside code in cl_init.lua and serverside code in init.lua. Also, lua_run runs the function fine, but it doesn't open the menu. I call the code like so: [code]lua_run MakeClientOpenMenu()[/code] and just calling it in the code itself doesn't work either. I just call it like MakeClientOpenMenu().
[QUOTE=A Fghtr Pilot;47802998]What do you mean where are my files located? Of course I have clientside code in cl_init.lua and serverside code in init.lua.[/QUOTE] I have no idea where these two files are. [QUOTE=A Fghtr Pilot;47802998]Also, lua_run runs the function fine, but it doesn't open the menu. I call the code like so: [code]lua_run MakeClientOpenMenu()[/code] and just calling it in the code itself doesn't work either. I just call it like MakeClientOpenMenu().[/QUOTE] MakeClientOpenMenu takes a player argument. You need to give it one, try: [code]lua_run MakeClientOpenMenu( Entity( 1 ) )[/code]
[QUOTE=TheMrFailz;47802841]How would I go about displaying text in Derma that updates constantly? For example, let's say I have a RichText thing in my derma box, and I want it to display the time. The problem I have is that when I create the derma box, the time is only what ever time it was when the box was created.[/QUOTE] DLabel and override Paint function to draw text? Your question is vague.
[QUOTE=Swog;47803184]DLabel and override Paint function to draw text? Your question is vague.[/QUOTE] I wouldn't call it vague. I basically want a text line that updates every tick or whatever so that I can display something like the time and have it keep up with what the actual time is instead of it being what ever the time was when the text was created.
[QUOTE=Willox;47803012]I have no idea where these two files are. MakeClientOpenMenu takes a player argument. You need to give it one, try: [code]lua_run MakeClientOpenMenu( Entity( 1 ) )[/code][/QUOTE] Oh! It works now. Thanks! But, my new problem is, that's only for the first player who joined, if I'm correct. Also, I don't remember if LocalPlayer() works serverside, so how would I give it to the local player?
[QUOTE=A Fghtr Pilot;47803261]Oh! It works now. Thanks! But, my new problem is, that's only for the first player who joined, if I'm correct. Also, I don't remember if LocalPlayer() works serverside, so how would I give it to the local player?[/QUOTE] When are you going to make the player open it?
How does one make lua effects? I tried copying the balloon_pop effect from sandbox, renaming it and putting it in myaddon/lua/entities/effects but it's not being loaded.
[url]http://postimg.org/image/naoaw2u3h/[/url] [code]local DermaLabel = vgui.Create( "DLabel", LoseScreen ) DermaLabel:SetParent( LoseScreen ) DermaLabel:SetPos( 10, 100 ) DermaLabel:SetFont( "DermaLarge" ) DermaLabel:SetText( "The Cyborg Wins" ) LoseScreen.OnClose = function() gui.EnableScreenClicker(false) end [/code] How would I make this not get cut off? I've been running into that problem a lot with dlabels lately
[QUOTE=A Fghtr Pilot;47803682][url]http://postimg.org/image/naoaw2u3h/[/url] [code]local DermaLabel = vgui.Create( "DLabel", LoseScreen ) DermaLabel:SetParent( LoseScreen ) DermaLabel:SetPos( 10, 100 ) DermaLabel:SetFont( "DermaLarge" ) DermaLabel:SetText( "The Cyborg Wins" ) LoseScreen.OnClose = function() gui.EnableScreenClicker(false) end [/code] How would I make this not get cut off? I've been running into that problem a lot with dlabels lately[/QUOTE] Try using [URL="http://wiki.garrysmod.com/page/Panel/SetSize"]Panel:SetSize(width, height)[/URL]
Does [B]ENT:PhysicsCollide[/B] run for Players?
[QUOTE=WalkingZombie;47803748]Does [B]ENT:PhysicsCollide[/B] run for Players?[/QUOTE] Players are not SENTs.
[QUOTE=Willox;47803750]Players are not SENTs.[/QUOTE] No, but they are Entities... well if I wanted to calculate damage when a player falls on something, but the GetFallDamage hook isn't run, how could I? [editline]25th May 2015[/editline] and do note, some ENT: functions work on Players.
[QUOTE=WalkingZombie;47803766]No, but they are Entities... well if I wanted to calculate damage when a player falls on something, but the GetFallDamage hook isn't run, how could I?[/QUOTE] [url]http://wiki.garrysmod.com/page/GM/OnPlayerHitGround[/url]
:pwn: That's actually a real hook?! Wow, thanks. [t]http://www.facepunch.com/fp/ratings/box.png[/t] [editline]25th May 2015[/editline] Wait, does that consider entities to be the ground? In which case, it looks like I'd have to use GetGroundEntity to reference it.
[QUOTE=Swog;47803713]Try using [URL="http://wiki.garrysmod.com/page/Panel/SetSize"]Panel:SetSize(width, height)[/URL][/QUOTE] Thanks! It works perfectly. [editline]25th May 2015[/editline] Also, another question, is there a way to emit a sound globally? I don't want to emit a sound multiple times per player, but more or less just want to emit a sound once but make it be played for all players, not at a specific vector.
[QUOTE=A Fghtr Pilot;47803912] Also, another question, is there a way to emit a sound globally? I don't want to emit a sound multiple times per player, but more or less just want to emit a sound once but make it be played for all players, not at a specific vector.[/QUOTE] [url]http://wiki.garrysmod.com/page/surface/PlaySound[/url] This is clientside, so you'll have to set up a way for the server to tell all connected clients when to play the sound. Not sure if there's a more direct way to play a sound across the entire map serverside
[QUOTE=Mossman1223;47804348][url]http://wiki.garrysmod.com/page/surface/PlaySound[/url] This is clientside, so you'll have to set up a way for the server to tell all connected clients when to play the sound. Not sure if there's a more direct way to play a sound across the entire map serverside[/QUOTE] Oh, playing the sound on all clients will be easy. player.GetAll() works clientside so I can just do a "for k, v in pairs(player.GetAll()) do" statement
[QUOTE=A Fghtr Pilot;47804593]Oh, playing the sound on all clients will be easy. player.GetAll() works clientside so I can just do a "for k, v in pairs(player.GetAll()) do" statement[/QUOTE] doesn't work that way you can't send code to other clients from your own client, if you could easily then hacking would be a lot more fun you should set up a net message from the server that gets sent out to each client, that then triggers clientside code to actually play the sound [url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url] [CODE]if SERVER then util.PrecacheString("TellClientToPlayASound") net.Start("TellClientToPlayASound") net.Send(player.GetAll()) else --this code will be ran on the client net.Receive("TellClientToPlayASound", function(len) --put whatever you want here surface.PlaySound( "ambient\wind\wind_moan4.wav" ) end) end[/CODE] not tested but should work
Is it possible to make a player model show with the cam.Start3D2D? I have a community board for the Mayor when he does lockdown or broadcast in DarkRP and want his ugly mug to appear with it.. [IMG]http://u.insertpix.com/a2c9.png[/IMG]
[QUOTE=isjason;47805256]Is it possible to make a player model show with the cam.Start3D2D? I have a community board for the Mayor when he does lockdown or broadcast in DarkRP and want his ugly mug to appear with it.. [IMG]http://u.insertpix.com/a2c9.png[/IMG][/QUOTE] you might be able to render a clientside model and scale it so it's basically squashed onto the board, but there'd be z-fighting and it'd be super ugly hilarious though, I'd go for it
take a look at dmodelpanel [url]https://github.com/garrynewman/garrysmod/blob/e6e35fd4fc5d3a211884e4856a33996a29712483/garrysmod/lua/vgui/dmodelpanel.lua#L115[/url]
[QUOTE=Mossman1223] [CODE]if SERVER then util.PrecacheString("TellClientToPlayASound") net.Start("TellClientToPlayASound") net.Send(player.GetAll()) else --this code will be ran on the client net.Receive("TellClientToPlayASound", function(len) --put whatever you want here surface.PlaySound( "ambient\wind\wind_moan4.wav" ) end) end[/CODE][/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Broadcast]net.Broadcast[/url] exists for a reson.
Sorry, you need to Log In to post a reply to this thread.