Ulysses Stuff > General Chat & Help and Support
Restricting Players by their group.
JamminR:
--- Quote from: Smoot178 on May 09, 2007, 03:18:36 PM ---that doesnt work :(
--- End quote ---
*sigh*
Never. Ever. Never just say "it doesn't work"
Give detail. Error messages.
Did you set up your groups.txt?
If you have that set properly, the code should work.
Smoot178:
hehe. I added the groups but users that are just clients can spawn items. No errors...
cold12141:
Okay, got it to work myself thanks.
JamminR:
--- Quote from: cold12141 on May 09, 2007, 04:16:56 PM ---Okay, got it to work myself thanks.
--- End quote ---
Great!
Cold12141(registered) = Smoot178(guest)?
For those that might read this in the future and wish help with the same challenge, what did you do to get it working?
cold12141:
--- Quote from: JamminR on May 09, 2007, 07:41:22 PM ---Great!
Cold12141(registered) = Smoot178(guest)?
For those that might read this in the future and wish help with the same challenge, what did you do to get it working?
--- End quote ---
No, we are two seperate people :)
Here's the code in which I changed it to in order to get it working:
--- Code: ---if not SERVER then return end
local function block_spawn( userid, model, propid )
if userid:IsUserGroup( ULib.ACCESS_SUPERADMIN ) then
return
elseif userid:IsUserGroup( ULib.ACCESS_ADMIN ) then
return
elseif userid:IsUserGroup( ULib.ACCESS_HEAD ) then
return
elseif userid:IsUserGroup( ULib.ACCESS_OPERATOR ) then
return
elseif userid:IsUserGroup( ULib.ACCESS_MEMBER ) then
return
elseif userid:IsUserGroup( ULib.ACCESS_TRUST ) then
return
else
ULib.tsay( userid, "You are not allowed to build." )
return false
end
end
local function block_tool( pl, tr, toolmode )
if pl:IsUserGroup( ULib.ACCESS_SUPERADMIN ) then
return
elseif pl:IsUserGroup( ULib.ACCESS_ADMIN ) then
return
elseif pl:IsUserGroup( ULib.ACCESS_HEAD ) then
return
elseif pl:IsUserGroup( ULib.ACCESS_OPERATOR ) then
return
elseif pl:IsUserGroup( ULib.ACCESS_MEMBER ) then
return
elseif pl:IsUserGroup( ULib.ACCESS_TRUST ) then
return
else
ULib.tsay( pl, "You are not allowed to build." )
return false
end
end
hook.Add( "PlayerSpawnProp", "block_propspawn", block_spawn )
hook.Add( "PlayerSpawnEffect", "block_effectspawn", block_spawn )
hook.Add( "PlayerSpawnVehicle", "block_vehiclespawn", block_spawn )
hook.Add( "PlayerSpawnSENT", "block_sentspawn", block_spawn )
hook.Add( "CanTool", "block_tool", block_tool )
--- End code ---
That also has my custom groups built in.
Note: I'm a big lua noob.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version