ULX

Author Topic: TempAdd (v2.4) - Add a user to another group for a set amount of time  (Read 95365 times)

0 Members and 1 Guest are viewing this topic.

Offline lua_error

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: TempAdd (v2.1) - Add a user to another group for a set amount of time
« Reply #15 on: January 27, 2013, 07:33:53 PM »
It appears that <player>:IsConnected() is only available serverside, so the code will have to be changed to adapt to that. :S

How to fix this?

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: TempAdd (v2.1) - Add a user to another group for a set amount of time
« Reply #16 on: January 27, 2013, 07:42:30 PM »
How to fix this?

Wait until Mr. President has a fix, I'm afraid.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: TempAdd (v2.1) - Add a user to another group for a set amount of time
« Reply #17 on: January 27, 2013, 10:31:46 PM »
Busy busy weekend!

I'll try and remember to push and update tomorrow. I'm currently not at my workstation.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #18 on: January 28, 2013, 08:51:38 PM »
Update pushed.

2.2 should fix these things. Check the changelog in the first post.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #19 on: January 28, 2013, 09:25:55 PM »
Looks good, Mr. P!  8)
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Mesmaroth

  • Newbie
  • *
  • Posts: 5
  • Karma: -1
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #20 on: February 06, 2013, 09:57:14 PM »
Thanks, keep up the good work! Also going to learn LUA so I can give to the community!

Offline DeathRowDave201

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #21 on: February 11, 2013, 06:47:02 AM »
Hi could you see about making it possible to add users via their steamID and not just their username?

Regards,
Dave

Offline datgregofag

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #22 on: February 12, 2013, 02:33:34 PM »
Hi, do you think you can make it so that its not only a certain number of min but also like hours,days,weeks,months,years etc. Thank you.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #23 on: February 12, 2013, 10:25:44 PM »
I could look at how ULX handles their string time parser. In the mean time just do the math.


1 hour = 60 minutes
1 day = 1440 minutes
1 week = 10080 minutes
1 month = 43200 minutes
1 year = 525600 minutes
« Last Edit: February 12, 2013, 10:27:25 PM by MrPresident »

Offline lua_error

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #24 on: February 13, 2013, 12:11:06 AM »
Will it possible to add users via SteamID?
It will be very comfortable not to wait player online.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #25 on: February 13, 2013, 10:58:36 AM »
I could look at how ULX handles their string time parser.

I believe there's a specific parameter (ULib.cmds.allowTimeString) you can set on your NumArg to allow it to process timestrings. So, assuming I'm not mistaken (it happens more often than you think :P), adding said parameter to the NumArg should be all you need to do. Here's the NumArg for ulx ban:
Code: [Select]
ban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
Hope that helps! :)
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline datgregofag

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #26 on: February 13, 2013, 12:01:01 PM »
ban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }

Stickly man, can you please tell me where to put that and if its in ulxtempuser.lua, can you tell me what line. THANK YOU!

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #27 on: February 13, 2013, 12:53:21 PM »
Inside of ulxtempuser.lua (line 156 in the most recent update)

Replace
Code: [Select]
tempadduser:addParam{ type=ULib.cmds.NumArg, hint="Time (Minutes)" }

with

Code: [Select]
tempadduser:addParam{ type=ULib.cmds.NumArg, hint="Time (Minutes)", ULib.cmds.allowTimeString }


*Note* I haven't tested this so be weary... If this works let me know and I'll add it as an official update to the addon.

Offline datgregofag

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #28 on: February 13, 2013, 04:29:23 PM »
THANK YOU THAT WORKS, i mean the  days weeks months thing, IT WORKS. But one more question, will the temporary add still work on a person if i turn server off and then back on. If it doesn't can you please work on a fix. THANK YOU!!!

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: TempAdd (v2.2) - Add a user to another group for a set amount of time
« Reply #29 on: February 13, 2013, 09:51:19 PM »
Yeah, it is designed to work across server sessions.