Create a check for content pack


I’m trying to make like a check if people actually have my content pack installed, otherwise, I want them to see a wiremod-like message that shows “You did not install our content pack” in the middle of the screen. Unable to remove untill you installed the content pack.
May be a little annoying, but works better than the usual fast-download things. People might earlier want to join because they don’t see the amount of downloads ingame.

The reason why I want this is that people consantly leave my server after they see the amount of downloads it takes to actually play. This is because we have Sickness models, and currently we’re moving to TDMCars, even worse.
This could be used for more people than just me, so don’t think of it like I’m asking you to write me a private code. It seems pretty useful to me.

obviously you will need to have the content on the server to begin with, and also for this to work.

on the server get a full list of all the content you want the client to have and sent that list to the client.

on the client, compare the listed content to the content that they have.

if the client is missing even 1 of the listed content items they dont have your content pack (or atleast all of it)

I meant more like: Make sure there’s a .txt file in a certain folder. If it’s missing, you’ll get a big message saying “YOU ARE MISSING OUR CONTENT PACK”, if you have it, it will dissapear.

right i dont know why i didnt think of that XD

you can check it with

if (file.Exists(“blah.txt”)) then
// we have the content :smiley:
// ok we dont :frowning:

that will need to go on the client and its probably a good idea to sent a response to the server and let the server handle it.

also in garrysmod 13 you will get errors so file.Exist(file) will turn into file.Exists(file, “DATA”) and it will look in the data file :smiley: and “GAME” will look in root

Just to be sure:
Can I put this file into an addon, and if it exists, how would I check it? Would I check it like:
file.Exists(“blah.txt”) or file.Exists("/addons/content_pack_cbc/blah.txt") or something very different like do I hav to put it into a model folder for it to work properly?

This for your shitty DarkRP community?

(User was banned for this post ("Flaming" - Ninja101))

file.Exists( “addons/mycontent/sometextfile.txt”, true )
The bool at the end means you want to start at the base garrysmod folder, not the data folder.

I’ll try to get this to work.