Author Topic: Groups, Props, and Tools  (Read 12233 times)

0 Members and 1 Guest are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Groups, Props, and Tools
« Reply #15 on: May 16, 2007, 04:54:17 PM »
Looks like your ULX or Ulib is broken. They're the ones that handle convars.

But if you want a version without the convar:

Code: [Select]
--Prop Blocker by Golden-Death--


local groups = { "superadmin", "admin" } --These groups here are allowed to spawn anything, defined in gmod/settings/users.txt
local models = { ""} --All or part of model name that is to be banned



local function block_build( ply, mdl )
for _, v in pairs( models ) do
if string.find( mdl, v ) then
    for _,v in ipairs( groups ) do
        if ply:IsUserGroup( v ) then
            return
        end
    end
    ULib.tsay( ply, "Non-admins are not allowed to spawn this prop. ("..mdl..")." )
    return false
end
    end
end


hook.Add( "PlayerSpawnProp", "block_prop", block_build )


Offline Avien

  • Full Member
  • ***
  • Posts: 168
  • Karma: 4
Re: Groups, Props, and Tools
« Reply #16 on: May 16, 2007, 05:40:57 PM »
How can it be broken?  I just installed the new version like last week or whenever it came out.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Groups, Props, and Tools
« Reply #17 on: May 16, 2007, 07:09:59 PM »
Dunno, but it's not seeing 'convar' as part of Ulib.


Offline Avien

  • Full Member
  • ***
  • Posts: 168
  • Karma: 4
Re: Groups, Props, and Tools
« Reply #18 on: May 19, 2007, 10:31:49 AM »
Well i reinstalled the files that contained the command convar, and i still get the error saying that convar is calling a nil value.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Groups, Props, and Tools
« Reply #19 on: May 19, 2007, 11:33:31 AM »
I don't really know what the problem is