General > Developers Corner
How can I make things admin only?
(1/1)
NinjaRun09:
I am going to add some addons, but I don't want everybody using them. How can I make these sweps/props admin only?
JamminR:
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: ---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.
--- End code ---
* = At least, up until Gmod12 they did...I have no idea if it changed in Gmod 13
NinjaRun09:
--- Quote from: 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: ---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.
--- End code ---
* = At least, up until Gmod12 they did...I have no idea if it changed in Gmod 13
--- End quote ---
So what should I use to edit the workshop files? Notepad++ good?
MrPresident:
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.
Navigation
[0] Message Index
Go to full version