Author Topic: How can I make things admin only?  (Read 9251 times)

0 Members and 1 Guest are viewing this topic.

Offline NinjaRun09

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
How can I make things admin only?
« 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?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How can I make things admin only?
« Reply #1 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
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline NinjaRun09

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: How can I make things admin only?
« Reply #2 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?

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: How can I make things admin only?
« Reply #3 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.