Removing restrictions

Hello,
I want to ask about some possibility of removing restrictions on entities, weapons, etc. . I want to remove it only on some things. URS is just for restricting right?

Any ideas/solutions?

Make it a non-admin weapon.

How?

SWEP.AdminSpawnable
SWEP.Spawnable

If you still don’t understand and don’t code in lua at all, I’ll help you a bit more, just make sure to follow these steps.

  1. Go into the server’s files or your addon file

  2. Open the folder the addon is contained in (If it’s a .gma file, download this and follow the steps to extract the .gma file, then use the folder)

  3. Find the shared.lua file for what you want to change (if it’s a weapon, look in ‘addon_name’/lua/weapons/‘weapon name’, for entities, go to ‘addon_name’/lua/entities/‘entity name’)

  4. Open the .lua file with notepad, if you already have something setup to use .lua files, then use that. If you plan on coding in lua later, I would recommend getting something like jedit, notepad++, or Scite. Do NOT use Wordpad, Microsoft Word, or any other text editors that have interesting options, like changing the font style.

  5. In the file, you should eventually find something that says SWEP.Spawnable and SWEP.AdminSpawnable or ENT.Spawnable and ENT.AdminSpawnable

  6. Changing AdminSpawnable will change if admins can spawn it, changing spawnable will change if members can spawn it.

Here is some code I got from http://www.garrysmod.org from meharryp’s plasma gun, find in the page for SWEP.Spawnable


--[[
-------------------------------------------------------------
Hey! You're looking at my weapon code!
-------------------------------------------------------------
If you using this to learn, that's great, thanks for choosing
my code to learn from, however, if you do take parts from this
addon, please make sure to credit me in your addon, as I spent
a good amount of time on this.

I may comment this later.
]]--

if SERVER then

	AddCSLuaFile()
	
end

// Models are rendering using the SWEP constructer, the code for that is further down.

SWEP.VElements = {
	["gun_main"] = { type = "Model", model = "models/spacemarine/weapons/plasma_gun.mdl", bone = "v_weapon.AK47_Parent", rel = "", pos = Vector(0.518, 3.635, 5.714), angle = Angle(0, 180, 0), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}

SWEP.WElements = {
	["gun_main"] = { type = "Model", model = "models/spacemarine/weapons/plasma_gun.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(8.831, 1.557, -5.715), angle = Angle(180, 87.662, 78.311), size = Vector(1.014, 1.014, 1.014), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}

SWEP.Weight			= 50
SWEP.AutoSwitchTo		= true
SWEP.AutoSwitchFrom		= false
SWEP.HoldType = "rpg"

SWEP.PrintName = "Plasma Gun"
SWEP.Author = "meharryp"
SWEP.Slot = 4
SWEP.SlotPos = 99

SWEP.ViewModelFOV = 55
SWEP.ViewModelFlip = true
SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl"
SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl"
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false
SWEP.ViewModelBoneMods = {
	["v_weapon.AK47_Parent"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) }
}

SWEP.CSMuzzleFlashes		= true

SWEP.IconLetter			= "2"

SWEP.Spawnable				= true
SWEP.AdminSpawnable			= true

SWEP.Category = "Plasma Guns"

SWEP.Instructions = "Aim away from face."
SWEP.Purpose = "Plowing down large areas of people."
SWEP.DrawCrosshair = true

SWEP.Primary.ClipSize = -1
SWEP.Primary.Damage = 0
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "AR2AltFire"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip		= -1
SWEP.Secondary.Damage		=  0
SWEP.Secondary.Automatic		= false
SWEP.Secondary.Ammo			= "xbowbolt"

[editline]3rd April 2015[/editline]

What I mean when I said “server’s files or your addon file” was server’s addon folder or you addon folder.

Thank you very much, first answer which helped me… :wink: