• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[QUOTE=PaellaPablo;45992377]I hate your underscores, but I love your code. Well played. and thanks :3 [B]EDIT[/B] Actually, fucking rip in pepperinos it didnt work. [LUA] function _gm.cFunc.RenderScreenspaceEffects( bIsDepth, bIsSkybox) if !bIsSkybox then return end if GetGlobalVector("epp") != Vector(0,0,0) then local epp = GetGlobalVector("epp") local epr = GetGlobalInt("epr") local epa = GetGlobalInt("epa") local epw = GetGlobalInt("epw") local eph = GetGlobalInt("eph") local epl = GetGlobalInt("epl") render.DrawWireframeBox( epp + Vector(0,0,epa), Angle(0, epr, 0), Vector(-epw/2, -epl/2, -eph/2) , Vector(epw/2, epl/2, eph/2), Color(255,255,0), true ) end end hook.Add("PostDrawTranslucentRenderables", "gm_renderscreenspaceeffects", _gm.cFunc.RenderScreenspaceEffects) [/LUA] Doesnt draw at all now :'( (all I did was add the if !bIsSkybox then return end)[/QUOTE] Reverse the logic. You're telling it to draw only in the SkyBox call... If not skybox then return;... Should be, if skybox then return;/// Also, you can add a pix visible to it, or check line of sight... The render hooks should have no issue hiding things it shouldn't see, make sure IgnoreZ isn't enabled on the call. render.DrawWireframeBox( Vector position, Angle angle, Vector mins, Vector maxs, table color, boolean writeZ ) The last argument may be your answer; IgnoreZ / etc usually means if it can be rendered through walls as render typically doesn't let that happen whereby HUDPaint and drawing things on screen always shows...
[QUOTE=Acecool;45999348]Reverse the logic. You're telling it to draw only in the SkyBox call... If not skybox then return;... Should be, if skybox then return;/// Also, you can add a pix visible to it, or check line of sight... The render hooks should have no issue hiding things it shouldn't see, make sure IgnoreZ isn't enabled on the call. render.DrawWireframeBox( Vector position, Angle angle, Vector mins, Vector maxs, table color, boolean writeZ ) The last argument may be your answer; IgnoreZ / etc usually means if it can be rendered through walls as render typically doesn't let that happen whereby HUDPaint and drawing things on screen always shows...[/QUOTE] [LUA] local matZone = Material( "cable/blue_elec" ) function _gm.cFunc.RenderScreenspaceEffects( bIsDepth, bIsSkybox) if bIsSkybox then return end if GetGlobalVector("epp") != Vector(0,0,0) then local epp = GetGlobalVector("epp") local epr = GetGlobalInt("epr") local epa = GetGlobalInt("epa") local epw = GetGlobalInt("epw") local eph = GetGlobalInt("eph") local epl = GetGlobalInt("epl") --render.DrawWireframeBox( epp + Vector(0,0,epa), Angle(0, epr, 0), Vector(-epw/2, -epl/2, -eph/2) , Vector(epw/2, epl/2, eph/2), Color(255,255,0), false ) render.SetMaterial( matZone ) render.DrawBeam( epp + Vector( epw/2, epl/2, epa + eph/2 ), epp + Vector( -epw/2, epl/2, epa + eph/2 ), 4, 0, 0, Color(255,255,255) ) end end hook.Add("PostDrawTranslucentRenderables", "gm_renderscreenspaceeffects", _gm.cFunc.RenderScreenspaceEffects) [/LUA] I tried using drawbeam & switching logic to see if that would fix it, it didn't. Are you sure your code doesn't actually draw through the skybox?
[QUOTE=PaellaPablo;45999481][LUA] local matZone = Material( "cable/blue_elec" ) function _gm.cFunc.RenderScreenspaceEffects( bIsDepth, bIsSkybox) if bIsSkybox then return end if GetGlobalVector("epp") != Vector(0,0,0) then local epp = GetGlobalVector("epp") local epr = GetGlobalInt("epr") local epa = GetGlobalInt("epa") local epw = GetGlobalInt("epw") local eph = GetGlobalInt("eph") local epl = GetGlobalInt("epl") --render.DrawWireframeBox( epp + Vector(0,0,epa), Angle(0, epr, 0), Vector(-epw/2, -epl/2, -eph/2) , Vector(epw/2, epl/2, eph/2), Color(255,255,0), false ) render.SetMaterial( matZone ) render.DrawBeam( epp + Vector( epw/2, epl/2, epa + eph/2 ), epp + Vector( -epw/2, epl/2, epa + eph/2 ), 4, 0, 0, Color(255,255,255) ) end end hook.Add("PostDrawTranslucentRenderables", "gm_renderscreenspaceeffects", _gm.cFunc.RenderScreenspaceEffects) [/LUA] I tried using drawbeam & switching logic to see if that would fix it, it didn't. Are you sure your code doesn't actually draw through the skybox?[/QUOTE] Print out bIsSkybox and see if it is ever actually true, I could never get it to work for me. (Ended up manually toggling a variable so every 2nd render IsSkybox would be true and that seemed to work ok.)
[QUOTE=wh1t3rabbit;45999606]Print out bIsSkybox and see if it is ever actually true, I could never get it to work for me. (Ended up manually toggling a variable so every 2nd render IsSkybox would be true and that seemed to work ok.)[/QUOTE] bIsSkybox was never true. Manual switching just makes the line flicker for me, I'm not sure what you mean.
[QUOTE=PaellaPablo;46000849]bIsSkybox was never true. Manual switching just makes the line flicker for me, I'm not sure what you mean.[/QUOTE] I did [I]something[/I] like this, I can give it a try when I get home. [lua] local InSkybox = false local function DrawShit() if InSkybox then --Drawing the skybox so we bail out InSkybox = false return end --Draw your normal stuff -- ... -- ... --Toggle skybox variables InSkybox = not InSkybox end hook.Add("PostDrawTranslucentRenderables", "blahblah", DrawShit) [/lua]
is there a good way to center DLabel text relative to DImageButton without specifying the ImageButton as parent since this clips the text with small icons and long text?
You can set the text to align center, then just find the center of the button by width / 2 and height / 2... Alternatively, you could use the non aligned text ( 0,0 is top left of text, if I recall correctly, may be bottom left... ) and surface.GetTextSize( ) after setting the font and put the text that you want to get the size of as an argumwent... Then just use w / 2 and h / 2 and add it to the button position.
-snip-
-snip- Fixed
Did Garry completly remove the source plugins system? I noticed plugin_load is missing and I can't seem to get anything to load through vdfs either... EDIT: already tried running with -insecure and -allowdebug, no go. EDITEDIT: It loads fine in tf2 with -insecure... Garry why the fuck... I .... FUCK. EDITEDITEDIT: Ugg it's disabled on the client/server only. Srcds works just fine. At least it's not fully removed, this just makes it a pita to debug.
[QUOTE=mcd1992;46009859]Did Garry completly remove the source plugins system? I noticed plugin_load is missing and I can't seem to get anything to load through vdfs either... EDIT: already tried running with -insecure and -allowdebug, no go. EDITEDIT: It loads fine in tf2 with -insecure... Garry why the fuck... I .... FUCK. EDITEDITEDIT: Ugg it's disabled on the client/server only. Srcds works just fine. At least it's not fully removed, this just makes it a pita to debug.[/QUOTE] It was removed because people were doing naughty things with it probably.
With an inventory system, I assume the SQL that comes local with gmod is better than a MySQL server? My inventory is a table of all shit, obviously. How do I save a players table to the local SQL server on GMod? Best to have it get the table from using their Community ID. Anyway, so how do I save a table to the local SQL and retrieve it.
This is a very minor thing, but is there a way to return a list of all ammotypes? I badly need such a function right now, and I have not been able to find it.
[QUOTE=ProfCupcake;46012746]This is a very minor thing, but is there a way to return a list of all ammotypes? I badly need such a function right now, and I have not been able to find it.[/QUOTE] I don't know of a function but a ghetto way I can think of doing it is to use weapons.GetList and iterate over all the weapons. The SWEP table should have an primary/secondary ammotype key somewhere in that table. Doubt that will work for the base hl2 weapons though, only lua SWEPs.
Hi, I was wondering what should I do to execute a file while I'm still on the menu.
[QUOTE=_FR_Starfox64;46016166]Hi, I was wondering what should I do to execute a file while I'm still on the menu.[/QUOTE] Like you want to run lua on the main menu correct? If so, there is a easy way with derma. lua/menu/mainmenu.lua In PANEL:Init at the bottom you put your code there.
[IMG]http://i.imgur.com/j4i9Ndl.png[/IMG] probably really simple, but how do i remove that button? tried using list.set on the main table but to no avail google doesn't help
How do I convert a vtf into a png without using render.Capture?
[QUOTE=AnonTakesOver;46012199]With an inventory system, I assume the SQL that comes local with gmod is better than a MySQL server? My inventory is a table of all shit, obviously. How do I save a players table to the local SQL server on GMod? Best to have it get the table from using their Community ID. Anyway, so how do I save a table to the local SQL and retrieve it.[/QUOTE] Either use semicolon seperators, or Convert table to string with [url]http://wiki.garrysmod.com/page/util/TableToJSON[/url] Convert JSON string back to table with [url]http://wiki.garrysmod.com/page/util/JSONToTable[/url]
Is there a way for me to get around the addon limit for dedicated Linux servers. Idk what is going on but anytime I load over a certain amount of ad-dons the server will refuse to load the darkrp modification file. I don't have that many addons loaded. Most of them are simply models in the addons folder like tdm and sickness.
[QUOTE=Giraffen93;46017464][IMG]http://i.imgur.com/j4i9Ndl.png[/IMG] probably really simple, but how do i remove that button? tried using list.set on the main table but to no avail google doesn't help[/QUOTE] You need to remove it before the context menu gets created. [url=https://github.com/garrynewman/garrysmod/blob/4eb9bb19dcfac06007691376ecaf2dbc56efa6b2/garrysmod/gamemodes/sandbox/gamemode/editor_player.lua]editor_player.lua[/url] see also [url=https://github.com/garrynewman/garrysmod/blob/08b9b77c9fcc1d9e11424d653c20c0c3c1a559e2/garrysmod/gamemodes/sandbox/gamemode/spawnmenu/contextmenu.lua]contextmenu.lua[/url]
I absolutely do not understand the net functions. I'm trying to make it so that I can get a player's FOV but GetFOV is clientside so I'm trying to use net functions [code]function SWEP:Deploy() if CLIENT or game.SinglePlayer() then if game.SinglePlayer() then ply = self.Owner else ply = LocalPlayer() end local data = ply:GetFOV() print("Trying to send "..data) net.Start( "GetFOV" ) net.WriteInt( data, 2 ) --net.Broadcast() net.SendToServer() end self:SendWeaponAnim(ACT_VM_DRAW) self:SetNextPrimaryFire(CurTime() + self.Owner:GetViewModel():SequenceDuration()) return true end if SERVER then util.AddNetworkString( "GetFOV" ) --print("REGISTERING GETDATA") function GetData(len,ply) print(len) print(ply:Nick()) local data = net.ReadInt(2) print("Received "..data) end net.Receive( "GetFOV", GetData ) end[/code] [editline]18th September 2014[/editline] I even tried it with SetNW and GetNW and it does not work. [code]Receiving 0 from Console for the variable FOV Giving Burger a weapon_bur_medkit Giving Burger a weapon_cs_he Giving Burger the value 76 for the variable FOV Receiving 0 from Console for the variable FOV Giving Burger a weapon_cs_glock Giving Burger the value 76 for the variable FOV Receiving 0 from Console for the variable FOV Giving Burger a weapon_cs_mp5 Giving Burger the value 76 for the variable FOV [/code] [lua]function SWEP:Initialize() if CLIENT or game.SinglePlayer() then if game.SinglePlayer() then ply = self.Owner else ply = LocalPlayer() end local data = ply:GetFOV() print("Giving " .. ply:Nick() .. " the value " .. data .. " for the variable FOV" ) ply:SetNWInt("FOV",ply:GetFOV()) end if SERVER then local data = self.Owner:GetNWInt("FOV") print("Receiving " .. data .. " from " .. self.Owner:Nick() .. " for the variable FOV" ) end self:SetWeaponHoldType(self.HoldType) util.PrecacheSound(self.Primary.Sound) end[/lua] I'm testing this on a server [editline]18th September 2014[/editline] w/e I just used a con command
[QUOTE=ROFLBURGER;46019017][code] local data = ply:GetFOV() print("Trying to send "..data) net.Start( "GetFOV" ) net.WriteInt( data, 2 ) --net.Broadcast() net.SendToServer() end [/code] [/QUOTE] [code]net.WriteInt(ply:GetFOV(), 2)[/code] should be [code]net.WriteUInt(ply:GetFOV(), 8)[/code] you're sending it as a 2-bit signed int, which only allows values from -2 to 1
What is the best way to block PS Items stacking? So i could attach only 1 hat and stop hatstacking. My current idea, is to holster any other hat item, if an player decide to swap the hat to another, but that got a bit messy, when i add another hat. Edit:// Okay, Coffee in the morning helps a LOT. [lua]function ITEM:OnEquip(ply) if ply.currenthat then ply:PS_HolsterItem(ply.currenthat) end ply.currenthat = "tophat" -- Need to add the filename by hand, since ITEM.ID is returning an error. every. freakin. time... end function ITEM:OnHolster(ply) ply.currenthat = nil end[/lua]
I'm using HTML in a derma panel, basically the url is an image and the panel is the size of the image. Any way to stop this shit from happening? [img]http://puu.sh/bFakH/f76bb3d861.jpg[/img] [QUOTE=Tomelyr;46020367]What is the best way to block PS Items stacking? So i could attach only 1 hat and stop hatstacking. My current idea, is to holster any other hat item, if an player decide to swap the hat to another, but that got a bit messy, when i add another hat. Edit:// Okay, Coffee in the morning helps a LOT. [lua]function ITEM:OnEquip(ply) if ply.currenthat then ply:PS_HolsterItem(ply.currenthat) end ply.currenthat = "tophat" -- Need to add the filename by hand, since ITEM.ID is returning an error. every. freakin. time... end function ITEM:OnHolster(ply) ply.currenthat = nil end[/lua][/QUOTE] You realize you can set in the category how many items people can wear from it right
[QUOTE=NiandraLades;46021307]I'm using HTML in a derma panel, basically the url is an image and the panel is the size of the image. Any way to stop this shit from happening? [img]http://puu.sh/bFakH/f76bb3d861.jpg[/img] You realize you can set in the category how many items people can wear from it right[/QUOTE] You can use urltex [url]https://github.com/CapsAdmin/pac3/blob/master/lua/pac3/core/client/libraries/urltex.lua[/url] it has some kind of hack in it to prevent the scrollbars from showing up
-snip- im dumb
[QUOTE=NiandraLades;46021307] You realize you can set in the category how many items people can wear from it right[/QUOTE] The thing is, i got 8 different kinds of items in one category, to not cluster up the ps tabs, so i needed an external system :)
I made a script that changes the owner of a vehicle in DarkRP which works sortof fine, but the problem is the vehicle limit still thinks the original owner owns every vehicle they spawn, so they eventually hit the vehicles limit, even though they aren't supposed to own any vehicle at that point. So my question is - how can I change the number of vehicles a player owns so they won't hit the vehicles limit without having to increase it to some large number?
What's better; Writing a table directly through net or Converting table to JSON, sending string, rebuilding on other side. The table is a table of tables.
Sorry, you need to Log In to post a reply to this thread.