[QUOTE=code_gs;51685050]You should not be changing any move data in FinishMove. Use Move.[/QUOTE]
Works perfectly - thanks. I should've done a little bit more reading!
Cant seem to make my team select menu appear in my gamemode. The team_ commands work but the menu gives an error saying:
[code]
[ERROR] gamemodes/surfdm/gamemode/cl_menus.lua:3: attempt to index global 'vgui' (a nil value)
1. unknown - gamemodes/surfdm/gamemode/cl_menus.lua:3
2. unknown - lua/includes/modules/concommand.lua:54 [/code]
Here is the menu code:
[lua] if SERVER then return end
function set_team()
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrW() / 2, ScrH() / 2 )
frame:SetSize( 200, 210 )
frame:SetTitle( "Change Team" )
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 )
team_1:SetSize( 50, 100 )
team_1:SetText( "Team Red" )
team_1.DoClick = function() --Make the player join red team
RunConsoleCommand( "team_red" )
end
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) --
team_2:SetSize( 50, 100 )
team_2:SetText( "Team Blue" )
team_2.DoClick = function() --Make the player join blue team
RunConsoleCommand( "team_blue" )
end
end
concommand.Add( "team_menu", set_team ) [/lua]
[QUOTE=Natahster;51685127]Cant seem to make my team select menu appear in my gamemode. The team_ commands work but the menu gives an error saying:
[code]
[ERROR] gamemodes/surfdm/gamemode/cl_menus.lua:3: attempt to index global 'vgui' (a nil value)
1. unknown - gamemodes/surfdm/gamemode/cl_menus.lua:3
2. unknown - lua/includes/modules/concommand.lua:54 [/code]
Here is the menu code:
[lua] if SERVER then return end
function set_team()
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrW() / 2, ScrH() / 2 )
frame:SetSize( 200, 210 )
frame:SetTitle( "Change Team" )
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 )
team_1:SetSize( 50, 100 )
team_1:SetText( "Team Red" )
team_1.DoClick = function() --Make the player join red team
RunConsoleCommand( "team_red" )
end
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) --
team_2:SetSize( 50, 100 )
team_2:SetText( "Team Blue" )
team_2.DoClick = function() --Make the player join blue team
RunConsoleCommand( "team_blue" )
end
end
concommand.Add( "team_menu", set_team ) [/lua][/QUOTE]
Are you mistakenly detouring vgui? Check if you do any vgui = blala somewhere.
You are running your vgui code on your server, you cant do that because GUI must be and can only be displayed on CLIENT.
[QUOTE=Robotboy655;51685237]You are running your vgui code on your server, you cant do that because GUI must be and can only be displayed on CLIENT.[/QUOTE]
While I agree, he's not running it on a server. He's running it on the client.
The error suggests that he does, even though there's this code:
[code] if SERVER then return end[/code]
If he didn't restart his game/server after he added it, the console command would still be executed serverside.
[QUOTE=FrozenH;51684510]Rude.
Thanks though, just wondered what version of Ubuntu Server would work best with srcds.[/QUOTE]
I can say with 100% certainty that it works with 14.04. Haven't tried 16.04, but there's no reason why it wouldn't work.
My 14.04 desktop installation is a strange 16.04/14.04 hybrid + custom modifications (As I refuse to use SystemD)
My home server uses 16.04 but with similar modifications. As long as your system meets SRCDS's dependencies (which both 14 and 16 do) you'll be fine.
I see some people *cough*ARitz*cough* know their linux, right now im looking into some new servers for my collection and was wondering what specs would be needed for a solid 32-64 player server (my usual players are 50ish)
[QUOTE=StickmanJohn;51687041]I see some people *cough*ARitz*cough* know their linux, right now im looking into some new servers for my collection and was wondering what specs would be needed for a solid 32-64 player server (my usual players are 50ish)[/QUOTE]
iirc SRCDS only uses 2 threads. (one for game stuffs, other for networking) So this means that having more threads/cores isn't gonna do much. Go for which CPU can perform better on single-threaded tasks rather than ones with a billion threads. Also, SRCDS being a 32-bit process can only use about 3.5GB of RAM anyway, so that's also something to consider.
[editline]17th January 2017[/editline]
As for my Linux knowledge, It's basically just plugging shit together in a way that works [I]well[/I] and doesn't make things more difficult in the future. It comes with a will to tinker and experience from said tinkering, really. I'm just using windows RN because steam GMod loads faster on Windows than Linux. When you change levels as much as I do sometimes, it really saves time. I like Linux for everything other than gaming, though :)
[QUOTE=LegoGuy;51687081]iirc SRCDS only uses 2 threads. (one for game stuffs, other for networking) So this means that having more threads/cores isn't gonna do much. Go for which CPU can perform better on single-threaded tasks rather than ones with a billion threads. Also, SRCDS being a 32-bit process can only use about 3.5GB of RAM anyway, so that's also something to consider.
[editline]17th January 2017[/editline]
As for my Linux knowledge, It's basically just plugging shit together in a way that works [I]well[/I] and doesn't make things more difficult in the future. It comes with a will to tinker and experience from said tinkering, really. I'm just using windows RN because steam GMod loads faster on Windows than Linux. When you change levels as much as I do sometimes, it really saves time. I like Linux for everything other than gaming, though :)[/QUOTE]
my dev server is windows thankfully, and i already have 3 or 4 servers and im just looking for a linux vps to host a few more on
[QUOTE=LegoGuy;51687081]iirc SRCDS only uses 2 threads. (one for game stuffs, other for networking) So this means that having more threads/cores isn't gonna do much. Go for which CPU can perform better on single-threaded tasks rather than ones with a billion threads. Also, SRCDS being a 32-bit process can only use about 3.5GB of RAM anyway, so that's also something to consider.
[editline]17th January 2017[/editline]
As for my Linux knowledge, It's basically just plugging shit together in a way that works [I]well[/I] and doesn't make things more difficult in the future. It comes with a will to tinker and experience from said tinkering, really. I'm just using windows RN because steam GMod loads faster on Windows than Linux. When you change levels as much as I do sometimes, it really saves time. I like Linux for everything other than gaming, though :)[/QUOTE]
How? How can you get anything working without SystemD? I've got a Debian Jessie machine I'm running some servers off of and fucking everything depends on systemd, I even took a weekend to try to strip it out, and gave up at the end.
How do I go back? :(
[QUOTE=Apickx;51687454]How? How can you get anything working without SystemD? I've got a Debian Jessie machine I'm running some servers off of and fucking everything depends on systemd, I even took a weekend to try to strip it out, and gave up at the end.
How do I go back? :([/QUOTE]
This is a GMod-related thread so I do not want to de-rail it too much.
I am not sure what you can do with debian. However, on ubuntu 16.04, It's pretty easy to take out SystemD and replace it with upstart (which in my opinion is very superior) and re-install the stuffs to make it more usable, like pm tools, networking tools and such. After that, instruct aptitude to never install SystemD, like, ever. Not a very good solution as canonical abandoned upstart in favor of ShitstimD.
Also, gnome being the little shit as it is, refuses to work properly with the SystemD shim so I myself am not entirely sure how to go about that.
So you're probably better off doing something similar to what I did. Use Ubuntu 14.04 but change some of the repos to be up to date. Also, install the latest version of the Linux kernel from the package manager too.
To be honest, there will be a time where I would rather make my own distro based on debian/ubuntu (to maintain compatibility with popular software) which uses an upstart clone of my design. It'll use QT as it's UI base too because gnome is bad.
Some of my friends suggested that the names of the versions should be various kinds of crackers :P
Alright. Now let's get back on topic. If anyone wants to ask me about my cringe-fest that is how I manage Linux machines, feel free to PM me. :)
I'm having a problem with my hud
this is stupid but i cant find ot how
so i have this file called cl_hud
[code]local Texture222 = Material("icon16/shield.png")
local Texture223 = Material("icon16/heart.png")
local hide = {
CHudHealth = true,
CHudBattery = true
}
hook.Add("HUDShouldDraw", "HideHUD", function(name)
if (hide[name]) then return false end
end)
-- Don't return anything here, it may break other addons that rely on this hook.
function HUDPaint()
local lp = LocalPlayer()
draw.RoundedBox(4, 0, ScrH() / 1.25, ScrW() / 6.1, ScrH() / 4.8, Color(0, 0, 0, 231))
draw.RoundedBox(0, ScrW() / 25.6, ScrH() / 1.14, ScrW() * (math.Clamp(lp:Health(), 0, 100) / 940), ScrH() / 32, Color(191, 0, 0, 255))
draw.RoundedBox(0, ScrW() / 25.6, ScrH() / 1.09, ScrW() * (math.Clamp(lp:Armor(), 0, 100) / 940), ScrH() / 32, Color(0, 98, 191, 255))
surface.SetMaterial(Texture222)
surface.SetDrawColor(Color(255, 255, 255, 225))
surface.DrawTexturedRect(ScrW() / 128, ScrH() / 1.09, ScrW() / 42.67, ScrH() / 32, Color(255, 255, 255, 255))
surface.SetMaterial(Texture223)
surface.SetDrawColor(Color(255, 255, 255, 225))
surface.DrawTexturedRect(ScrW() / 128, ScrH() / 1.14, ScrW() / 42.67, ScrH() / 32, Color(255, 255, 255, 255))
end
hook.Add("HUDPaint", "NameLMAO", HUDPaint)[/code]
then i added init.lua (in my gamemode folder) as this
[code] AddCSLuaFile("cl_hud.lua") [/code]
but it doesnt work
[QUOTE=YoutoYokodera;51688713]I'm having a problem with my hud
this is stupid but i cant find ot how
so i have this file called cl_hud
[code]local Texture222 = Material("icon16/shield.png")
local Texture223 = Material("icon16/heart.png")
local hide = {
CHudHealth = true,
CHudBattery = true
}
hook.Add("HUDShouldDraw", "HideHUD", function(name)
if (hide[name]) then return false end
end)
-- Don't return anything here, it may break other addons that rely on this hook.
function HUDPaint()
local lp = LocalPlayer()
draw.RoundedBox(4, 0, ScrH() / 1.25, ScrW() / 6.1, ScrH() / 4.8, Color(0, 0, 0, 231))
draw.RoundedBox(0, ScrW() / 25.6, ScrH() / 1.14, ScrW() * (math.Clamp(lp:Health(), 0, 100) / 940), ScrH() / 32, Color(191, 0, 0, 255))
draw.RoundedBox(0, ScrW() / 25.6, ScrH() / 1.09, ScrW() * (math.Clamp(lp:Armor(), 0, 100) / 940), ScrH() / 32, Color(0, 98, 191, 255))
surface.SetMaterial(Texture222)
surface.SetDrawColor(Color(255, 255, 255, 225))
surface.DrawTexturedRect(ScrW() / 128, ScrH() / 1.09, ScrW() / 42.67, ScrH() / 32, Color(255, 255, 255, 255))
surface.SetMaterial(Texture223)
surface.SetDrawColor(Color(255, 255, 255, 225))
surface.DrawTexturedRect(ScrW() / 128, ScrH() / 1.14, ScrW() / 42.67, ScrH() / 32, Color(255, 255, 255, 255))
end
hook.Add("HUDPaint", "NameLMAO", HUDPaint)[/code]
then i added init.lua (in my gamemode folder) as this
[code] AddCSLuaFile("cl_hud.lua") [/code]
but it doesnt work[/QUOTE]
is it included in the cl_init.lua file?
[QUOTE=StickmanJohn;51688758]is it included in the cl_init.lua file?[/QUOTE]
Yeah I tried
[Code]include("cl_hud.lua")[/code] too
[QUOTE=YoutoYokodera;51688713]I'm having a problem with my hud
this is stupid but i cant find ot how
so i have this file called cl_hud[/QUOTE]
You must call [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/AddCSLuaFile]AddCSLuaFile[/url] from serverside and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/include]include[/url] from clientside
[code]if SERVER then
AddCSLuaFile("cl_hud.lua")
else
include("cl_hud.lua")
end[/code]
Hi, i'm currently playing Prop Hunt with some friends on my server, but i want to disable the names while aiming a prop. I've been looking for this a while now but i've founded nothing.
Thanks in advance.
PD: Im using Wolvin's Enhanced Prop Hunt.
[editline]18th January 2017[/editline]
[QUOTE=Ropx;51689329]Hi, i'm currently playing Prop Hunt with some friends on my server, but i want to disable the names while aiming a prop. I've been looking for this a while now but i've founded nothing.
Thanks in advance.
PD: Im using Wolvin's Enhanced Prop Hunt.[/QUOTE]
Well, i've managed solving the names but the hit boxes and damage are broken, you need too many shoots to kill a simple can, and blood splashes everywhere. I've changed the function EntityTakeDamage but when you kill a prop, it shows "weapon_(shotgun for example) killed PlayerWhoKilledTheProp".
Here's the code:
[CODE]function EntityTakeDamage(ent, dmginfo)
local att = dmginfo:GetAttacker()
if GAMEMODE:InRound() && ent && ent:IsPlayer() && ent:Alive() && ent:Team() == TEAM_PROPS && ent.ph_prop then
--This next line is/was for debugging
--print("!! " .. ent:Name() .. "'s PLAYER entity appears to have taken damage, we can redirect it to the prop! (Model is: " .. ent.ph_prop:GetModel() .. ")")
ent.ph_prop:TakeDamageInfo(dmginfo)
return
end
if GAMEMODE:InRound() && ent && (ent:GetClass() != "ph_prop" && ent:GetClass() != "func_breakable" && ent:GetClass() != "prop_door_rotating" && ent:GetClass() != "prop_dynamic*") && !ent:IsPlayer() && att && att:IsPlayer() && att:Team() == TEAM_HUNTERS && att:Alive() then
att:SetHealth(att:Health() - HUNTER_FIRE_PENALTY)
if att:Health() <= 0 then
MsgAll(att:Name() .. " felt guilty for hurting so many innocent props and committed suicide\n")
att:Kill()
end
end
end
hook.Add("EntityTakeDamage", "PH_EntityTakeDamage", EntityTakeDamage)[/CODE]
[lua]if victim:LastHitGroup() == HITGROUP_HEAD then
print( "headshot" )
attacker:PS_GivePoints(10)
sound.Play("buttons/blip1.wav", attacker:GetPos())
end
[/lua]
How do I make the sound only play for the attacker?
[QUOTE=Natahster;51689553][lua]if victim:LastHitGroup() == HITGROUP_HEAD then
print( "headshot" )
attacker:PS_GivePoints(10)
sound.Play("buttons/blip1.wav", attacker:GetPos())
end
[/lua]
How do I make the sound only play for the attacker?[/QUOTE]
net message it to the attacker.
Could someone please explain what this error means exactly, or some information at least on what kind of stuff could cause it?
[code]Error - no MetaName string type for userdata (AGH!)
Error - no MetaName string type for userdata (AGH!)[/code]
Thank you
[QUOTE=Natahster;51689553][lua]if victim:LastHitGroup() == HITGROUP_HEAD then
print( "headshot" )
attacker:PS_GivePoints(10)
sound.Play("buttons/blip1.wav", attacker:GetPos())
end
[/lua]
How do I make the sound only play for the attacker?[/QUOTE]
the use surface.PlaySound()
[QUOTE=Revenge282;51689569]net message it to the attacker.[/QUOTE]
Welp now I've seen to encounter a new problem. The sound plays when I kill someone with a hl2 weapon but not css weapons? Any idea what could cause this?
-snip-
[QUOTE=Natahster;51689790]Welp now I've seen to encounter a new problem. The sound plays when I kill someone with a hl2 weapon but not css weapons? Any idea what could cause this?[/QUOTE]
It probably deals damage a non-trace way if that's the case.
I'd like to specify a normal vector for the player, then have their view rotate around this new normal rather than Vector(0, 0, 1)
Similar to what I've forced here, but the way I'm doing it is clumsy
[quote][vid]http://zombine.me/file/2017-01-18_13-44-55.mp4[/vid][/quote]
End goal would be to do something like,
[code]player:SetUpDirection(-vector_up)[/code]
and then the player's view inverts and the player will correctly look around as if the map is upside down.
Which hooks should I be using?
I've so far been doing InputMouseApply, but I'm dividing the x and y values by 55 to slow them down, and really have no idea what I'm doing.
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/CalcView]GM:CalcView[/url] and change the angle?
[QUOTE=MPan1;51691103][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/CalcView]GM:CalcView[/url] and change the angle?[/QUOTE]
currently doing that but the player isn't actually aiming in the correct direction. I'd like them to still be able to physgun/shoot at things from that angle.
using SetEyeAngles inside the calcview hook breaks it.
I'm using InputMouseApply and doing cmd:SetViewAngles, as that does what I want, but since I'm returning true, mouse movement no longer works and I don't know the correct values to manually rotate the view by
My linux srcds is stuck insecure (cake please don't hack me)
I have -secure in the params and it was fine before a few weeks ago. I checked firewalls and everything's fine, so either it can't connect to the steam auth servers or I did something horribly wrong. Any ideas?
[QUOTE=zeaga;51691202]My linux srcds is stuck insecure (cake please don't hack me)
I have -secure in the params and it was fine before a few weeks ago. I checked firewalls and everything's fine, so either it can't connect to the steam auth servers or I did something horribly wrong. Any ideas?[/QUOTE]
You don't need -secure in the command line, I'd just remove that. Iirc though, if it fails to connect to VAC while it's in secure mode it wont start responding to A2S or allow players to join until it does establish that connection on boot.
If it looses the connection during runtime new connections will fail with some error message I think. Can you connect to the server?
[QUOTE=Slowboi;51691279]You don't need -secure in the command line, I'd just remove that. Iirc though, if it fails to connect to VAC while it's in secure mode it wont start responding to A2S or allow players to join until it does establish that connection on boot.
If it looses the connection during runtime new connections will fail with some error message I think. Can you connect to the server?[/QUOTE]
I only put in -secure because it failed.
Anyone can connect and play. SteamIDs only return null IDs and the server is shown to be insecure.
I just found out that when I check status it gives [i]insecure (secure mode enabled, disconnected from Steam3)[/i] [sic] so maybe it is a network error. I'm gonna contact the support team for my VPS provider in a bit.
Sorry, you need to Log In to post a reply to this thread.