[QUOTE=HikkaSurito;52700183]OK, I see a problem in local timer, I've fixed it, but script still not working.
Stop just marking my post with FUNNY and DUMB sections, just help me, i'm realy feel myself stupid...[/QUOTE]
Stop cluttering this thread up when you already have your [URL="https://facepunch.com/showthread.php?t=1578551"]own thread[/URL] for this.
OK,deleting a messages and waiting for answer in my thread, if someone can help me.
Ok,can't delete it.
I've been digging around for the old darkrp f4 menu ( 2.4.3 ). Since I'm unable to find I'm willing to pay good dolla
[url]https://www.gmodstore.com/jobs/view/20441[/url]
I'm not quite sure how to go about disabling the drawing of world models through renderview. Does anyone know what I could possibly use?
I downloaded the prop hunt gamemode (the proper one from the workshop, not the old one) and when i installed the gamemode, i got a lua error in console saying:
Couldn't include file 'sh_init.lua' (File not found) (@gamemodes/prop_hunt/gamemode/cl_init.lua (line 1))
I checked the folder and there is definetley a file called sh_init.lua
This is preventing the gamemode from working at all so any help would be appreciated, thanks
Is there any simple way I could get all the .lua files that will be sent to the client? The only way I can think of are detouring AddCSLuaFile in "includes/init.lua" and using file.Find to get files from "/autorun/" and "/autorun/client/".
[QUOTE=txike;52701500]Is there any simple way I could get all the .lua files that will be sent to the client? The only way I can think of are detouring AddCSLuaFile in "includes/init.lua" and using file.Find to get files from "/autorun/" and "/autorun/client/".[/QUOTE]
That is the only way *in Lua.
[editline]20th September 2017[/editline]
[QUOTE=fluffy40713;52701256]I downloaded the prop hunt gamemode (the proper one from the workshop, not the old one) and when i installed the gamemode, i got a lua error in console saying:
Couldn't include file 'sh_init.lua' (File not found) (@gamemodes/prop_hunt/gamemode/cl_init.lua (line 1))
I checked the folder and there is definetley a file called sh_init.lua
This is preventing the gamemode from working at all so any help would be appreciated, thanks[/QUOTE]
The error says cl_init, not sh_init. Make sure the cl_init has actual code in it, is being AddCSLuaFile'd, and there are no earlier errors in console.
[editline]20th September 2017[/editline]
[QUOTE=FireWolf2525;52701250]I'm not quite sure how to go about disabling the drawing of world models through renderview. Does anyone know what I could possibly use?[/QUOTE]
The hacky fix is to add a RenderOverride function to all weapons and stop drawing before calling RenderView, then remove them.
How I can find a vector normal to the ground where a player is ?
[img]http://image.noelshack.com/fichiers/2017/38/4/1505946339-vec.jpg[/img]
It's easy to find the yellow vector but I'm actually trying to find the red one. One idea that came into my mind is running multiple traces to try to find it. Any better idea ?
Do a TraceLine directly downward and it will provide the HitNormal.
[QUOTE=code_gs;52701851]Do a TraceLine directly downward and it will provide the HitNormal.[/QUOTE]
Oh okay, I thought HitNormal would actually provide the yellow one. Thanks.
[QUOTE=tommy228;52701874]Oh okay, I thought HitNormal would actually provide the yellow one. Thanks.[/QUOTE]
The Normal key provides the normal of your trace from start to end. The HitNormal key provides the normal of the surface hit.
Does anyone know the id/material for the physgun glow is? As I am trying to disable it, and then re-enable it later.
[QUOTE=txike;52701500]Is there any simple way I could get all the .lua files that will be sent to the client? The only way I can think of are detouring AddCSLuaFile in "includes/init.lua" and using file.Find to get files from "/autorun/" and "/autorun/client/".[/QUOTE]
What are you working on?
[QUOTE=txike;52701500]Is there any simple way I could get all the .lua files that will be sent to the client? The only way I can think of are detouring AddCSLuaFile in "includes/init.lua" and using file.Find to get files from "/autorun/" and "/autorun/client/".[/QUOTE]
You can with the stringtables module
[url]https://github.com/glua/gm_stringtable[/url]
Should be "LCL" or something forgot, they're basically all added to one table.
[QUOTE=Kevlon;52705238]You can with the stringtables module
[url]https://github.com/glua/gm_stringtable[/url]
Should be "LCL" or something forgot, they're basically all added to one table.[/QUOTE]
Yeah, and if you're just checking to see what gets sent you can always try using something gay like scripthook (I don't have the link, but I'm sure you can find it). Makes it easy to just inject it/include it and get all the client-sent files.
snip yeah im tired
[QUOTE=blackwidowman;52705617]Might sound stupid but is there a metatable for Jit? I can't find anything about it online
Ie FindMetaTable("Player")?
Thanks[/QUOTE]
Why would you need one? A metatable is only for things like Entity: or Player:, not a library like jit. All jit functions in lua start with
[CODE]jit.[/CODE]
[QUOTE=blackwidowman;52705617]snip yeah im tired[/QUOTE]
Just to add on to what MelonShooter said, metatables are only for objects that have instances and you need a certain set of methods to work across all instances. The jit library is just a set of methods, and thus doesn't need multiple instances.
Having issues with server lag, I've gone through most of my scripts to see if they're causing problems, and even removed them entirely but am still getting spikes from time to time. Here's a typical net_graph pic:
[IMG]http://pantheoncommunity.org/images/0922202732.jpg[/IMG]
The lag is visible at the bottom with the spikes, and alongside is a huge increase in var (up to 30 on a basically empty server, possibly in the 70s populated) when the spikes are occuring.
No idea what could be causing it personally. Server is being ran from a dedicated Windows 2016 server with good hardware.
Rates: Tick and maxcmd/upd rates are 33, mincmd/upd rates are 10, minrate is 5000, maxrate is 0. I've tried changing these around quite a lot with no difference to the spikes.
[QUOTE=Castiel789;52706874]Having issues with server lag, I've gone through most of my scripts to see if they're causing problems, and even removed them entirely but am still getting spikes from time to time. Here's a typical net_graph pic:
[IMG]http://pantheoncommunity.org/images/0922202732.jpg[/IMG]
The lag is visible at the bottom with the spikes, and alongside is a huge increase in var (up to 30 on a basically empty server, possibly in the 70s populated) when the spikes are occuring.
No idea what could be causing it personally. Server is being ran from a dedicated Windows 2016 server with good hardware.
Rates: Tick and maxcmd/upd rates are 33, mincmd/upd rates are 10, minrate is 5000, maxrate is 0. I've tried changing these around quite a lot with no difference to the spikes.[/QUOTE]
[url]https://github.com/oubliette32/DBugR[/url] Should make it easy to identify the addon. I'm assuming you haven't removed every addon though
Could anyone explain how I would have a double click function on a dpanel? I know this exists for dlistview internally but I couldn't figure out how I can do this for a normal dpanel. Would the best way to do this would be to check if the user double clicks then see if it's in the x,y,w,h bounds of the dpanel?
[QUOTE=DahDestroyer;52706934]Could anyone explain how I would have a double click function on a dpanel? I know this exists for dlistview internally but I couldn't figure out how I can do this for a normal dpanel. Would the best way to do this would be to check if the user double clicks then see if it's in the x,y,w,h bounds of the dpanel?[/QUOTE][URL="https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/vgui/dlistview.lua#L398-L407"]
Right here[/URL]. Just set the last click time on the panel and check if it's less than 0.3.
[CODE]
local panel = vgui.Create( "whatever" )
panel.lastClick = 0
// ...
// Put your other code here
function panel:DoClick()
local time = SysTime() - self.lastClick
if time < 0.3 then
print( "Double clicked" )
end
end
[/CODE]
[QUOTE=blackwidowman;52706918][url]https://github.com/oubliette32/DBugR[/url] Should make it easy to identify the addon. I'm assuming you haven't removed every addon though[/QUOTE]
I did a fresh install on sandbox, no scripts at all, and still had the same problems.
The lag spikes usually happen a few at a time, and are exaggerated based on how many players are on. Currently running an Ark server on the same machine as the Gmod, and it's not experiencing any kind of issues
[QUOTE=Castiel789;52707069]I did a fresh install on sandbox, no scripts at all, and still had the same problems.
The lag spikes usually happen a few at a time, and are exaggerated based on how many players are on. Currently running an Ark server on the same machine as the Gmod, and it's not experiencing any kind of issues[/QUOTE]
The ark server could be the problem. It uses tons of disk, large amounts of memory, and tries to use all cores...
[QUOTE=andreblue;52707355]The ark server could be the problem. It uses tons of disk, large amounts of memory, and tries to use all cores...[/QUOTE]
The Gmod server acts the same way whether the Ark server is up or not :p
[QUOTE=MPan1;52707019][URL="https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/vgui/dlistview.lua#L398-L407"]
Right here[/URL]. Just set the last click time on the panel and check if it's less than 0.3.
[CODE]
local panel = vgui.Create( "whatever" )
panel.lastClick = 0
// ...
// Put your other code here
function panel:DoClick()
local time = SysTime() - self.lastClick
if time < 0.3 then
print( "Double clicked" )
end
end
[/CODE][/QUOTE]
I thought the DoClick function wasn't available on DPanels, as it's not a child of it, I'll give it a shot now, thanks!
I don't think is available, you can always use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/PANEL/OnMousePressed]PANEL:OnMousePressed[/url] , it checks if button is 107 (Left click) then it calls DoClick
[QUOTE=gonzalolog;52707541]I don't think is available, you can always use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/PANEL/OnMousePressed]PANEL:OnMousePressed[/url] , it checks if button is 107 (Left click) then it calls DoClick[/QUOTE]
Do not use decimals for the enumerations. You should be using the actual enumeration which is MOUSE_LEFT.
I've made a material for my vgui but for some reason the pixels aren't where they're suppose to be?
This is how they're [url="https://i.imgur.com/tWMwjp6.png"]suppose[/url] to be
And this is [url="https://i.imgur.com/N1dNleM.png"]how they are[/url] in garry's mod
Anyone has any idea what could be causing this? I haven't set any of the material parameters, however I have tried with no luck.
[QUOTE=brianm109;52708893]Do not use decimals for the enumerations. You should be using the actual enumeration which is MOUSE_LEFT.[/QUOTE]
It's a good practice, but let's be honest, api won't ever change, some of us just memorized MOUSE_LEFT as 107, as some other memorized TEXT_ALIGN_CENTER with 1 (I didn't sadly)
Sorry, you need to Log In to post a reply to this thread.