General > Developers Corner

Prevent players from closing MOTD for a certain amount of time (a la ASSMOD)

<< < (3/3)

RalphORama:

--- Quote from: JamminR on January 21, 2014, 03:27:06 PM ---We strongly urge you and recommend you create your own addon folder.
Placing content in 'our' addons folder will work, but, if you ever have to update just your code, or remove your code, or remove someone elses code you followed the instructions for placing thier code in our addon folder,  you could end up damaging files from our addon.
To make your own addon, you'd need the following (at least for this code)
Remove addons/ulx/lua/ulx/modules/cl/motdmenu.lua
Copy your code to /addons/YOUR_addon_NAME_custom_motd_whatever/lua/ulx/modules/cl/motdmenu.
Create your own /addons/YOUR_addon_NAME_custom_motd_whatever/addon.txt (search gmod wiki or google to find out how, or base off another addon (but I'd still recommend wiki, some people just make stuff up))

Now, when ULX starts up, it will use your code.
When you update ULX, it won't overwrite your motdmenu.lua, it will just replace the missing one, and you can go remove it again.

--- End quote ---
Uh oh.
I'll do that and upload it over the weekend, didn't realize that was an issue!

JamminR:
Addon.txt example file code.
http://wiki.garrysmod.com/page/Addons/create

Shalmendo:
Has the Addon been uploaded anywhere since this thread? I could really use something like this on my own server. Also, thank you for making this!

Decicus:
I created an addon out of it, so you can just drag and down the folder from the archive into the server's "addons" folder.
You might have to go into the file itself (just go into each directory until you hit 'motdmenu.lua') to edit how long the timer is. Default is 14. (Just follow the comments in the file to edit them).

Keep in mind you will still have to delete the default motdmenu.lua from ULx inside "addons/ulx/lua/ulx/modules/cl/motdmenu.lua".

All credit goes to RalphORama for the code, I just put it in the right folders and added an "addon.txt".

Shalmendo:
Would it be possible to modify this code so that the MOTD is only timelocked for specific groups?

On the server I'm administrating we have a 'guest' group which has limited privleges and are forced to use the charple model via URS. I would like to force all guests to view the MOTD for at least 30 seconds, but prevent the close button from being locked for members and others (admins, ops, etc). Unfortunately I'm nowhere near being a coder of any sort so I'm going to have to rely on the generosity and kindness of the community here to get me anywhere close to this kind of goal.

I would greatly appreciate any help that can be provided, even if it's just some advice. Coding isn't really my area unfortunately.

Navigation

[0] Message Index

[*] Previous page

Go to full version