Ulysses Stuff > General Chat & Help and Support
Restricting Players by their group.
Smoot178:
heres my situation. I have my server that I want to only let players of a certain group spawn things. Using the UTeam setup, How can I disallow players that have the default 'Player' group not be able to do anything except walk around. In addition, I want users of the Members, Trusted, Admins, Superadmins, and Headadmins group to be able to do anything they want. (Yah there are custom groups in there). How could one do this? I'm noob at LUA so if you are kind enough to help, make it noob friendly.
JamminR:
Though I'm sure one of my more experienced coder brethren here might be able to assist more, ULX (which, relies on ULib UCLs) wasn't written to restrict the spawning of props the way you wish.
HOWEVER,
ULib does allow for such code, and custom groups, to be written and controlled.
See your gmod/addons/Ulib/format.txt, the section at the end regarding groups.txt.
--- Code: ---Format of group in groups.txt--
"<group_name>"
{
"allow"
{
"1" "ulx kick"
"2" "ulx ban"
}
"deny"
{
"1" "ulx cexec"
}
}
--- End code ---
You could/can start writing your own groups there in groups.txt. This would at least allow you to get a head start on the ULX commands you want (or don't want) to give your groups.
I have to say though, there isn't really a noob friendly task. Sorry. Access control rarely is.
Smoot178:
Are there any ULX commands to restrict props and stuff?
spbogie:
Save the following code as blockspawn.lua in the /garrysmod/addons/ulib/lua/ULib/modules folder.
Put the groups that should be allowed to spawn things in the table.
--- Code: ---if not SERVER then return end
local groups = { "superadmin", "admin", "opperator" } --Add your groups here
local function block_spawn( ply )
for _,v in groups do
if ply:IsUserGroup( v ) then
return
end
end
ULib.tsay( ply, "You are not allowed to spawn objects." )
return false
end
hook.Add( "PlayerSpawnObject", "block_spawn", block_spawn )
--- End code ---
Smoot178:
that doesnt work :(
Navigation
[0] Message Index
[#] Next page
Go to full version