Hey, i was wondering if its possibnle to make it so that you force people to download addons when they join the server. I added the resorce.addfile lua script but it still didnt work. So I was wondering is it still possible or does it automatically do it and I’m just having it wrong?
You could try uploading all your content to the workshop and using resource.AddWorkshop(“workshopID”)
So what file do i put it in?
Do i make a new lua file in autorun or just put it in the console?
ok well I tried and it didnt do anything…
post your code please.
Are you saying the client isn’t downloading the workshop file?
Its alright, the person I’m creating the server with found out how to fix it.
The part to pay attention to is COMPARE_ADDONS_LIST… It copies just the wsid from the addon to a list ( since serverside engine.GetAddons( ) doesn’t appear to work anymore, it can be done through files in the addon directory, or in a gmname/content/workshop/ dir as done in this )
When a client connects, send the table to them; compare vs engine.GetAddons on the client. Just remove the v.wsid from the table for each in the engine.GetAddons. If the remaining data in the table is not 0, then they don’t have all workshop addons.
You could also catalog a list of all of the resource files the same way and do a file.Exists check for each of them the same way ( although I wouldn’t recommend the table.Insert, I’d recommend storing as table[ filename ] = true; or so, that way you can just, via direct-access, remove them quickly.
I’ll be releasing something similar for the dev-base I released in an upcoming update ( with config to change what gets looked at )…