Author Topic: Auto-add to usergroup based on kick/banned.  (Read 130 times)

0 Members and 1 Guest are viewing this topic.

Offline jut

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Auto-add to usergroup based on kick/banned.
« on: January 03, 2021, 05:30:09 PM »
So this may be a feature in a mod somewhere, I did search but part of my problem is I am not sure how to properly search to see if it exist.
Basically what I want to know is, is it possible to implement a script that when a staff member kicks / bans a user, that user is then automatically added to a 'probationary' group for misbehaved players.

The reason why I was wondering if there was an automatic feature, is that not all players would have adduser access and this would allow it to be something that would ensure that problematic users are flagged in the ulx system (i.e those in the probationary group are already restricted as to what they CAN and CANNOT do)

Anyways I appreciate your help if you are able to tell me if such a thing does exist or if it is even possible.

P.s Happy new year everyone!

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2731
  • Karma: 427
    • |G4P| Gman4President
Re: Auto-add to usergroup based on kick/banned.
« Reply #1 on: January 07, 2021, 08:29:25 AM »
This is not a feature of ULX nor will something like this be added to ULX officially.
We do, however, have hooks in place that would allow you to write this function yourself.


The above two links are the hooks you would need to use to detect when a player is kicked or banned.


The above link is the ULib UCL function you could call to set the player's group.

I hope this helps. :)

Offline jut

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Auto-add to usergroup based on kick/banned.
« Reply #2 on: January 13, 2021, 06:16:33 AM »
Would this work?
Code: [Select]
function ULib.ban( ply )
    if ULib.addBan( ply:SteamID() ) then
      ucl.addUser( ply:SteamID(), "probationary")

Thank you for your help!
« Last Edit: January 13, 2021, 04:29:26 PM by jut »