ULX

Author Topic: Usergroups and TTT Benefits  (Read 4244 times)

0 Members and 2 Guests are viewing this topic.

Offline drake90001

  • Newbie
  • *
  • Posts: 33
  • Karma: 0
  • Formerly xXMyFateXx
Usergroups and TTT Benefits
« on: October 17, 2012, 01:06:03 PM »
Soooo, we are in the works of getting our donation system up, it won't be automated right now, but for now, I have some questions.

Lets say, a user is in the usergroup "donator"
Well, how would we set up things that ARE NOT CONTROLLED BY THE ADMIN MOD?

So anyways, they are in the group "donator", and the gamemode is TTT. I want that group (and admin+) to have the ability to have unlimited pack-o-punch meter. How does one do that? Right now I just have it so everyone has unlimited, but now I only want the groups "donator, admin, trusted, superadmin" to have it. I'm getting repetitive. THANK YOU THOUGH.  ;)


Also, if someone could change my forum name for me please, to "drake90001"
« Last Edit: October 17, 2012, 01:11:22 PM by xXMyFateXx »

Offline iSnipeu

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 12
Re: Usergroups and TTT Benefits
« Reply #1 on: October 17, 2012, 07:57:06 PM »
Well, how would we set up things that ARE NOT CONTROLLED BY THE ADMIN MOD?

What do you mean by that?, just not using function that are only available in ULib/Ulx?


So anyways, they are in the group "donator", and the gamemode is TTT. I want that group (and admin+) to have the ability to have unlimited pack-o-punch meter. How does one do that? Right now I just have it so everyone has unlimited, but now I only want the groups "donator, admin, trusted, superadmin" to have it. I'm getting repetitive. THANK YOU THOUGH.  ;)

"if Player:GetUserGroup() == "donator" or Player:GetUserGroup() == "trusted" or Player:IsAdmin() then"

EDIT: You can also use Player:IsUserGroup("rank"), as MrPresident has shown below.
« Last Edit: October 17, 2012, 08:12:57 PM by iSnipeu »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Usergroups and TTT Benefits
« Reply #2 on: October 17, 2012, 07:58:20 PM »
You would need to add some kind of a group check to your code.

pl:IsUserGroup("donator") would return true if the player was in that group.

keeping in mind that pl is the Player Object, defined by the hook code.

If you are no familiar with the inner workings of TTT then you might have some troubles with this. Unfortunately, none of us are familiar with this either.

Offline drake90001

  • Newbie
  • *
  • Posts: 33
  • Karma: 0
  • Formerly xXMyFateXx
Re: Usergroups and TTT Benefits
« Reply #3 on: October 18, 2012, 02:58:59 PM »
What do you mean by that?, just not using function that are only available in ULib/Ulx?


"if Player:GetUserGroup() == "donator" or Player:GetUserGroup() == "trusted" or Player:IsAdmin() then"

EDIT: You can also use Player:IsUserGroup("rank"), as MrPresident has shown below.

Alright, I'm quite a noob. Where would I put that code? Like I don't understand how you get it to run.....

God I sound like an idiot.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Usergroups and TTT Benefits
« Reply #4 on: October 18, 2012, 04:52:00 PM »
You would need to put it inside of the function that controls whatever part of the gamemode you are trying to restrict. Adding restrictions like this to a gamemode is not as easy as adding the code. It requires a bit of editing and at least a basic understanding of how LUA works.

Offline drake90001

  • Newbie
  • *
  • Posts: 33
  • Karma: 0
  • Formerly xXMyFateXx
Re: Usergroups and TTT Benefits
« Reply #5 on: October 19, 2012, 11:04:12 AM »
You would need to put it inside of the function that controls whatever part of the gamemode you are trying to restrict. Adding restrictions like this to a gamemode is not as easy as adding the code. It requires a bit of editing and at least a basic understanding of how LUA works.

Ah, okay, that makes sense. I'll give it a shot in that case.