• What do you need help with? V3
    6,419 replies, posted
[QUOTE=TheNerdPest14;39400978]I mean Networked Variables and strictly server-side ones.[/QUOTE] Uhh... Networked but server-side, I don't catch ya'..
I can't make my entity transparent after using it, I've set the rendermode to TRANS_ALPHA and I am doing self:SetColor(Color(255,255,255,255-Clr.a)) where Clr.a starts with 255 on init and is being reduced by 25 each usage
Can't you add Lua to the menu without sv_allowcslua? How does one do this? I'm trying to generate a list of our servers without mods on them.
How can I set the world to not draw?
How would i go about seperating a string of numbers into a Accounting format. Such as 10034 to 10,034 Or 1000000 to 1,000,000
[QUOTE=Science;39404210]How would i go about seperating a string of numbers into a Accounting format. Such as 10034 to 10,034 Or 1000000 to 1,000,000[/QUOTE] Look at how DarkRP does it. It's in client/hud.lua.
[QUOTE=Crap-Head;39404248]Look at how DarkRP does it. It's in client/hud.lua.[/QUOTE] That's the less-efficient version. [lua]num = num || { } function num.Format( str ) str = tostring( str ); local _,_,str,dec = str:find("^(-?%d+)(%.*%d*)$") return str:reverse():gsub("(...)", "%1,"):gsub(",$", ""):reverse()..dec end[/lua]
Thank you very much.
[QUOTE=Drakehawke;39400857]That's what GetMesh returns? [url]http://wiki.garrysmod.com/page/Classes/PhysObj/GetMesh[/url][/QUOTE] No, it only returns the physics collision vertexes (via PhysicsObject). I'd want the mesh itself and its vertexes. Test it like I tested, I got back that result. EDIT: GetMesh doesn't even return a table with UV quads like the WIKI suggests. It's not entirely accurate.
One more question. Lets say i had this table. Table = {} Table["Lol"] = true Table["Test"] = false How would i get the indexing value? Eg. Lol or Test
in what situation?
[QUOTE=EthanTheGreat;39404353]No, it only returns the physics collision vertexes (via PhysicsObject). I'd want the mesh itself and its vertexes. Test it like I tested, I got back that result. EDIT: GetMesh doesn't even return a table with UV quads like the WIKI suggests. It's not entirely accurate.[/QUOTE] Pretty sure there's no way of doing that, what are you doing that would require more than its collision mesh anyway?
[QUOTE]hook.Add("PlayerDeath", "DeathInform", function(vic, wea, kill, player) CustomMsg(vic, "You were killed by "..kill:Nick(), Player:GetRoleString(), Color(255,0,0)) end)[/QUOTE] is this right? I added "player" and "Player:GetRoleString()", this script should tell who killed you, and if he was traitor or innocent.
Change Player for kill. Then it will work.
[QUOTE=Science;39406631]Change Player for kill. Then it will work.[/QUOTE] Ok, going to test it like this [QUOTE]hook.Add("PlayerDeath", "DeathInform", function(vic, wea, kill, kill) CustomMsg(vic, "You were killed by "..kill:Nick(), Player:GetRoleString(), Color(255,0,0)) end)[/QUOTE]
i know i probably did something wrong but how do you make a client run the retry command or the connect ip command if they or the server lag for 10 to 20 seconds i have not thought of anything that works unless i did something wrong in the code below [CODE]if ( CLIENT ) then print("||retry system loaded!||") function didwecrash() -- client auto ran crash checker if (not timer.IsTimer("didwecrash")) then wedidcrashdamit = true timer.Create("didwecrash", 20, 1,function() if (not wedidcrashdamit == nil) and wedidcrashdamit then print("we should be rejoing now") RunConsoleCommand("connect 50.31.65.166:27015") end end) timer.start("didwecrash") end if (not wedidcrashdamit) then timer.stop( "didwecrash" ) timer.Destroy( "didwecrash" ) timer.Create("didwecrash",20,1,function() -- creates a timer that restarts if tr print("we should be rejoing now") RunConsoleCommand("connect 50.31.65.166:27015") end) timer.start("didwecrash") end end hook.Add("Think",didwecrash,wecrashed) local function RecvMyUmsg( data ) wedidcrashdamit = data:ReadBool() end usermessage.Hook( "didwecrash", RecvMyUmsg ); end if ( SERVER ) then function sdidwecrash() if (not timer.IsTimer("sendcrashinfop")) then timer.simple("sendcrashinfop", 10, 0,function() umsg.Start( "didwecrash" ) umsg.Bool( false ) umsg.End() end) end timer.start("sendcrashinfop") end end hook.Add("Think",sdidwecrash,swecrashed)[/CODE] [editline]29th January 2013[/editline] [QUOTE=hellguy;39406676]Ok, going to test it like this[/QUOTE] you should not do this because this can help people ghost in ttt dont tell them who killed them just that they were not rdmed
[QUOTE=nathan736;39406767] you should not do this because this can help people ghost in ttt dont tell them who killed them just that they were not rdmed[/QUOTE] If someone kills you, you will probably suppose he's a traitor, so a "ghoster" would ghost anyway, what really matters for my server administration is to help me and players know who rdmd right away to take action as fast as we can.
How do I add more outputs to an existing trigger_multiple without rewriting the entire thing or editing the map file itself. For example, this trigger, on start touch, already makes a door open and a sound play, but I want it to also run a function.
Hey guys, I've got a problem with tools and singleplayer. Here's my tool's left click function; [lua]function TOOL:LeftClick( trace ) Msg(CLIENT, SERVER, "\n") if (CLIENT) then Msg("hello") self:TransmitSelection() return true end self.LastClick = trace end[/lua] The tool doesn't work. In the console, I only see "falsetrue" printed in server text. Why doesn't this function run on the client when I'm running singleplayer? Also an unanswered question from earlier just in case it was missed, how do I find the holder of a weapon? self.Owner proves unreliable if another person spawned the weapon. Thanks! [editline]30th January 2013[/editline] [QUOTE=Banhfunbags;39409481]How do I add more outputs to an existing trigger_multiple without rewriting the entire thing or editing the map file itself. For example, this trigger, on start touch, already makes a door open and a sound play, but I want it to also run a function.[/QUOTE] Have you tried combining [url=https://developer.valvesoftware.com/wiki/AddOutput]AddOutput[/url] with [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index43b2.html]Entity.Fire[/url]? Only way I can think of, used to do this all the time back in gmod 9 with the ent_fire command :v:
Strange , i cant include the module VON module [lua] Couldn't include file 'includes\modules\von.lua' (File not found) (@gamemodes/clockwork/gamemode/cl_init.lua (line 7)) [/lua] [IMG]http://puu.sh/1URpA[/IMG] But i have it in my modules folder. And no, contacting C16 is not a good idea.
[QUOTE=Matt-;39401584]Uhh... Networked but server-side, I don't catch ya'..[/QUOTE] I mean vars set using Ent:SetVar() and Ent:SetNWVar(), and I need a way to get the Vars not set by code like from another addon.
[QUOTE=ExtReMLapin;39412304]Strange , i cant include the module VON module [lua] Couldn't include file 'includes\modules\von.lua' (File not found) (@gamemodes/clockwork/gamemode/cl_init.lua (line 7)) [/lua] -big picture- But i have it in my modules folder. And no, contacting C16 is not a good idea.[/QUOTE] Try simply doing: init.lua: AddCSLuaFile("includes/modules/glon.lua") include("includes/modules/glon.lua") And cl_init.lua: include("includes/modules/glon.lua") Depends if server, client or both.
[QUOTE=TheNerdPest14;39412617]I mean vars set using Ent:SetVar() and Ent:SetNWVar(), and I need a way to get the Vars not set by code like from another addon.[/QUOTE] Two ways you can do it, first one is using the BuildNetworkedVarsTable() like so: [lua]] lua_run PrintTable(BuildNetworkedVarsTable( )) > PrintTable(BuildNetworkedVarsTable( ))... 0: ttt_haste_end = -1 ttt_voice_drain = false ttt_voice_drain_admin = 0.050000000745058 ServerName = Garry's Mod ttt_detective = true ttt_time_limit_minutes = 75 ttt_rounds_left = 6 ttt_round_end = -1 ttt_locational_voice = false ttt_haste = true ttt_voice_drain_normal = 0.20000000298023 ttt_voice_drain_recharge = 0.050000000745058 ttt_karma = true ttt_highlight_admins = true ttt_idle_limit = 180 Player [1][Handsome Matt]: disguised = false UserGroup = superadmin body_found = false karma = 1000 [/lua] Or the second method involves overwriting SetNWVar before it is used by anything and then keeping track of each variable yourself: [lua] local ENTITY = FindMetaTable("Entity") ENTITY.NWStringVars = {} local oldNWString = ENTITY.SetNWString ENTITY.SetNWString = function(self, key, value) self.NWStringVars[key] = value oldNWString(self, key, value) end -- do this for each function etc.. [/lua] [editline]30th January 2013[/editline] [QUOTE=Crap-Head;39412832]You don't include it like you normally do when its a .lua file.[/QUOTE] [URL="http://glua.me/bin/?path=/lua/includes/init.lua"]Must be why all these modules are included using require().[/URL] [editline]30th January 2013[/editline] [QUOTE=ExtReMLapin;39412304]Strange , i cant include the module VON module[/QUOTE] Make sure the module has been AddCSLuaFiled in the serverside code somewhere, GMod will only mount Lua files that have been AddCSLuaFiled.
I'm trying to figure out how the hell to make a block spawning SWEP, and I can't for the live of me figure out how to "preview" what's going to be spawned, Advanced Duplicator style. Can anybody point me in the right direction?
[QUOTE=Science;39404448]One more question. Lets say i had this table. Table = {} Table["Lol"] = true Table["Test"] = false How would i get the indexing value? Eg. Lol or Test[/QUOTE]Anyone? I could use a hacky function, but there's gotta be a better way?
[QUOTE=Drakehawke;39405004]Pretty sure there's no way of doing that, what are you doing that would require more than its collision mesh anyway?[/QUOTE] I assumed if you can get the vertexes of the mesh, you could get a uv positions of those vertexes. This would be for a in game material editor. I might as well decompile and table the useful data. But I was hoping I could avoid it.
[QUOTE=ExtReMLapin;39412304]Strange , i cant include the module VON module [lua] Couldn't include file 'includes\modules\von.lua' (File not found) (@gamemodes/clockwork/gamemode/cl_init.lua (line 7)) [/lua] [IMG]http://puu.sh/1URpA[/IMG] But i have it in my modules folder. And no, contacting C16 is not a good idea.[/QUOTE] Stop trying to crack Clockwork.
[QUOTE=Science;39413839]Anyone? I could use a hacky function, but there's gotta be a better way?[/QUOTE] [QUOTE=Banana Lord.;39404990]in what situation?[/QUOTE] Did you even read the post directly after yours, we can't help you unless you elaborate.
[QUOTE=Science;39413839]Anyone? I could use a hacky function, but there's gotta be a better way?[/QUOTE] pairs loop?
[QUOTE=Matt-;39413953]Did you even read the post directly after yours, we can't help you unless you elaborate.[/QUOTE]I simply want to return the index value of a table?
Sorry, you need to Log In to post a reply to this thread.