Author Topic: Setting up ULX ranks 'properly'?  (Read 21017 times)

0 Members and 3 Guests are viewing this topic.

Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Setting up ULX ranks 'properly'?
« on: December 24, 2013, 03:13:51 AM »
Hello,

I want my moderators to be able to view the damage logs mid round, I have been doing some research on it and on a different site people were saying:

"1. Set up your ranks. Correctly..with targeting/inherits being correct. (note: you can tell its messed up if the ranks aren't in order from your lowest rank to your highest.)

2. Make superadmin below a group you want to be able to see damage logs mid round (note: superadmin doesnt have to be a active rank...aslong as its there.you could create another rank called superadmins and then just build off of there.)

3. Ranks above superadmin will be able to see mid round damagelogs.

EX:

I want senior moderators and up to be able to see damagelogs mid round. Set up in the ULX menu. (these are groups)

mod

superadmin (doesnt have to be active. makes senior mods and up have damagelog mid round.)

senior-mod

admin

blah blah ranks go here.

and for the record I would only make them to be seen (mid round) by coowner and up.


Concerns:

But super admin comes with all commands by default. Yes, but if it inherits from a lesser group it deletes the commands it comes with and matches the commands the group it inherited off of has.


How does this change anything..? If you have it set up correctly superadmin, by default, has the power to see logs mid round. Well if you make groups inherit off of this not only do they get this and superadmin commands, they get more that you can add through ULX as you know. "

The ranks that I currently have on my server are:

superadmin
god
globaladmin
tttadmin
wotadmin
globalmod
tttmod
wotmod
trustedmember
donator
member
user

They do not appear in this order though in the ULX menu. I'm a bit confused because if ranks are above superadmin they will have all of the permissions wont they? Or should I create 'Owner' for example and give that all the perms and take permissions from superadmin?

I would appreciate it if someone could clear this up for me and try to help me get my head around this.

Thanks,

Owen

PS. Reading this back I have had a thought, would I just add 'ttt_print_damagelog' to the groups allow list?


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting up ULX ranks 'properly'?
« Reply #1 on: December 24, 2013, 07:59:01 AM »
1) Gmod sets/expects superadmin as the highest group. There shall be no other group higher unless you really want to start confusing all scripts that look for superadmin as highest and admin as second highest.
2) Inheritance does not cancel out command access in ULib. Like in real life, if you have $1000 in your bank account, and you inherit $10000 from a rich uncle,  you then have $11000 in  your account (well, taxed of course)
3) Somewhere on this forum is a ulx command that will allow the damage log, and yes, you'd add that ulx command to the groups list you want it.
The rest of your post confuses me as to what you're looking ot be answered.
If you have more questions, please rephrase.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: Setting up ULX ranks 'properly'?
« Reply #2 on: December 24, 2013, 08:02:35 AM »
Thanks very much for your reply :)

I'll get searching for the command.

Have a great Christmas :)

Owen


Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: Setting up ULX ranks 'properly'?
« Reply #3 on: December 24, 2013, 11:02:05 AM »
Hi,

Me again!  I've been browsing the forums for a long time and cant find the command.  I know I can give them RCON access and restrict it to that one command but I dont want moderators to be able to view the server console. 

Is there anything you can do to help? Or can you point me in the right direct?

Thanks again,

Owen


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting up ULX ranks 'properly'?
« Reply #4 on: December 24, 2013, 11:49:22 AM »
The search box of this forum is 'page context' sensitive. That means, if you search from the main front forum page, it will search entire forum.
Search from in a sub-section, it will search the entire section.
Search within a topic, and it will search that topic.
From the front page of the forum, I searched for damage log and found several.
This one is closest discussion to what you need. - http://forums.ulyssesmod.net/index.php/topic,5863.msg27164.html#msg27164
It's going to take some file creation on your own...but the code, and where to put it on your server, are there in that discussion.

However, the default print damage log may still do it's own checking of permissions. We didn't write it. (ie, if you grant someone the ULX command, it still might not work)
Before going and worrying about that though, follow the discussion and see if it works.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Setting up ULX ranks 'properly'?
« Reply #5 on: December 24, 2013, 03:44:06 PM »
I would say there is an easier way of making them able to check damagelogs mid-round, although that requires you to do some Lua.

If you go into <Garry's Mod dir>\gamemodes\terrortown\admin.lua and find line 108, it should look like this:
Code: [Select]
if (not IsValid(ply)) or ply:IsSuperAdmin() or GetRoundState() != ROUND_ACTIVE then
What you could do to make admins (and everyone that inherits permissions from default ULX group "admin") is to edit it to say this (add "ply:IsAdmin()" somewhere in it):
Code: [Select]
if (not IsValid(ply)) or ply:IsSuperAdmin() or ply:IsAdmin() or GetRoundState() != ROUND_ACTIVE then
Although, that doesn't help for groups below the "admin" group. What you could do for them is to use ply:IsUserGroup, like this:
Code: [Select]
if (not IsValid(ply)) or ply:IsSuperAdmin() or ply:IsUserGroup("Insert_Group_Here") or GetRoundState() != ROUND_ACTIVE thenThe issue here is that you have to add "or ply:IsUserGroup("GroupName1")" for basically every group below admin.
Another solution is to make every group below admin, inherit from admin, then make a new group that is basically "admin", with the same permissions.
That way you only have to use "ply:IsAdmin()" instead (first example).

Hope it isn't too confusing for you. I'll be happy to assist more if needed.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: Setting up ULX ranks 'properly'?
« Reply #6 on: December 24, 2013, 03:55:07 PM »
Thanks so much!

So if I change:

 if (not IsValid(ply)) or ply:IsSuperAdmin() or GetRoundState() != ROUND_ACTIVE then

to:

if (not IsValid(ply)) or ply:IsSuperAdmin() or ply:IsUserGroup("tttmod") or GetRoundState() != ROUND_ACTIVE then

everyone above tttmod will be able to view the logs mid round?

Thanks so much!

Your faithful noob,
Owen


Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: Setting up ULX ranks 'properly'?
« Reply #7 on: December 24, 2013, 04:05:12 PM »
Hi,

Just implemented it and it works :D

Thanks to everyone for the help :)

Have a good christmas,
Owen
« Last Edit: December 24, 2013, 04:41:44 PM by ojbristow »


Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Setting up ULX ranks 'properly'?
« Reply #8 on: December 24, 2013, 04:46:19 PM »
Actually, I'm wasn't sure if it worked for people that inherit from "tttmods". Although, if you've tested that, then I guess it's confirmed.

Happy to help & merry Christmas!
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline ojbristow

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
    • Superclocked
Re: Setting up ULX ranks 'properly'?
« Reply #9 on: December 24, 2013, 04:53:03 PM »
Ah sorry, I don't think I made clear what I was trying to say. I meant I tested it for the tttmod rank. I will have to check if it works for inherited ranks.  I will confirm in a couple of days as I am going to away to aunties house for Christmas. If it doesn't work, will I just need to add ... or ply:IsUserGroup("KeepAdding") ..for all the required groups?

Thanks,

Owen


Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Setting up ULX ranks 'properly'?
« Reply #10 on: December 24, 2013, 05:42:36 PM »
Yes, you will. Until you reach the default "admin" rank, then everyone who inherits that will basically get it from "ply:IsAdmin()", as I said earlier.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting up ULX ranks 'properly'?
« Reply #11 on: December 25, 2013, 12:34:28 AM »
Decicus, I saw a post you made recommending the same change in another thread beside the one I referenced.
I didn't recommend it because I hate to recommend people change default code of any project, ours or not.
By using the link I recommended, he'd never have to remember what code he changed when TTT (or ULX) updated.
The way you recommend, though it's slightly quicker, demands that he review/make changes everytime an update to TTT/Gmod is made.

Knowing how to edit default code is great.
Not remembering to re-edit it after a default updates is a big challenge.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Setting up ULX ranks 'properly'?
« Reply #12 on: December 25, 2013, 07:06:12 AM »
The link you provided only created a command to be able to use it. It would still show "You do not appear to be Superadmin or RCON" (or something similar to it), unless TTT had set the proper access to it (If you read the post you linked, it only had ConCommand).

Although, you've inspired me to add something to my command pack that allows you to print the damagelog if you're not superadmin (without editing the code).
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting up ULX ranks 'properly'?
« Reply #13 on: December 25, 2013, 07:43:59 AM »
Your idea sounds like a great new addition.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming