General > Developers Corner

Groups, Props, and Tools

<< < (4/4)

Golden-Death:
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: -----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 )

--- End code ---

Avien:
How can it be broken?  I just installed the new version like last week or whenever it came out.

Golden-Death:
Dunno, but it's not seeing 'convar' as part of Ulib.

Avien:
Well i reinstalled the files that contained the command convar, and i still get the error saying that convar is calling a nil value.

Golden-Death:
I don't really know what the problem is

Navigation

[0] Message Index

[*] Previous page

Go to full version