[QUOTE=meharryp;47884021]Is there a way to get the value from a C++ net.Read function twice? With the ones defined in Lua you can just overwrite the function, but Ithe'm notLua sure the same method appliesapplies.
[editline]5th June 2015[/editline]
What the fuck is happening happebinhapp to my phone keyboard when I press backspacingbackspaci[/QUOTE]
Uh, save the value to a variable and then use it?
I could do that, but then calling net.ReadWhatever again wouldn't work. Trying to make a way to log net messages that come in to the server if that makes any difference.
[QUOTE=meharryp;47884824]I could do that, but then calling net.ReadWhatever again wouldn't work. Trying to make a way to log net messages that come in to the server if that makes any difference.[/QUOTE]
You can't unless you go full hack and use the bitbuf object that net messages are stored in.
Wait, how the hell do you do networking via a module? I could never wrap my head around the way source did it and I was considering just opening my own socket, then I decided to just use lua's net functions out of laziness and the fact that I was managing a lot of stuff with lua anyway.
Curious. Is it possible to hook the same function more than once in the same file?
For instance, let's say FunctionA for the first hook returns at a certain point. FunctionB does as well, but both need to run, so putting it all in one function, when a return occurs, B won't be called if A returns.
[QUOTE=WalkingZombie;47887001]Curious. Is it possible to hook the same function more than once in the same file?
For instance, let's say I want to hook functionA to Think, but I ALSO want to hook functionB to think. They operate at a different speed (SetNextThink or w/e) ... so they can't be done in the same hook.[/QUOTE]
Assuming you are talking about SWEPs - no.
Use manual variable timers.
^ I changed the example situation to returns, rather than NextThink. Honestly for the case in my mind, returns will be the true problem anyway.
[editline]5th June 2015[/editline]
Also it's gamemode.
I'm thinking MAYBE one possibility? Taking each of the original hooks, and having them as separate functions. Then the real HOOK will run those functions, so that ALL of them run...
Yes you can hook onto the same gamemode hooks from the same file.
Make sure that you [highlight]don't[/highlight] return a value ( [b]return[/b] is file, [b]return true[/b] will stop all other hooks from working )
Does anyone have a functioning version of Royal's [url=https://github.com/glua/Royal-Derma-Designer]old derma designer?[/url]
Everything works except it's missing the gtab.lua which breaks the elements
Uh, has anyone had issues with HTML on vgui.create? I honestly can't see why (no code because I apparently deleted it whoops)
[editline]6th June 2015[/editline]
Issue in that the web page is not showing, but appears fine if I change to DPanel
-snip-
Has anybody used render.RenderView to render to a render target texture and use that texture in a 3D2D instance? i cant for the life of me figure out how to set the render target RenderView uses, SetRenderTarget("pp/rt") doesnt make RenderView render to that texture, or am i just doing it completely wrong?
[code]
rt = {}
rt.origin = LocalPlayer():GetPos()+Vector(0,0,100)
rt.angles = Angle(0,0,0)
rt.fov = 90
rt.dopostprocess = false
rt.znear = 0.1
rt.zfar = 500
render.SetRenderTarget(surface.GetTextureID("pp/rt"))
render.RenderView(rt)
[/code]
Lua un-related, so maybe this is the wrong forum? It's about wire Expression 2 code, kindof... I'm wondering if I can use Expression 2 to remove an entity after it's been exhausted of its usefulness, so another entity needs to replace it.
If not E2, I've been searching everywhere and can't find any other way to do this. Is there a way?
If I have this:
local str = "Hey hows it going?"
How could I make it appear on the screen and make it look like its typing by it self. Basically a typing animation which is shown here: [url]http://codepen.io/rusjames/pen/KbuGt/[/url] <--
Anyone have a clue how I could do this?
I have a SENT which has [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/Entity/SetRenderMode"]Entity:SetRenderMode[/URL] (RENDERMODE_TRANSALPHA) and [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/Entity/SetColor"]Entity:SetColor[/URL] (Color(255,255,255,126)) called on it.
However, whenever I set the alpha it does not change until alpha reaches 0, at which point it fully disappears. Anything above 0 results in a completely opaque model.
Help:suicide:
It works fine on map entities, or players, just not SENTs. I took it into sandbox to use the color tool, and the same thing happens.
[B]FIXED: ENT.RenderGroup = RENDERGROUP_BOTH[/B]
How do I get the height of the map? Say I have coordinates (2462,351,477), and I want to spawn right above that, where the map ends, how do I do so?
[QUOTE=RedNinja;47890315]How do I get the height of the map? Say I have coordinates (2462,351,477), and I want to spawn right above that, where the map ends, how do I do so?[/QUOTE]
Do a trace with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/QuickTrace]util.QuickTrace[/url] and use your position as the origin, and set the direction to Vector(0,0,1) for up. Then check the return table for HitPos and see what that is. That will be where the trace hit the top of the map.
-snip-
Quick question. I've always wondered, is it better to have a weapon as weapon_weaponame.lua or weapon_weaonname/shared.lua? Does it make any difference?
Quick question, I got a DListView, how would i find out which line is selected, and get its text?
[QUOTE=Revenge282;47890323]Do a trace with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/QuickTrace]util.QuickTrace[/url] and use your position as the origin, and set the direction to Vector(0,0,1) for up. Then check the return table for HitPos and see what that is. That will be where the trace hit the top of the map.[/QUOTE]
HitPos is now the player's pos...
[QUOTE=RedNinja;47890693]HitPos is now the player's pos...[/QUOTE]
Did you add the player to the filter?
Anyone know what the name of a derma tab is? What I mean is kinda like how tabs work in Google, that vgui. What's the name of it?
[QUOTE=Baron von Hax;47890497]Quick question. I've always wondered, is it better to have a weapon as weapon_weaponame.lua or weapon_weaonname/shared.lua? Does it make any difference?[/QUOTE]
To the game there is no difference. If you're going to only have a shared file then I suggest using name.lua, mostly because it reduces amount of folders and it also gives it a nice title in the text editors (Instead of it saying shared.lua at the top it says like weapon_knife.lua which is far better)
If you're going to separate the files and have init.lua and stuff then you need the folder format.
[editline]6th June 2015[/editline]
[QUOTE=A Fghtr Pilot;47891032]Anyone know what the name of a derma tab is? What I mean is kinda like how tabs work in Google, that vgui. What's the name of it?[/QUOTE]
You're probably looking for this
[IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [url=http://wiki.garrysmod.com/page/Category:DPropertySheet]Category:DPropertySheet[/url]
[editline]6th June 2015[/editline]
[QUOTE=tzahush;47890512]Quick question, I got a DListView, how would i find out which line is selected, and get its text?[/QUOTE]
[code]
local selectedline = listview:GetLine(listview:GetSelectedLine())
print(selectedline:GetValue(columnid))
[/code]
[QUOTE=Invule;47889923]If I have this:
local str = "Hey hows it going?"
How could I make it appear on the screen and make it look like its typing by it self. Basically a typing animation which is shown here: [url]http://codepen.io/rusjames/pen/KbuGt/[/url] <--
Anyone have a clue how I could do this?[/QUOTE]
Found out how I could do it, thanks for the help.
Anyone know what the new equivalent of game.GetEntites() is now?
[QUOTE=A Fghtr Pilot;47895586]Anyone know what the new equivalent of game.GetEntites() is now?[/QUOTE]
I've never heard of that function, but judging by the name, ents.GetAll()?
I think im way to stupid to use string.find.
i got the following string:
models/folder/prop.mdl
but i want to block that. so if string == "path" then return false. simple right?
no. Now people are abusing that with using models/folder/../folder/prop.mdl
and my idea is to look for /../ and block all strings wich include that part.
But i can't wrap my head arround regex or patterns currently.
Edit:// *facepalm* okay, it was easier then i exepted.
[lua] if string.match( string.lower( mdl ) , "/../" ) != nil then[/lua]
Question, anyone know how I could set a player's hands model while they have a certain weapon equipped(in a SWEP code?)
[QUOTE=Tomelyr;47898839]I think im way to stupid to use string.find.
i got the following string:
models/folder/prop.mdl
but i want to block that. so if string == "path" then return false. simple right?
no. Now people are abusing that with using models/folder/../folder/prop.mdl
and my idea is to look for /../ and block all strings wich include that part.
But i can't wrap my head arround regex or patterns currently.
Edit:// *facepalm* okay, it was easier then i exepted.
[lua] if string.match( string.lower( mdl ) , "/../" ) != nil then[/lua][/QUOTE]
\..\
:)
Sorry, you need to Log In to post a reply to this thread.