• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
So is there some universal way to get a list of all the models and materials/textures that a client is missing?
[QUOTE=maurits150;52755535]So is there some universal way to get a list of all the models and materials/textures that a client is missing?[/QUOTE] A file.Find for all models/textures you want to check is the best you're going to get. The engine doesn't store a list of missing assets.
[QUOTE=maurits150;52755535]So is there some universal way to get a list of all the models and materials/textures that a client is missing?[/QUOTE] For all of them, code_gs probably has the only method, for only a few, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/IMaterial/IsError]IMaterial:IsError[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ITexture/IsError]ITexture:IsError[/url].
[QUOTE=MPan1;52754948]I'm still stuck on an annoying stencil problem. My brain won't let me understand how stencils work. :snip:[/QUOTE] You're issue is the order you're drawing the circles [code] render.ClearStencil() render.SetStencilEnable(true) render.SetStencilWriteMask(255) render.SetStencilTestMask(255) render.SetStencilFailOperation(STENCIL_KEEP) render.SetStencilZFailOperation(STENCIL_KEEP) render.SetStencilPassOperation(STENCIL_INCR) render.SetStencilCompareFunction(STENCIL_ALWAYS) surface.SetDrawColor(0, 0, 0, 255) DrawCircle(75, 75, 50, 10) render.SetStencilReferenceValue(1) render.SetStencilCompareFunction(STENCIL_EQUAL) surface.SetDrawColor(255, 255, 255, 255) DrawCircle(100, 100, 30, 10) render.SetStencilEnable(false) [/code]
[QUOTE=bigdogmat;52755665]You're issue is the order you're drawing the circles [code] render.ClearStencil() render.SetStencilEnable(true) render.SetStencilWriteMask(255) render.SetStencilTestMask(255) render.SetStencilFailOperation(STENCIL_KEEP) render.SetStencilZFailOperation(STENCIL_KEEP) render.SetStencilPassOperation(STENCIL_INCR) render.SetStencilCompareFunction(STENCIL_ALWAYS) surface.SetDrawColor(0, 0, 0, 255) DrawCircle(75, 75, 50, 10) render.SetStencilReferenceValue(1) render.SetStencilCompareFunction(STENCIL_EQUAL) surface.SetDrawColor(255, 255, 255, 255) DrawCircle(100, 100, 30, 10) render.SetStencilEnable(false) [/code][/QUOTE] Thanks for this, but is there a way to avoid using STENCIL_EQUAL? I forgot to say this in my original post, but I'm using that later because I need to draw something in the white part only. The white part is meant to represent the stencil of whatever I'm drawing in there, E.G. [t]https://i.imgur.com/qO3wLGr.png[/t] This may require two stencils, but I was hoping I could do some kind of cutout of the inverted black part with a single stencil. Sorry if this makes no sense, I don't even know if it's possible.
Does anyone know how to get a table containing [B]all[/B] of a player's reserve ammo for every ammo type they hold? Keys would be ammo ids/names, and values would be how much of that specifc ammo type they have.
[QUOTE=Threebow;52755882]Does anyone know how to get a table containing [B]all[/B] of a player's reserve ammo for every ammo type they hold? Keys would be ammo ids/names, and values would be how much of that specifc ammo type they have.[/QUOTE] I don't think there's a way to get all of the registered ammo types without detouring game.AddAmmoType (but even then the built in ammo types wouldn't be listed as they are probably called before you detour it) CW/FAS2 have functions to register the ammo types and a table you can call I believe to get them (as for M9K; I don't know) So to answer your question there isn't a way of just grabbing it straight from a function, you'd have to loop through all the ammo types and insert them into a table. [HR][/HR] [IMG]https://i.imgur.com/OaxcYsQ.png[/IMG] Does anyone have any experience with SpawnIcons -- Particularly with models with crappy view models? Is it possible to zoom in on them?
[QUOTE=DahDestroyer;52756039]I don't think there's a way to get all of the registered ammo types without detouring game.AddAmmoType (but even then the built in ammo types wouldn't be listed as they are probably called before you detour it) CW/FAS2 have functions to register the ammo types and a table you can call I believe to get them (as for M9K; I don't know) So to answer your question there isn't a way of just grabbing it straight from a function, you'd have to loop through all the ammo types and insert them into a table.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/game/BuildAmmoTypes]game.BuildAmmoTypes[/url] maybe?
[QUOTE=txike;52756071][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/game/BuildAmmoTypes]game.BuildAmmoTypes[/url] maybe?[/QUOTE] I think I'll have to settle for this, despite it saying usage is not recommended.
Anyone have an idea what would cause this:[IMG]https://cdn.discordapp.com/attachments/360084770157494273/366298201613139978/rp_EvoCity2_v5p0019.jpg[/IMG] Player was reported to be phys gunning cars(Should be impossible with the current permissions) Staff tried uncloaking with ulx and also changing his job(He was citizen) This was before he tried to crash the server by spamming props. Staff think its a possibly hacker but I think its unlikely as we have an anti cheat but of course it won't get them all but for a lua hack to make a player invisible and give them the ability to physgun cars? Anyone ever seen anything like this?
[QUOTE=blackwidowman;52756524]:snip: long ass shit. next time use [NOPARSE][QUOTE][/NOPARSE] for the img plz. Or [T][/QUOTE] I don't really see anyone gaining such permissions from nowhere other than having them being a hidden admin or someone that has access to a backdoor on the server.
[QUOTE=blackwidowman;52756524]apple[/QUOTE] I know DarkRP default sets sv_allowcslua to 1 so you could see if that is the problem (I am presuming you are using DarkRP. If you are not, you can still check it anyway). If you are not sure what sv_allowcslua is, it is basically a command which allows players to run clientsided scripts, but, some addons have backdoors which allow you to do things like presented in the image.
[QUOTE=blackwidowman;52756524]Anyone have an idea what would cause this:[IMG]https://cdn.discordapp.com/attachments/360084770157494273/366298201613139978/rp_EvoCity2_v5p0019.jpg[/IMG] Player was reported to be phys gunning cars(Should be impossible with the current permissions) Staff tried uncloaking with ulx and also changing his job(He was citizen) This was before he tried to crash the server by spamming props. Staff think its a possibly hacker but I think its unlikely as we have an anti cheat but of course it won't get them all but for a lua hack to make a player invisible and give them the ability to physgun cars? Anyone ever seen anything like this?[/QUOTE] One of the following: - Your staff gave him permissions - Bad addon (Backdoored) - Wiremod/E2
[QUOTE=DahDestroyer;52757084]One of the following: - Your staff gave him permissions - Bad addon (Backdoored) - Wiremod/E2[/QUOTE] No staff did I checked logs No E2 All addons are either made by me(usually very secure ones) or purchased legit sv_allowcslua = 0
[QUOTE=DahDestroyer;52756039]Does anyone have any experience with SpawnIcons -- Particularly with models with crappy view models? Is it possible to zoom in on them?[/QUOTE] They seem to be just static images as far as I can tell. You can change the camera in a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Category:DModelPanel]DModelPanel[/url], if that suits your needs. Or maybe try finding a cheaty way to stretch the images.
Thanks for the help with my previous question. Unrelated, but is there any way to unload a rendertarget once it has been created with GetRenderTarget(...)? They just seems to consume memory indefinitely when I check with +mat_texture_list.
For some reason, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/draw/DrawText]draw.DrawText[/url] doesn't seem to be working for me with some [img]http://wiki.garrysmod.com/favicon.ico[/img] [URL="https://wiki.garrysmod.com/page/Default_Fonts"]default fonts[/URL]. I tried setting the size of the panel that I'm painting it in to be larger than needed, as well as disabling clipping during paint, but still no dice. Code: [code]PANEL = {} PANEL.COL = Color(0,0,0,255) PANEL.Text = "" PANEL.Font = "Default" PANEL.Paint = function(self,w,h) local x,y = self:GetPos() DisableClipping(true) draw.DrawText(self.Text, self.Font, x, y, self.COL) DisableClipping(false) end vgui.Register("MyLabel", PANEL, "DPanel")[/code] and [code] local fonts = { "HudHintTextSmall", "HudHintTextLarge", "HudNumbers", "CenterPrintText", "HL2MPTypeDeath" } local a concommand.Add("CHUD_Debug_PrintElements", function(ply, cmd, args, argStr) if a then a:Remove() a=nil return end a = vgui.Create("DPanel") a:SetSize(500,500) a:Center() a:SetBackgroundColor(Color(255,255,255,255)) local b = vgui.Create("CHUD_Label", a) b:Dock(TOP) b.Text = "b" local d = vgui.Create("CHUD_Label", a) d:SetPos(0,25) d:SetSize(500,25) d.Text = "d" d.Font = "DebugFixedSmall" for k,v in pairs(fonts) do local asd = vgui.Create("CHUD_Label", a) asd.Text = v asd.Font = v asd:SetPos(0,k*25+25) asd:SetSize(ScrW(),100) end end)[/code] Not working: -Trebuchet24 -HudNumbers -HudHintTextSmall -HudHintTextLarge -CenterPrintText Are my panels just not big enough or something? All the other fonts listed on the wiki page were fine.
[QUOTE=Ljgoombruh;52757831]For some reason, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/draw/DrawText]draw.DrawText[/url] doesn't seem to be working for me with some [img]http://wiki.garrysmod.com/favicon.ico[/img] [URL="https://wiki.garrysmod.com/page/Default_Fonts"]default fonts[/URL]. I tried setting the size of the panel that I'm painting it in to be larger than needed, as well as disabling clipping during paint, but still no dice.[/QUOTE] Try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/GetText]Panel:GetText[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/GetFont]Panel:GetFont[/url] [editline]8th October 2017[/editline] Wait nevermind sorry [editline]8th October 2017[/editline] [QUOTE=Ljgoombruh;52757831][code]PANEL.Text = ""[/CODE][/QUOTE] Wait, if you have no text, why do you expect it to draw anything? [editline]8th October 2017[/editline] Also, this will not work very well: [CODE] local x,y = self:GetPos() [/CODE] Because the coordinates are already localized to the panel. [editline]8th October 2017[/editline] Also, you could just use a [URL="https://wiki.garrysmod.com/page/Category:DLabel"]DLabel[/URL] [CODE] PANEL = {} PANEL.Color = Color( 0, 0, 0, 255 ) PANEL.Text = "Sample Text" PANEL.Font = "Default" function PANEL:Paint( w, h ) draw.DrawText( self.Text, self.Font, 0, 0, self.Color ) end vgui.Register( "MyLabel", PANEL, "DPanel" ) [/CODE]
-sniper- And today's lesson is: Always make sure your Write's and your Read's match up with each other... :) In next week's episode, we'll be going over server-client relations via usermessages :v:
[QUOTE=MPan1;52757833]Wait, if you have no text, why do you expect it to draw anything?[/QUOTE] The text value is set when I create the panel. That's just the VGUI template. [QUOTE]Also, this will not work very well[/QUOTE] That was just for testing. I found a value that worked and rolled with it. [QUOTE]Also, you could just use a [URL="https://wiki.garrysmod.com/page/Category:DLabel"]DLabel[/URL][/QUOTE] I'm going with a custom VGUI panel because I'm going to be using a bunch of panels with functions I want across all of them that aren't included with DLabel, thus going with a custom option. Also, whenever I use DLabels, I run into spacing problems because I hate doing screen maths.
I can't seem to hide a AvatarImage from a DarkRP HUD properly [CODE] local av local function DrawPlayerAvatar( p ) av = vgui.Create("AvatarImage") av:SetPos(64,ScrH() - 130) av:SetSize(56, 56) av:SetPlayer( p, 64 ) end local function HUDPaint() if av then return else DrawPlayerAvatar( LocalPlayer() ) end end hook.Add("HUDPaint", "DarkRP_Mod_HUDPaint", HUDPaint)[/CODE] I tried putting in a hook.Call for HUDShouldDraw then doing av:Remove but it doesn't seem to remove. I know when the camera is out it returns true, so it should but doesn't work.. (also tried SetVisible and overwriting the Panel:Paint function) Ideas? The HUD is a copy of SleekHUD that's no longer being sold.
is MOUSE_WHEEL_DOWN and MOUSE_WHEEL_UP still broken? I can't detect if they are pressed using Think or buttondown hooks. [code]local myvar = 0 hook.Add("Think", "IncreaseMyVar", function() if input.IsMouseDown(MOUSE_WHEEL_DOWN) then myvar = myvar - 1 print(myvar) elseif input.IsMouseDown(MOUSE_WHEEL_UP) then myvar = myvar + 1 print(myvar) end end)[/code]
Try CreateMove maybe?
[QUOTE=code_gs;52758386]Try CreateMove maybe?[/QUOTE] If you mean like this; [CODE]local myvar = 0 hook.Add("CreateMove", "IncreaseMyVar", function() if input.IsMouseDown(MOUSE_WHEEL_DOWN) then myvar = myvar - 1 print(myvar) elseif input.IsMouseDown(MOUSE_WHEEL_UP) then myvar = myvar + 1 print(myvar) end end)[/CODE] still doesnt work.
Try using input.WasMousePressed instead.
[URL="https://facepunch.com/showthread.php?t=1548067&p=52754948&viewfull=1#post52754948"]Bumping my last question in case anyone here knows stencils[/URL] [editline]8th October 2017[/editline] I probably should've done this on the next page actually
Sorry for bothering, I decided it wasn't a big problem so I would use this thread to ask my quick question: What's the difference between Entity:NetworkVar("Bool", true, "Thing") and Entity:SetNWBool("Thing", true). Why would I got through the hassle to set up the network variables with NetworkVar when I can just use SetNWBool and GetNWBool? Can I change NetworkVar from client since SetNWBool won't work in it?
[QUOTE=Ubre;52758929]Sorry for bothering, I decided it wasn't a big problem so I would use this thread to ask my quick question: What's the difference between Entity:NetworkVar("Bool", true, "Thing") and Entity:SetNWBool("Thing", true). Why would I got through the hassle to set up the network variables with NetworkVar when I can just use SetNWBool and GetNWBool? Can I change NetworkVar from client since SetNWBool won't work in it?[/QUOTE] NetworkVars use DTVars internally. DTVars use numerical indexing, and have a limit of 32 per type (except strings with has 4). They are more efficient in terms of network bandwidth, which is why they are much more common over NWVars. NW2Vars, however, are just as efficient as DTVars and was meant to replace NWVars, but the developer working on them has been inactive.
[QUOTE=code_gs;52758954]NetworkVars use DTVars internally. DTVars use numerical indexing, and have a limit of 32 per type (except strings with has 4). They are more efficient in terms of network bandwidth, which is why they are much more common over NWVars. NW2Vars, however, are just as efficient as DTVars and was meant to replace NWVars, but the developer working on them has been inactive.[/QUOTE] Can I set NetworkVars from client or is it the same as NWVar where you can only set it from the server?
[QUOTE=Ubre;52758972]Can I set NetworkVars from client or is it the same as NWVar where you can only set it from the server?[/QUOTE] Both can be set from the client, but they're just immediately reverted since the server's value takes priority. What you should do is set it shared so the variable is properly predicted. If you have to set a value from just the client, then use the net library.
Sorry, you need to Log In to post a reply to this thread.