• Print

Author Topic: ULX customCheck for donator jobs not working  (Read 7612 times)

0 Members and 1 Guest are viewing this topic.

Offline ldshaul01

  • Newbie
  • *
  • Posts: 12
  • Karma: -1
ULX customCheck for donator jobs not working
« on: September 03, 2014, 01:17:56 pm »
Here is the code in my jobs/lua in pastebin.

http://pastebin.com/YhfiKRAL

There is no error that happens, but when I set my self to donator in game the jobs with this customCheck are not coming up.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX customCheck for donator jobs not working
« Reply #1 on: September 03, 2014, 10:17:58 pm »
Pardon me, but, what is ULX customcheck?
Though I see code within some of the teams posted called "customcheck", I see nothing related to ULX.
Not even in our ULX repository
« Last Edit: September 03, 2014, 10:19:45 pm by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: ULX customCheck for donator jobs not working
« Reply #2 on: September 03, 2014, 10:33:52 pm »
Assuming you're using the ULX Admin Mod (I guess that would be why you're here), I recommend not using your current layout:

Code: Lua
  1. customCheck = function(ply) return
  2.         table.HasValue({"superadmin", "admin", "donator"}, ply:GetNWString("usergroup"))
  3.         end,
  4.         CustomCheckFailMsg = "You don't have the required rank to complete this action!",

Instead replace it with this:

Code: Lua
  1. customCheck = function(ply) return
  2. ply:GetUserGroup() == "donator" or ply:IsAdmin() or ply:IsSuperAdmin() end,
  3. CustomCheckFailMsg = "You don't have the required rank to complete this action!",

Much easier to lay out, AND it calls for the ULX Groups ;)


P.S. If you want to add more groups, the just use

Code: Lua
  1. ply:GetUserGroup() == "groupname"

And don't forget the "or" when using multiple groups!
« Last Edit: September 03, 2014, 10:35:44 pm by Archang3L »
Once you get to know me, you'll find you'll have never met me at all.

Offline ldshaul01

  • Newbie
  • *
  • Posts: 12
  • Karma: -1
Re: ULX customCheck for donator jobs not working
« Reply #3 on: September 04, 2014, 08:57:30 am »
Assuming you're using the ULX Admin Mod (I guess that would be why you're here), I recommend not using your current layout:

Code: Lua
  1. customCheck = function(ply) return
  2.         table.HasValue({"superadmin", "admin", "donator"}, ply:GetNWString("usergroup"))
  3.         end,
  4.         CustomCheckFailMsg = "You don't have the required rank to complete this action!",

Instead replace it with this:

Code: Lua
  1. customCheck = function(ply) return
  2. ply:GetUserGroup() == "donator" or ply:IsAdmin() or ply:IsSuperAdmin() end,
  3. CustomCheckFailMsg = "You don't have the required rank to complete this action!",

Much easier to lay out, AND it calls for the ULX Groups ;)


P.S. If you want to add more groups, the just use

Code: Lua
  1. ply:GetUserGroup() == "groupname"

And don't forget the "or" when using multiple groups!

I added this check to the jobs I wanted to make for donators, but it still isn't showing up for when I change myself to the donator usergroup.

I created the user group through the ULX admin menu, so I didn't know if that would make a difference.

Offline ldshaul01

  • Newbie
  • *
  • Posts: 12
  • Karma: -1
Re: ULX customCheck for donator jobs not working
« Reply #4 on: September 04, 2014, 08:58:51 am »
Pardon me, but, what is ULX customcheck?
Though I see code within some of the teams posted called "customcheck", I see nothing related to ULX.
Not even in our ULX repository

It is apparently a way to make users of a specific class, say donator, be able to choose from a higher variety of jobs if they donate to the server.
« Last Edit: September 04, 2014, 09:14:12 am by ldshaul01 »

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: ULX customCheck for donator jobs not working
« Reply #5 on: September 04, 2014, 09:33:37 pm »
Hello,
please do have a look at this.

Try CheckGroup("groupname") or IsUserGroup("groupname").

Offline ldshaul01

  • Newbie
  • *
  • Posts: 12
  • Karma: -1
Re: ULX customCheck for donator jobs not working
« Reply #6 on: September 05, 2014, 09:43:32 am »
Hello,
please do have a look at this.

Try CheckGroup("groupname") or IsUserGroup("groupname").

So if I have the code :
   customCheck = function(ply) return ply:GetNWString("usergroup") == "donator" or ply:IsAdmin() end,
   CustomCheckFailMsg = "You don't have the required rank to complete this action!",

How would I use your version of that check?

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: ULX customCheck for donator jobs not working
« Reply #7 on: September 05, 2014, 10:17:34 pm »
Do your groups have capitals in them or are they all lowercase?
Once you get to know me, you'll find you'll have never met me at all.

Offline ldshaul01

  • Newbie
  • *
  • Posts: 12
  • Karma: -1
Re: ULX customCheck for donator jobs not working
« Reply #8 on: September 06, 2014, 06:34:30 am »
All of my usergroups are lowercase.

Do I need to add the group through the ulx files? or is it fine to add the group through the admin menu in-game?

Offline ldshaul01

  • Newbie
  • *
  • Posts: 12
  • Karma: -1
Re: ULX customCheck for donator jobs not working
« Reply #9 on: September 06, 2014, 07:30:42 am »

  • Print