General > Developers Corner

Groups, Props, and Tools

<< < (2/4) > >>

Golden-Death:
Tried combining some code, untested, see if it works.


--- Code: ---if not SERVER then return end

local groups = { "superadmin", "admin", "opperator" } --Add your groups here
local models = { "models/Effects/splode.mdl", "crane_frame.mdl" } --All or part of model name.



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
end
    ULib.tsay( ply, "You are not allowed to spawn this prop." )
    return false
end
end
--- End code ---

spbogie:
GD you forgot your hook.

JamminR:

--- Quote from: spbogie on May 14, 2007, 01:02:43 PM ---GD you forgot your hook.

--- End quote ---

What? He's a pirate? Oh. Fisherman perhaps?
:P* JamminR gives benefit of doubt and hopes that perhaps GD is leaving some code vague, and hoping that Avien will learn and place in some on his own.
In all honesty, Done right, I could really see a decent release module for ULib coming out of this.
The idea of combining did come to mind when I was making the 'Code Bits' posts.

Avien:
Hopefully something like this will work in the future.  I would try this new code by GoldenDeath, but i am unsure how to put in the server and have it get called, plus someone said it is missing hooks.  Isn't it operator, not opperator?

JamminR:
Avien.
Re: Missing hooks.
Think about it. Seriously.
Look at the code you posted.
Look at the code GD posted.
Then, look at the BIG CLUE that Spbogie said is missing.
Notice any key lua words missing from the first that aren't in the second?

You've been asking us to make it for you since you asked for 'help'.
If you'd placed your request in the suggestion forum, and left it there, we probably wouldn't have gone this far.
However, you asked for help. I moved the forum to developers corner.
We like helping. We like developing.
But, I don't think we're going to make it THAT easy on you.
I think most of us have gone farther than normal.

You're not dumb. You had a good idea.
Now, think about it, and learn to do it yourself. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version