• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
[QUOTE=FireWolf2525;52795776]In DListView, a scrollbar appears when your list goes taller than the frame/panel it is in. I've managed to hide it from appearing, but now I am having a problem with the right side going wider as if the scrollbar is still appearing and hiding. So I am wondering, is there a a way to make the scrollbar permanently appear or is there a way to disable the scrollbar (I know DListView:DisableScrollbar() is a thing) and keep scrolling with the mouse wheel? If you need anymore information like screenshots or the piece of code for DListView, then just say.[/QUOTE] How are you hiding it?
[QUOTE=MPan1;52795885]How are you hiding it?[/QUOTE] [code] playerlist.VBar.Paint = function() return true end playerlist.VBar.btnUp.Paint = function() return true end playerlist.VBar.btnDown.Paint = function() return true end playerlist.VBar.btnGrip.Paint = function() return true end function playerlist:OnScrollbarAppear() return true end [/code]
Is there anyway to prevent a custom vehicle from using its turbo in reverse? I only want turbo for driving straight. Would it be a lua implementation or vehicle script? I can't find anything on google related to it. By turbo I mean the boost/sprint vehicle script
Not really a problem but more of a rendering question; if a triangle has all the corners at the same position will it take a significant time to render or will it be almost instant?
I am freezing the player whenever he presses +use on an entity, i am trying to unfreeze him with this hook on remove but it doesnt work / [CODE]hook.Add("EntityRemove", "NotInBed", function(ent) if ent == "healbed" then print("works") end end) [/CODE]
[QUOTE=MGFear;52796609]I am freezing the player whenever he presses +use on an entity, i am trying to unfreeze him with this hook on remove but it doesnt work / [CODE]hook.Add("EntityRemove", "NotInBed", function(ent) if ent == "healbed" then print("works") end end) [/CODE][/QUOTE] the hook is EntityRemoved, not EntityRemove
[QUOTE=a-cookie;52796628]the hook is EntityRemoved, not EntityRemove[/QUOTE] Still doesnt work, doesnt even print my message
Remove "ent" from the function ()
[QUOTE=blackwidowman;52796665]Remove "ent" from the function ()[/QUOTE] But isnt that what the hook returns? EDIT: Did and nothing changed
Sorry it should be ent:GetClass() == "healbed" without ent in the functions ()
[QUOTE=blackwidowman;52796804]Sorry it should be ent:GetClass() == "healbed" without ent in the functions ()[/QUOTE] [CODE][ERROR] lua/entities/healbed/init.lua:69: attempt to index global 'ent' (a nil value) 1. fn - lua/entities/healbed/init.lua:69 2. unknown - addons/ulib-v2_63/lua/ulib/shared/hook.lua:109 [/CODE] spits out this error
Just use this :) local function theremover(ent) if ent:GetClass() == "healbed" then print("works") end end hook.Add( "EntityRemoved", "checkforbed", theremover)
Is there a way to force a SENT to not get hit by melee attacks such as crowbar hits or punches, so it just plays a missed animation?
[QUOTE=MPan1;52800507]Is there a way to force a SENT to not get hit by melee attacks such as crowbar hits or punches, so it just plays a missed animation?[/QUOTE] Melee attacks are done by trace, so you could have to make your SENT SOLID_NONE to prevent those from hitting.
[QUOTE=MPan1;52800507]Is there a way to force a SENT to not get hit by melee attacks such as crowbar hits or punches, so it just plays a missed animation?[/QUOTE] All melee weapons use tracers to detect if they hit something, so you would have to give no hitbox to the entity or rewrite util.Traceline (Not sure if you are able to modify it at all to be honest)
I didn't really explain the entity: I was talking about the bullet hole thing I've been working on for a while. It already has no collisions, but the problem is it's placed on walls that do have collisions. I was just wondering if there was a way to pretend the wall behind them wasn't being hit.
[QUOTE=MPan1;52800539]I didn't really explain the entity - I mean the bullet hole entity thing I've been working on for a while. It already has no collisions, but the problem is it's placed on walls that do have collisions. I was just wondering if there was a way to pretend the wall behind them wasn't being hit.[/QUOTE] No. Portal achieves this by doing a change directly in the TraceLine function, but you cannot do the same from the Lua state for engine traces.
[QUOTE=code_gs;52800542]No. Portal achieves this by doing a change directly in the TraceLine function, but you cannot do the same from the Lua state for engine traces.[/QUOTE] I tried to fake it by using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityEmitSound]GM:EntityEmitSound[/url] to suppress the hit sound and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/DoAnimationEvent]GM:DoAnimationEvent[/url] to change the animation. It actually looks pretty convincing, if not for the particle. Is there any way to remove that?
[url]http://wiki.garrysmod.com/page/ENTITY/TestCollision[/url] There's this.
[QUOTE=Robotboy655;52800652][url]http://wiki.garrysmod.com/page/ENTITY/TestCollision[/url] There's this.[/QUOTE] Thanks, I was wondering if something like this existed. This will probably help me with some other issues I wanted to fix. However, I tried this for the wall issue and it appears to have the same problem (the wall behind the entity being hit instead).
How can I get the player from an ENT:Use function? If I try to print out caller it just states "nil" because caller doesnt return the player but an ent, so how do I do it?
[QUOTE=MGFear;52801020]How can I get the player from an ENT:Use function? If I try to print out caller it just states "nil" because caller doesnt return the player but an ent, so how do I do it?[/QUOTE] What do you mean? The player is a type of entity, though it shouldn't print nil if it is. Could you show us your code.
[QUOTE=bigdogmat;52801078]What do you mean? The player is a type of entity, though it shouldn't print nil if it is. Could you show us your code.[/QUOTE] uh all I did was print caller from function ENT:Use(activator, caller)
[QUOTE=MGFear;52801135]uh all I did was print caller from function ENT:Use(activator, caller)[/QUOTE] You sure you're usin it serverside? That should work.
[QUOTE=MGFear;52801135]uh all I did was print caller from function ENT:Use(activator, caller)[/QUOTE] Taken from the Wiki [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/Use]ENT:Use[/url] [CODE] function ENT:Use( activator, caller ) if IsValid( caller ) and caller:IsPlayer() then caller:Kill() end end[/CODE] Give that a go?
[QUOTE=MGFear;52801135]uh all I did was print caller from function ENT:Use(activator, caller)[/QUOTE] You're using this on a scripted entity right?
[QUOTE=bigdogmat;52801173]You're using this on a scripted entity right?[/QUOTE] yeup its a scripted entity
I'm trying to preset a bodygroup value but I don't know where to put this code in the QC file : [CODE]static int BodyGroup_Sights = FindBodygroupByName("sights"); // calculate this value once SetBodygroup( BodyGroup_Sights , 1 ); // laser dot[/CODE] Should I put it inside the $bodygroup box? [CODE]$bodygroup sights { studio "ironsights.smd" studio "laser_dot.smd" blank }[/CODE]
No, that code has to be in the mod you are making the model for. Model-wise, you just have to make you name your bodygroup "sights".
[QUOTE=Codingale;52758259]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.[/QUOTE] [QUOTE=Moat;52758302][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/ParentToHUD]Panel:ParentToHUD[/url][/QUOTE] It didn't work, the panel is still visible with the camera out... Also.... is there a way to remove a weapon that you registered with [url]https://wiki.garrysmod.com/page/weapons/Register[/url] ? P.S. How does one embed the wiki links properly and rate things again I've not used the forums in a long time..
Sorry, you need to Log In to post a reply to this thread.