• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
A quick search finds [url]https://scriptfodder.com/scripts/view/15/itemstore-inventory-for-darkrp[/url]. You are best off asking the seller for assistance.
[QUOTE=Castiel789;52031322]Probably not the best place to put it, but I was hoping someone would know so I could get a quick answer. How can I add/remove items from my inventory with itemstore using code? Tried looking at the API but couldn't really understand it[/QUOTE] There's a ducomentation shortcut inside the ItemStore download, which leads to this site [url]https://bitbucket.org/uselessghost/itemstore/wiki/Home[/url] You don't own ItemStore though :/
[QUOTE=Lilyxfce;52025997]Hello. I currently am attempting to write miscellaneous addons for my own garrysmod server. Currently, no matter what, certain addons do not seem to load or work whatsoever. I have a file located in /addons/addon_name/lua/autorun/server/sv_addon.lua in the .lua file at the top I put [code]timer.Create("ello", 5, 0, function() for k, ply in pairs( player.GetAll() ) do ply:ChatPrint( "Hello World" ) end end)[/code] Yet, nothing errors nor does it actually print in my chat. ULX and uLib seem to load just fine, as well as other addons such as the "jihadi bomb." Can anyone explain to me what the possible issue is here? I am running ubuntu 14.04.5 LTS (trusty) via SteamCMD. Thanks! edit: I moved my addon from the "addon" folder and into the "garrysmod/lua/autorun" directory and it is now working. What?[/QUOTE] To the people wondering, and I'm giving an answer in case anyone ever comes across this issue. I installed the addon as root, and the user that controls the server does not have access to read a file intalled by root. lol Though, I'm currently looking at map voting add-ons to install. Is there any good ones you guys know of? KMapVote is broken and I am unsure if Willox's simple still works. Thanks in advance! (I am bad at vgui and would rather not release ugly garbage :( also for TTT)
Excuse my ignorance, but does anyone know if there is any built-in support for horizontal scrolling with DScrollPanels? I checked through the GitHub but I can't really find anything alluding that there's support for it. Visual example of what I mean (the content overflows the panel horizontally) [t]https://i.gyazo.com/25116195f196c271c57ec306ecf053bf.png[/t]
[QUOTE=kpjVideo;52039777]I checked through the GitHub but I can't really find anything alluding that there's support for it[/QUOTE] [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dhorizontalscroller.lua[/url]
I'm making a somewhat crappy isometric view thing (think The Sims (1 or 2 specifically)) and I've gotten the camera and movement down. The problem is you can't see when you go inside a building since the ceiling/roof/floorabove gets in the way. Is there any way to get around this via something like not rendering anything over a certain Z relative to the player?] edit: Slightly more progress, GM:CalcView's clipping planes do a similar thing to what I want.
[QUOTE=TheMrFailz;52042091]I'm making a somewhat crappy isometric view thing (think The Sims (1 or 2 specifically)) and I've gotten the camera and movement down. The problem is you can't see when you go inside a building since the ceiling/roof/floorabove gets in the way. Is there any way to get around this via something like not rendering anything over a certain Z relative to the player?] edit: Slightly more progress, GM:CalcView's clipping planes do a similar thing to what I want.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/PushCustomClipPlane]render.PushCustomClipPlane[/url], which doesn't limit you to planes perpendicular to your view angle
[QUOTE=NeatNit;52042220][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/PushCustomClipPlane]render.PushCustomClipPlane[/url], which doesn't limit you to planes perpendicular to your view angle[/QUOTE] Any idea how I'd apply this to the world? I see how it works on a prop, given that you have it's entity/draw function, but I don't know how to do that on the world. edit: It's looking more and more like i'm going to have to use [sp]shudders[/sp] stencils.
No stencils!!! [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PreRender]GM:PreRender[/url] -> [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/EnableClipping]render.EnableClipping[/url] + [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/PushCustomClipPlane]render.PushCustomClipPlane[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PostRender]GM:PostRender[/url] -> [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/PopCustomClipPlane]render.PopCustomClipPlane[/url] + [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/EnableClipping]render.EnableClipping[/url] (with the return value you got when you called it in PreRender) Untested, it's possible that you'll have to use this in [Pre/Post]Draw[Translucent/Opaque]Renderables instead of just [Pre/Post]Render.
[QUOTE=Crap-Head;52032015]There's a ducomentation shortcut inside the ItemStore download, which leads to this site [url]https://bitbucket.org/uselessghost/itemstore/wiki/Home[/url] You don't own ItemStore though :/[/QUOTE] I'm co-owner of a community in development, in which the other owner has purchased Itemstore. I haven't contacted UselessGhost about it because it's not an issue nor a problem within Itemstore, and (I think) they specifically said that they don't help with things like this, alongside the fact that they only talk to the actual Script owners about problems. Hence why I came here in hopes that somebody would know about this, and could help me, instead of me having to describe the (not problem) to my co-owner, so he could get in contact with UselessGhost. So I'd kinda prefer to not get hit with a low-key leak-usation. EDIT: Back to the problem, like I said I've had a look at the Documentation (API) but couldn't figure out how to work it, the best I've achieved is a 'attempt to call method 'GetInventory' (a nil value)' error when trying to to use ply:GetInventory():GetSlot(1) and printing it.
Anyone happen to know what hook gmod_light is drawn in?
[QUOTE=JamesScott;52048041]Anyone happen to know what hook gmod_light is drawn in?[/QUOTE] No, but you can use my terrible hack of debugging render hooks to find out. See the big code dump at [url]http://wiki.garrysmod.com/page/Talk:Render_Order[/url] and instructions underneath. No warranty etc etc. In most cases, return true in PreDraw* to disable rendering of that hook in the engine.
Is there any efficient way to make a projectile that pierces through NPC's and damages those who are close? Running ents.FindInSphere every 0.1 seconds to apply the damage manually seems to really impact the performance.
[code] @echo off REM Simple script made by me that launches the game, killing any previous instances cls taskkill /f /im srcds.exe start srcds.exe -console -game garrysmod +gamemode darkrp +host_workshop_collection -authkey +map rp_downtown_2017 +maxplayers 1 -tickrate 100 +r_hunkalloclightmaps 0 +sv_lan 1 exit [/code] Trying to make a lan server, but when I run the start.bat it doesn't show up in 'Local Network'. If I run it directly through srcds.exe it works, but srcds doesnt have the same amount of flexibility that I can get in commandline. (Authkey and Workshop ID purposely removed)
How does the scroll wheel work with the physgun? I am trying to make a swep that uses the scrollwheel to rotate a prop when its in placement mode -EDIT- Also how can i correctly get the texture path of a displacement from a trace? HitTexture only returns **displacement**
I have a model with a cam2d3d attached to it, basically i have all the rotation set up, and the x & y axes. Now all I need is to back my surface.DrawRect up on the x axis, I attempted to do this below with a vector but it ended up moving without the model and was becoming displaced unless in a perfect angle. [lua] function ENT:Draw() self:DrawModel(); local position = self:GetPos() + Vector(0, -4, 0); local angle = self:GetAngles(); angle:RotateAroundAxis(self:GetAngles():Right(), 90); angle:RotateAroundAxis(self:GetAngles():Forward(), 90); angle:RotateAroundAxis(self:GetAngles():Up(), 180); cam.Start3D2D(position, angle, 0.1); surface.SetDrawColor(255, 255, 255); surface.DrawRect(-150, -480, 240, 400); draw.SimpleText("Test","Default",5,5,Color(0,0,0),0,0); cam.End3D2D(); end; [/lua] [video=youtube;R8fv0ByElG0]https://www.youtube.com/watch?v=R8fv0ByElG0[/video] Has to do with constants but I have no idea what that means.
[QUOTE=8bitMafia;52056301]-SNIP-[/QUOTE] the position modifier you are using is relative to the world, it will always be at the props position -4y, it is a local vector, we want this translated to world position local position = self:LocalToWorld( Vector(0, -4, 0) ) Now the position modifier is relative to the prop and will be at -4y relative to the prop
[QUOTE=arow1234;52053858]How does the scroll wheel work with the physgun? I am trying to make a swep that uses the scrollwheel to rotate a prop when its in placement mode[/QUOTE] Took me a while to find, use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/CUserCmd/GetMouseWheel]CUserCmd:GetMouseWheel[/url] and then [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/CUserCmd/SetMouseWheel]CUserCmd:SetMouseWheel[/url] to 0. [editline]4th April 2017[/editline] do it in [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/CreateMove]GM:CreateMove[/url] [editline]4th April 2017[/editline] Actually, do it in [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/StartCommand]GM:StartCommand[/url] on the server
[QUOTE=NeatNit;52056482]-snip-[/QUOTE] Is that really how the physgun does it? or is the physgun not even in lua? edit: im working clientside with this, its rendering a csmodel and setting its yaw to a variable inc and dec by mousewheel so i want to try to keep this all within the clientside realm
[QUOTE=arow1234;52056571]Is that really how the physgun does it? or is the physgun not even in lua?[/QUOTE] The physgun is not in Lua, but usercmd is also a struct in the engine with those same methods.
It's not in Lua. However, here is how the camera weapon does something similar: [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/entities/weapons/gmod_camera.lua#L103[/url] Seems like there's a SWEP:Tick hook that makes this even easier. However, be sure to only do your thing serverside, because if you SetMouseWheel (0) clientside the server will never see it. Edit: oh, if what you're doing is clientside then forget everything I said about serverside. I assumed you wanted to move things on the server. It's actually much easier if you do it all clientside.
Not code related but I figured its not worth making a thread about. TDM Cars does not have an ambulance. It has [B]9[/B] police cars and 1 firetruck and 0 ambulances. I'm wondering if theres a suitable (decent quality, not utter shit) ambulance I could use. I looked into Lone Wolf's cars and it would be nice to include but I dont want to bloat the downloads with his addons for a single vehicle.
The curent setup i have now hooking with StartCommand works just fine and gives the result i wanted but when using "cmd:SetMouseWheel( 0 )", it does set the mouse wheel delta to 0 but weapon switching still happens edit: I got the result i was looking for by using HUDShouldDraw and hiding CHudWeaponSelection.
yeah so i have a server right and it's a murder gamemode server. and i don't have any lua to paste because i am using pointshop 2. basically, i have a csgo knife sweps pack with all csgo knives, and it can be bought and put in crates just fine, but the problem is that i can replace the basic murderer knife, and it works, but cannot be thrown and is not a 1 hit kill. and bystanders also get the knife if they buy it, which is a big problem. i have tried reading through all sorts of old threads but nobody has anything that matches my problem and i am stuck. please help me? the first person to give me a a solution that works will receive $5 paypal, i am desperate to make my server work.
I'm using the 3d2d vgui module and when I try to draw it on an entity it just constantly duplicates, does the module only support static movement or am I missing something? [lua] require "3d2dvgui" include("shared.lua"); -- Called when the entity should draw. function ENT:Draw() self:DrawModel(); --cam.Start3D2D(position, angle, 0.1); --surface.SetDrawColor(255, 255, 255, 0); --surface.DrawRect(-150, -480, 240, 400); --cam.End3D2D(); local position = self:LocalToWorld(Vector(-4, 0, 0)) local angle = self:GetAngles(); angle:RotateAroundAxis(self:GetAngles():Right(), 90); angle:RotateAroundAxis(self:GetAngles():Forward(), 90); angle:RotateAroundAxis(self:GetAngles():Up(), 180); local sampleFrame = vgui.Create( "DFrame" ) sampleFrame:SetPos(-150, -480) sampleFrame:SetSize(240, 400) sampleFrame:SetTitle( "Sample 3D2D frame" ) hook.Add("PostDrawOpaqueRenderables", "DrawCombineInterface"..math.random(), function() vgui.Start3D2D(position, angle, 0.1) sampleFrame:Paint3D2D() vgui.End3D2D() end) end; [/lua] [IMG]https://i.gyazo.com/87fed575a4707f163df8670cd2b16742.png[/IMG] [URL="https://github.com/HandsomeMatt/3d2d-vgui/blob/master/samples/basic_frame.lua"]source[/URL] [URL="https://facepunch.com/showthread.php?t=1475595"]similar thread[/URL]
[QUOTE=8bitMafia;52064235]I'm using the 3d2d vgui module and when I try to draw it on an entity it just constantly duplicates, does the module only support static movement or am I missing something? [lua] require "3d2dvgui" include("shared.lua"); -- Called when the entity should draw. function ENT:Draw() self:DrawModel(); --cam.Start3D2D(position, angle, 0.1); --surface.SetDrawColor(255, 255, 255, 0); --surface.DrawRect(-150, -480, 240, 400); --cam.End3D2D(); local position = self:LocalToWorld(Vector(-4, 0, 0)) local angle = self:GetAngles(); angle:RotateAroundAxis(self:GetAngles():Right(), 90); angle:RotateAroundAxis(self:GetAngles():Forward(), 90); angle:RotateAroundAxis(self:GetAngles():Up(), 180); local sampleFrame = vgui.Create( "DFrame" ) sampleFrame:SetPos(-150, -480) sampleFrame:SetSize(240, 400) sampleFrame:SetTitle( "Sample 3D2D frame" ) hook.Add("PostDrawOpaqueRenderables", "DrawCombineInterface"..math.random(), function() vgui.Start3D2D(position, angle, 0.1) sampleFrame:Paint3D2D() vgui.End3D2D() end) end; [/lua] [IMG]https://i.gyazo.com/87fed575a4707f163df8670cd2b16742.png[/IMG] [URL="https://github.com/HandsomeMatt/3d2d-vgui/blob/master/samples/basic_frame.lua"]source[/URL] [URL="https://facepunch.com/showthread.php?t=1475595"]similar thread[/URL][/QUOTE] You're creating a hook in every draw event, you should remove it first.
-snip-
Is there a way I can halt rendering on an entire screen and only have selected pixels actually updated?
[QUOTE=VIoxtar;52070803]Is there a way I can halt rendering on an entire screen and only have selected pixels actually updated?[/QUOTE] Option 1: stencils Option 2: set view port Depends on what you're trying to do. [editline]7th April 2017[/editline] There's also [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/SetScissorRect]render.SetScissorRect[/url] which is like a stencil but easier to work with
Could someone explain to me the difference between [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetSolid]Entity:SetSolid[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/PhysicsInit]Entity:PhysicsInit[/url]? and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetMoveType]Entity:SetMoveType[/url] for that matter.
Sorry, you need to Log In to post a reply to this thread.