Ulysses

General => Developers Corner => Topic started by: NinjaRun09 on June 08, 2013, 06:24:49 PM

Title: How can I make things admin only?
Post by: NinjaRun09 on June 08, 2013, 06:24:49 PM
I am going to add some addons, but I don't want everybody using them. How can I make these sweps/props admin only?
Title: Re: How can I make things admin only?
Post by: JamminR on June 08, 2013, 08:01:24 PM
Will depend on each addon.
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexdd36.html for general lua code. *You'll need to learn a bit of lua to use it. Not overly difficult.

Sweps have a variable at the top of the file (or at least, should) that you enable/disable.*
Code: [Select]
SWEP.AdminSpawnable = true                          // Is the swep spawnable for admin
SWEP.Spawnable = false                               //  Can everybody spawn this swep ? - If you want only admin keep this false and adminsapwnable true.

* = At least, up until Gmod12 they did...I have no idea if it changed in Gmod 13
Title: Re: How can I make things admin only?
Post by: NinjaRun09 on June 10, 2013, 11:48:31 AM
Will depend on each addon.
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexdd36.html for general lua code. *You'll need to learn a bit of lua to use it. Not overly difficult.

Sweps have a variable at the top of the file (or at least, should) that you enable/disable.*
Code: [Select]
SWEP.AdminSpawnable = true                          // Is the swep spawnable for admin
SWEP.Spawnable = false                               //  Can everybody spawn this swep ? - If you want only admin keep this false and adminsapwnable true.

* = At least, up until Gmod12 they did...I have no idea if it changed in Gmod 13
So what should I use to edit the workshop files?  Notepad++ good?
Title: Re: How can I make things admin only?
Post by: MrPresident on June 10, 2013, 12:00:30 PM
You can't edit workshop files without extracting them from their compressed format. If you do that you will no longer be able to update it with workshop.