• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
-snip-
[QUOTE=Nipah;49657183]I'm not getting any output in my server console. Wiki link [URL="http://wiki.garrysmod.com/page/GM/ShowSpare1"]ShowSpare1[/URL][LUA]if SERVER then hook.Add( "ShowSpare1", "fbkjftgi", function( ply ) print( "A player hit F3 ("..ply:SteamID()..")" ) end) end[/LUA][/QUOTE] Where are you running that?
I totally forgot how to make addons. I've started playing GMod again and would like to start coding GLua again too! Are you even able to add legacy addons anymore, or do they have to be through workshop? How does a simple addon look like? Like, what's the default things needed to make the addon functional?
[QUOTE=addemod;49659482]I totally forgot how to make addons. I've started playing GMod again and would like to start coding GLua again too! Are you even able to add legacy addons anymore, or do they have to be through workshop? How does a simple addon look like? Like, what's the default things needed to make the addon functional?[/QUOTE] [URL]https://wiki.garrysmod.com/page/Beginner_Tutorial_Intro[/URL] Are you even able to add legacy addons anymore, or do they have to be through workshop? yes
[QUOTE=keeperman;49659518][URL]https://wiki.garrysmod.com/page/Beginner_Tutorial_Intro[/URL] Are you even able to add legacy addons anymore, or do they have to be through workshop? yes[/QUOTE] I've read it already but I can't find anything that says anything about legacy addons? Edit: I remember I found this but it didn't help me: [url]https://wiki.garrysmod.com/page/Workshop_Addon_Creation[/url] Maybe I am doing something wrong?
[QUOTE=addemod;49659537]I've read it already but I can't find anything that says anything about legacy addons? Edit: I remember I found this but it didn't help me: [url]https://wiki.garrysmod.com/page/Workshop_Addon_Creation[/url] Maybe I am doing something wrong?[/QUOTE] By legacy addons I guess you mean in the addons folder?
[QUOTE=keeperman;49659570]By legacy addons I guess you mean in the addons folder?[/QUOTE] Yes, I've got it working now though! ty.
Is there anyway to block players from activating a button created by the map?
[QUOTE=TheEmp;49659667]Is there anyway to block players from activating a button created by the map?[/QUOTE] Look at the button and do: lua_run print(player.GetBySteamID("your steamiddd"):GetEyeTrace().Entity:EntIndex()) in RCON and then upon PlayerInitialSpawn use: Entity(the number RCON returned):Remove()
[QUOTE=keeperman;49659570]By legacy addons I guess you mean in the addons folder?[/QUOTE] -snip- :what:
- snip -
[QUOTE=MPan1;49659046]Where are you running that?[/QUOTE]It's in /lua/autorun/
How would I go about making a function that can break the current file processing like Error/error does but does not create an exception like it? I'm trying to make a file loader that when a function to say its a client-side file, the server stops processing the file and proceeds to send it to the client, but I have no idea on how to achieve that.
return
[QUOTE=zerf;49661274]return[/QUOTE] I would call a function and it would need to break the stack of where it was called from, not break out of the function. It's not so simple as it looks.
[QUOTE=GGG KILLER;49661291]I would call a function and it would need to break the stack of where it was called from, not break out of the function. It's not so simple as it looks.[/QUOTE] Wrap it in a [B]do[/B]? Hard to tell if this is what you need. I might not be understanding you correctly. [lua]do print(1) return end print(2)[/lua] Never prints the second one.
[QUOTE=man with hat;49661389]Wrap it in a [B]do[/B]? Hard to tell if this is what you need. I might not be understanding you correctly. [lua]do print(1) return end print(2)[/lua] Never prints the second one.[/QUOTE] It would be something like this: [lua] -- Stack function breakstack () -- Do some dark magic end print ( 1 ) breakstack () print ( 2 ) -- never prints the second one [/lua] [editline]3rd February 2016[/editline] I think I'll just wrap the function returned from CompileFile into a pcall and check the error message and make the stack-breaking function throw an error with an specific message.
[QUOTE=GGG KILLER;49661405]snip [/QUOTE] [lua] function blah() -- blah if weneedtoabort then return true end end print ( 1 ) if blah() then return end print ( 2 ) [/lua] [editline]2nd February 2016[/editline] [QUOTE=GGG KILLER;49661405] [editline]3rd February 2016[/editline] I think I'll just wrap the function returned from CompileFile into a pcall and check the error message and make the stack-breaking function throw an error with an specific message.[/QUOTE] please dont
[QUOTE=zerf;49661479][lua] function blah() if weneedtoabort then return true end end print ( 1 ) if blah() then return end print ( 2 ) [/lua][/QUOTE] But I would need to identify that the stack was broken because that the file is meant to be loaded in the client, simple ending the execution wouldn't be enough to know that. (And for style matters I want to only call the function, not add an if in the middle of the code) [editline]3rd February 2016[/editline] [QUOTE=zerf;49661479] [editline]2nd February 2016[/editline] please dont[/QUOTE] why not?
I'm getting this error everytime I open scoreboard for TTT, it doesn't happen all the time. But it's annoying when the scoreboard just remains in the middle of your screen all weird. Spamming this code in the console [lua][ERROR] gamemodes/terrortown/gamemode/vgui/sb_row.lua:122: attempt to index global 'sboard_panel' (a nil value) 1. unknown - gamemodes/terrortown/gamemode/vgui/sb_row.lua:122[/lua]
[QUOTE=ExternalGamer;49661525]I'm getting this error everytime I open scoreboard for TTT, it doesn't happen all the time. But it's annoying when the scoreboard just remains in the middle of your screen all weird. Spamming this code in the console [lua][ERROR] gamemodes/terrortown/gamemode/vgui/sb_row.lua:122: attempt to index global 'sboard_panel' (a nil value) 1. unknown - gamemodes/terrortown/gamemode/vgui/sb_row.lua:122[/lua][/QUOTE] Code? Modifications you did? Any info at all? [editline]3rd February 2016[/editline] Ok, modifications were surely made as [url=https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/vgui/sb_row.lua#L122]line 122[/url] has no code that includes 'sboard_panel'
[QUOTE=GGG KILLER;49661490]But I would need to identify that the stack was broken because that the file is meant to be loaded in the client, simple ending the execution wouldn't be enough to know that. (And for style matters I want to only call the function, not add an if in the middle of the code) [editline]3rd February 2016[/editline] why not?[/QUOTE] It's so unnecessary and such a hacky way to do what can be accomplished in a single if statement. Don't try to make the language something that it isn't.
[QUOTE=man with hat;49661554]It's so unnecessary and such a hacky way to do what can be accomplished in a single if statement. Don't try to make the language something that it isn't.[/QUOTE] But I want that for style reasons, and it would be more code to remember than only remembering a function name. I'm not trying to turn the language into something it isn't, i'm simply adding a missing functionality that I feel that is necessary for my code to work better and be easier for me to understand (and to modify as I'm implementing this in an library-like addon. Also, your solution still doesn't solves the problem that I wouldn't know whether the end of the script was reached or if it was aborted prematurely).
- nop -
snip
[QUOTE=Giraffen93;49656148]the client doesn't load/init the other players until you get in their pvs onentitycreated is a really useful hook[/QUOTE] I'm a noob to Lua, what exactly does this mean...?
[QUOTE=Windwhistle;49661919]I'm a noob to Lua, what exactly does this mean...?[/QUOTE] That answer was intended for me, what it means is that the entities (players) on the map don't load unless you're in their PVS. Being in someone's PVS pretty much means that they are close enough/being looked at so they are loaded. That means that John will load because he is staring you in the face but Mike won't because he is hiding across the map. OnEntityCreated is called whenever an entity (like a player) is created.
[QUOTE=YourStalker;49661996]That answer was intended for me, what it means is that the entities (players) on the map don't load unless you're in their PVS. Being in someone's PVS pretty much means that they are close enough/being looked at so they are loaded. That means that John will load because he is staring you in the face but Mike won't because he is hiding across the map. OnEntityCreated is called whenever an entity (like a player) is created.[/QUOTE] o
Can you use fonts in Workshop addons (as in when a client downloads the addon, the fonts actually work)? I remember reading somewhere they were disabled or something like that... also, to get them to work, do you only need to put the font in the 'resources' folder of your addon and add a resource.AddFile with a path to the font, or is there something else I missed?
Is it possible to add working line break in a DListView? [IMG]https://gyazo.com/ada4fd3047eac012be4e2e6089134b2f.png[/IMG] As you [URL="https://gyazo.com/ada4fd3047eac012be4e2e6089134b2f.png"]can see[/URL] the line break is not working as I thought it would.
Sorry, you need to Log In to post a reply to this thread.