Recent Posts

Pages: 1 [2] 3 4 ... 10
Developers Corner / Re: File.Read/Write help.
« Last post by Manix84 on July 01, 2020, 04:18:14 AM »
So, very kindly, Timmy gave me some help on the Discord server.

The core of my problem is that i'm using a read-write command on the Server in `lua/autorun/shared.lua`, and then attempting to do the same read-write on the client side in `lua/ulx/xgui/settings/discord.lua`. Meaning the latter was read-writing on my own machine, rather than the remote server (I suspect).

The solution is to use https://wiki.facepunch.com/gmod/net.Receive to pass the table from the server side to the client side for modification, which I will be doing later tonight :).
Developers Corner / Force respawn and bring command?
« Last post by Taylorr<3/only.fans on June 30, 2020, 11:53:20 PM »
(Ignore my name it was a joke) So I am pretty new to this coding stuff. I found a lot of custom commands for force respawning a player but can someone please make a ulx command that spawns a player if they are dead and brings them? If a player isn't alive, you can bring them and I don't want players to have to run 2 commands to get a dead player tped to them. I'm looking for a command like !fbring to forcefully bring a player if they are dead. I don't want it to freeze them, just spawn them and bring them. (!fbring player)

Developers Corner / File.Read/Write help.
« Last post by Manix84 on June 30, 2020, 07:28:13 AM »
Hi All,
I'm going to try to describe this as best I can, but I'm aware it's both a complex and unusual problem. Here we go...

Some background, to help explain how I got here... I have a script (https://github.com/manix84/discord_gmod_addon/blob/master/lua/autorun/shared.lua) which stores a Table as JSON, containing {"SteamID":"DiscordID"}. This table drives a bot which Mutes players in Discord when they die in TTT/TTT2/Murder/etc. I've finished the script and I'm relatively happy with it, even if it needs some major cleanup. This is my first GMod addon, and my first time playing with (G)Lua.

Recently I've been trying to add ULX menu support. I successfully managed to add the commands (see: https://imgur.com/Mm17dmY), which gave me something of a boost in confidence, as I've been mostly reading other developers code, and trying to understand it. My next step was to try to introduce a settings menu (similar to how the TTT and Randomat ULX menus work). After some trial and error, I actually managed it, and added a new menu under Settings (see: https://imgur.com/qjtIImn). Again, I was elated, as this was hugely laborious work, reading through other examples, and even the source code for ULX itself.

The issue came when I tried to create a user friendly method for Admin's to add Discord ID's against Steam ID's, in the ULX menu system. What I want to do, is add a list of users who are connected, with the Discord ID listed next to there names (see: https://imgur.com/ZDkKIOU, sorry i scrubbed my ID for reasons). This works so far, when I hard code the ID JSON (EG: {"SteamID":"DiscordID"}). However, inside (https://github.com/manix84/discord_gmod_addon/blob/master/lua/ulx/xgui/settings/discord.lua), when I try to collect the cache of ID's from the file system, I get back Nil. Even when using the exact same util function (see: https://github.com/manix84/discord_gmod_addon/blob/master/lua/utils/connectionTable.lua) from the Shared.lua script. However, if I write to the file first, and then read from it, I can see the JSON, but it doesn't match the JSON in the file on the server.

What seems to be happening is File.Read/Write and ULib.fileRead/fileWrite, when in the XGUI folder, seem to be writing to some kind of Memcache layer. I don't know if this is true or not, as my experience is very small, but the evidence is pointing to that.

Side Note on why I want admins to add the connections manually from the menu: The issue comes from my own experience running a server for after work games, and a lot of these extremely intelligent programmers, don't understand how to type "!discord MyDiscordName" into chat without a lot of hand holding. Night now, I have to manually edit the connections_cache.json file and add the SteamID: DiscordID connections for new team members playing. I wanted to get away from that if I could.

If ANYONE can give me a hand figuring this out, I would be extremely grateful.
-Manix84  :)

TL;DR: I want to read and write a json file on my server. I can't seem to read/write the same file from inside lua/autorun/shared.lua and lua/ulx/xgui/settings/discord.lua. I'm really confused. For a better explanation, read above.
Developers Corner / Re: [HELP] Need to disable specific TEAMIDS from being joinable
« Last post by Regen on June 29, 2020, 12:34:10 PM »
Small update, after making 4 factions on server start; the rest after are damangeable, tried using team.setup to make teams automatically and for some reason didn't do the trick
Developers Corner / [HELP] Need to disable specific TEAMIDS from being joinable
« Last post by Regen on June 29, 2020, 12:31:55 PM »
Hey my server has been having issues where certain npcs like zombies cannot damage people in 1-4 teams ( same issue as this except robotboys fix does not work and breaks half the gamemode https://github.com/Facepunch/garrysmod-issues/issues/1820) my gamemode is basewars, just wondering if there is a way i can set teamids 1-4 to be NONJOINABLE or useable in any form or shape; i've already managed to set the default team to 5 so people without a faction can be damaged but i guess the first 4 factions will not be able to so i was wondering if anyone could help me out here
General Chat & Help and Support / Re: How to remove all but ph_ Maps from Vote List
« Last post by Timmy on June 27, 2020, 11:09:05 AM »
Conversation was continued on Discord: https://discord.com/channels/158022958940553216/599649323885789186/726483191036379206.

Summary here:
  • OP used a gamemode called Prophunt: Enhanced.
  • The gamemode has a built-in map vote system.
  • The gamemode comes with a ULX command ("map_vote") to trigger the map vote, leading OP to think that their vote system can be configured within ULX.
  • Turns out that it does, but needs to enabled by running mv_use_ulx_votemaps 1 from the server console.
Yes they are showing for non-admins when the round is over and people need to vote for a new map.

And yes i have tried adjusting the default game mode to prop_hunt

And i will post a pic of those settings.

Are they showing for non admins?
Have you tried adjusting the gamemode to other than default?
Been long time since ive looked, but imagine admins being able to see maps to vote on non-admins can't.
What settings show in "ulx admin votemaps"?

General Chat & Help and Support / How to remove all but ph_ Maps from Vote List
« Last post by Xelriel on June 27, 2020, 08:05:31 AM »
So i've been searching around the net for days now, And this forum, Im trying to disable any type of map that does not start with ph_ I've tried removing them, Stop them from loading, Remove them from the mapvote list by disabling them in the settings, I can not for the life of me figure this out.

BTW if you can't tell from the screenshots, I have done this but the other maps that are not highlighted in the first screenshot are still showing up in the vote map list that comes up after a round.

Releases / Re: Daily server restarter
« Last post by JamminR on June 24, 2020, 05:48:46 PM »
Well, would you want random players to be able to shutdown or cancel shutdown?
It's for superadmin by default.
Pages: 1 [2] 3 4 ... 10