[lua]IPAddress[1] // behind the table, not in front.[/lua]
[QUOTE=DJlive34;48331472]How do I get the IP of a player and not the port part ?
I made this but I don't know if it works :
[CODE]
local IPAddress = string.Explode(":", ply:IPAddress())
IPAdress = [1]IPAddress
[/CODE][/QUOTE]
[DEL]Why do you have it as "[1]IPAddress"? It should be "IPAddress[1]".[/DEL]
fuck, ninja'd.
[QUOTE=FireArrow133;48331497][DEL]Why do you have it as "[1]IPAddress"? It should be "IPAddress[1]".[/DEL]
fuck, ninja'd.[/QUOTE]
Sorry that's what I did but I messed up with the copy
[QUOTE=DJlive34;48331923]Sorry that's what I did but I messed up with the copy[/QUOTE]
What does it return? This code prints my address
[lua]for k,v in pairs(player.GetAll()) do print(string.Explode(":",v:IPAddress())[1]) end[/lua]
[editline]30th July 2015[/editline]
Oh, I actually came to because I needed to ask a question...
Hi, how does gamemodes group? I've tried to put set "GM.Name" to "Minigames", but while it gets the name it will put itself into its own Minigames catagory.
[QUOTE=Shenesis;48332253]Because it depends on the gamemode's folder name iirc[/QUOTE]
Ah damn, guess I have to find another way to do it.
Is it possible to make a visualiser without the gm_bass module?
Not really - you'd be moving from pure Lua to interfacing with a flash object inside an html control or something.
[QUOTE=Kogitsune;48335276]Not really - you'd be moving from pure Lua to interfacing with a flash object inside an html control or something.[/QUOTE]
What about through using the soundcloud API?
[QUOTE=Lebofly;48335292]What about through using the soundcloud API?[/QUOTE]
That's still uses flash player doesn't it?
[QUOTE=Robotboy655;48335359]That's still uses flash player doesn't it?[/QUOTE]
I think it's JS
Edit: Sorry the API works with JS, Ruby, Python and the website its self does run on flash
[QUOTE=Lebofly;48335270]Is it possible to make a visualiser without the gm_bass module?[/QUOTE]
I made one some time ago, have a look at how it's done. It's poorly coded, however, so apologies for that.
[url]https://gist.github.com/Authorjames/00db5c7f856001ba1a1e[/url]
[media]http://www.youtube.com/watch?v=Xt5beRzHB-k[/media]
[QUOTE=Lebofly;48335385]I think it's JS
Edit: Sorry the API works with JS, Ruby, Python and the website its self does run on flash[/QUOTE]
Yeah, I think you can write a visualizer in JS and then show it through a HTML panel but then again, that's an open HTML panel per each sound.
[editline]31st July 2015[/editline]
[QUOTE=Lebofly;48335270]Is it possible to make a visualiser without the gm_bass module?[/QUOTE]
Also you do know that bass.dll is now included in GMod and you can use it on any client?
[editline]31st July 2015[/editline]
[url]http://wiki.garrysmod.com/page/IGModAudioChannel/FFT[/url]
[QUOTE=Author.;48335388]I made one some time ago, have a look at how it's done. It's poorly coded, however, so apologies for that.
[url]https://gist.github.com/Authorjames/00db5c7f856001ba1a1e[/url]
[media]http://www.youtube.com/watch?v=Xt5beRzHB-k[/media][/QUOTE]
That looks great, thanks! I will look into it
[editline]31st July 2015[/editline]
[QUOTE=Robotboy655;48335529]Yeah, I think you can write a visualizer in JS and then show it through a HTML panel but then again, that's an open HTML panel per each sound.
[editline]31st July 2015[/editline]
Also you do know that bass.dll is now included in GMod and you can use it on any client?
[editline]31st July 2015[/editline]
[url]http://wiki.garrysmod.com/page/IGModAudioChannel/FFT[/url][/QUOTE]
I did not know that, thank you
[IMG]http://i.imgur.com/vTPy2lN.jpg[/IMG]
Any idea how to fix this besides inserting \n after x characters?
Also any idea how I could show images from their URL on 3d2d? Like on this board?
Is there a Lua wrapper for SQL out there to make 1 call and use with SQLite, tmysql4, mysqloo?
Solved: [url]https://github.com/alexgrist/GLua-MySQL-Wrapper[/url]
[QUOTE=RedNinja;48346703][IMG]http://i.imgur.com/vTPy2lN.jpg[/IMG]
Any idea how to fix this besides inserting \n after x characters?
Also any idea how I could show images from their URL on 3d2d? Like on this board?[/QUOTE]
If you want an easy way you could always use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/markup/Parse]markup.Parse[/url] and set the max width to the width of your billboard, and it will automatically do new lines when needed for you.
Does anybody know where i can find a 3D2D vgui base? I'm making a money printer and i'm hoping to add a 3D2D button that allows you to collect the money and i have no idea where to start. Thanks in advance.
[QUOTE=#Sleepy;48348759]Does anybody know where i can find a 3D2D vgui base? I'm making a money printer and i'm hoping to add a 3D2D button that allows you to collect the money and i have no idea where to start. Thanks in advance.[/QUOTE]
[url]https://github.com/HandsomeMatt/3d2d-vgui[/url]
Anyone know why physgunning players seems to be really buggy? the player being picked up jitters around and if they're held near the ground they start being slammed in and out of the ground taking fall damage, don't recall this happening in gm12 but it's happened now in two very different gamemodes (one was nutscript), is there a way to fix this, or a thing that causes it?
[QUOTE=Smt;48350386]Anyone know why physgunning players seems to be really buggy? the player being picked up jitters around and if they're held near the ground they start being slammed in and out of the ground taking fall damage, don't recall this happening in gm12 but it's happened now in two very different gamemodes (one was nutscript), is there a way to fix this, or a thing that causes it?[/QUOTE]
I seem to remember this being normal in the previous version. I'm not sure (like, not sure AT ALL) but I think changing the collision groups solves that.
[QUOTE=Smt;48350386]Anyone know why physgunning players seems to be really buggy? the player being picked up jitters around and if they're held near the ground they start being slammed in and out of the ground taking fall damage, don't recall this happening in gm12 but it's happened now in two very different gamemodes (one was nutscript), is there a way to fix this, or a thing that causes it?[/QUOTE]
I am pretty sure the players keep falling (the physgun just resets the position) and their speed increases to some ridiculous value where they just die immediately when you let them go.
I think the way to solve it is to set the movetype to noclip when you pick the player up (and back to normal when you drop)
Does anyone know of a way to rotate the mouse input by 45 degrees? So that like, if you move the mouse 'up' the crosshair does diagonally.
So I loop through a table and each v is displayed on a new DPanel that is created. Done this many times before - no problem, works fine but I want to add a thing where if you press a button, it removes all those current dpanels and shows only the entries tagged with a certain thing, i.e as v.Category
Could I have some guidelines on how I should do this?
I was thinking having a function like 'OpenMenu(category)' then do OpenMenu(v.Category) when a button is clicked but wasn't sure to go from there, especially since using remove() on a panel that was created in a loop doesn't seem to remove it
Thanks!
I'm trying to bonemerge the gmod_hands entity onto a SWEP, but I haven't any luck so far. Code:
[code]function SWEP:Initialize()
local hands = player.GetByID(1):GetHands()
hands:SetParent( player.GetByID(1):GetViewModel(), -1 )
hands:AddEffects( EF_BONEMERGE )
end
[/code]
player.GetByID(1) Is just for testing, but self.Owner just gave me errors
[editline]2nd August 2015[/editline]
[QUOTE=NiandraLades;48351632]So I loop through a table and each v is displayed on a new DPanel that is created. Done this many times before - no problem, works fine but I want to add a thing where if you press a button, it removes all those current dpanels and shows only the entries tagged with a certain thing, i.e as v.Category
Could I have some guidelines on how I should do this?
I was thinking having a function like 'OpenMenu(category)' then do OpenMenu(v.Category) when a button is clicked but wasn't sure to go from there, especially since using remove() on a panel that was created in a loop doesn't seem to remove it
Thanks![/QUOTE]
Maybe like this?
[lua]for k, v in pairs(tab) --[[replace tab with whatever]] do
if v.Category != "categoryname" then
v:SetVisible( false ) --This might work instead of remove? Or try panel:Close or panel:Hide?
end
end[/lua]
Also IIRC remove destroys the panel completely so you'd have to recreate it(might not be right), I don't see why you couldn't use SetVisible, Hide, or Close. You could also try overriding the OnClose or Remove func to see if it works then? Just a few guesses.
I am trying to make it so that when my class Marine respawn/spawn as that class they will get a loadout and the right class, here is what I got [code]function GM:PlayerSpawn( ply )
local class ( ply )
if ( sb_team_marine1 ) then return end
player_manager.SetPlayerClass( ply, "Marine" )
player_manager.RunClass( ply, "WepLoadout1")
ply:SetTeam( 1 )
local class2 ( ply )
if ( sb_team_marine2 ) then return end
player_manager.SetPlayerClass( ply, "Blue Marine" )
player_manager.RunClass( ply, "WepLoadout3")
ply:SetTeam( 2 )
end
[/code]
what am I doing wrong? [NOTE: I am very new to lua]
[QUOTE=NiandraLades;48351632]So I loop through a table and each v is displayed on a new DPanel that is created. Done this many times before - no problem, works fine but I want to add a thing where if you press a button, it removes all those current dpanels and shows only the entries tagged with a certain thing, i.e as v.Category
Could I have some guidelines on how I should do this?
I was thinking having a function like 'OpenMenu(category)' then do OpenMenu(v.Category) when a button is clicked but wasn't sure to go from there, especially since using remove() on a panel that was created in a loop doesn't seem to remove it
Thanks![/QUOTE]
Personally I would remove the panels and validate the parent panels layout again (assuming you are positioning them with docking). You could instead just fade the items that don't fit the criteria, although that wouldn't work for certain things.
I'm not doing it via docking, but doing local num = 0 then adding one each time it loops and using that to position them all correctly underneath each other
My internet is just shitting the bed atm, but this is basically what I tried and it didn't remove properly:
[code]
for k, v in pairs(tbl) do
local dpanel = vgui.Create("DPanel")
end
if dpanel then
dpanel:Remove()
end
[/code]
I'm gonna assume I'll have to loop through the table again to remove them all? Not sure why that wasn't my first thought, actually
[QUOTE=NiandraLades;48355361]I'm not doing it via docking, but doing local num = 0 then adding one each time it loops and using that to position them all correctly underneath each other
My internet is just shitting the bed atm, but this is basically what I tried and it didn't remove properly:
[code]
for k, v in pairs(tbl) do
local dpanel = vgui.Create("DPanel")
end
if dpanel then
dpanel:Remove()
end
[/code]
I'm gonna assume I'll have to loop through the table again to remove them all? Not sure why that wasn't my first thought, actually[/QUOTE]
[lua]
local Panels = { }
for k, v in pairs(tbl) do
local dpanel = vgui.Create("DPanel")
table.insert( Panels, dpanel )
end
-- When you want to do stuffs
for k,v in pairs( Panels ) do
if v:ShouldNotBeHere( ) then
table.remove( Panels, k )
v:Remove( )
end
end
[/lua]
This is how I would do it. I'm sure there's a better way though.
table.remove()'ing inside a pairs loop breaks pairs iirc?
I hate angles. How would I make [CODE]rocket:SetAngles( self.Owner:EyeAngles() )[/CODE] make the rocket entity go in the opposite direction of EyeAngles?
Sorry, you need to Log In to post a reply to this thread.