Check if client has addon?

How do I check if a client has a specific addon? and how do I make it so that if the client doesn’t have the addon, the server kicks the player with a message telling them to download that addon?

Why do you want your clients to have an addon?

So they don’t complain about errors?

I want to make the content required for my server an addon, it’ll be easy and simple for everyone.

Firstly, kicking new players for not having an addon will make them never join again.

Secondly, you could write a function pair with the net library to ask the client if a variable that is created by the required addon exists, and if not, inform the server.

Why not just send them materials and scripts they need?

I suggest you use engine.GetAddons() on both server and client then send client’s list to the server and compare them to each other :stuck_out_tongue:

Please don’t tell me you don’t know how to set up Fast/Force DL. :stuck_out_tongue:

Here you are good sir;
[lua]
// Client

net.Start(“AddonCheck”);

net.WriteTable(engine.GetAddons());

net.SendToServer();

// Server

net.Receive(“AddonCheck”,function(len,client)

local res = net.ReadTable();
local form,nf;


for k,v in pairs(res) do form[v.wsid] = v.mounted; end

for k,v in pairs(engine.GetAddons()) do;
	if (!form[v.wsid]) then 
		nf = nf .. v.title .. ", ";
	end
end

nf = nf:sub(0,nf:len()-2 > 0 and nf:len()-2 or 0);

if (nf) then client:Ban(0,"U R MISING ALL DESE ADONS!1 : { "..nf.." } DONATE 2 GET UNBAN OR UR GETIN REPORT -_-"); end

end);
[/lua]

I kinda wanted to make sure that my clients had Scars all three addons. I didn’t want them to be downloaded from my FastDL. Thank you all, oubliette especially!