ULX

Author Topic: "Warn" command - slaynr + adduser to group  (Read 2683 times)

0 Members and 1 Guest are viewing this topic.

Offline MiniCale

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
"Warn" command - slaynr + adduser to group
« on: March 30, 2016, 01:32:56 PM »
Hi Guys hopefully you can help me...

I am trying to make a 'warn' command that will !slaynr and !adduser to group Warning 1 so that my staff can easily punish and keep track of rule breakers on my server I was going to just try and mash the UserAdd command and Slaynr command together but I cant even get a user to go into a specific group before adding the slay part.


Any advice would be great.


This is all I have so far
(Gamemode is TTT)
---------------------
function ulx.warn( calling_ply, target_ply, group_name )
   local userInfo = ULib.ucl.authed[ target_ply:UniqueID() ]

   local id = ULib.ucl.getUserRegisteredID( target_ply )
   if not id then id = target_ply:SteamID() end

   ULib.ucl.addUser( id, userInfo.allow, userInfo.deny, Warning 1 )

   ulx.fancyLogAdmin( calling_ply, "Warning 1 #T", target_ply, group_name )
end
local warn = ulx.command( CATEGORY_NAME, "ulx warn", ulx.warn )
warn:addParam{ type=ULib.cmds.PlayerArg }
adduser:defaultAccess( ULib.ACCESS_SUPERADMIN )
warn:help( "Slays the player next round and marks them as warned." )

--------------------


Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: "Warn" command - slaynr + adduser to group
« Reply #1 on: April 01, 2016, 11:16:10 AM »
Unless you're not using groups for anything else, I highly recommend you don't make this command. Not only would it be easily abusable (insta-demote any staff member), but it would mess up any other permissions you have. What if you want to warn a VIP, or a Staff member?

If you want a way to easily distinguish between players who have been warned and players that have  not been warned then I suggest you make your own system. For example have a file that you write the SteamIDs of warned players to, and then have a menu read from that file and display them.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline MiniCale

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: "Warn" command - slaynr + adduser to group
« Reply #2 on: April 03, 2016, 06:43:14 AM »
The idea in this is so that we can keep track of people that are breaking rules easily and punish them all in one command.

I just want a command so that I can add a person to a specific group and slaynr them with the use of one command.

So that if someone has been warned we have a record of this so if they are on the server again rule breaking we have a record of this and can punish them accordingly.

I have several staff on my servers and at the moment I am having them post in a forum of who they have banned so we have a log of temp banned users and this takes a lot of time and drags them out of the game and its not very easy to check if people have been banned before.

After making a warn 1 and warn 2 command I want to use the same idea for a temp ban command where it adds them to a temp ban group.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: "Warn" command - slaynr + adduser to group
« Reply #3 on: April 03, 2016, 05:50:23 PM »
It doesn't slay, but check out my warning addon. It's pretty neat and it's free.

http://forums.ulyssesmod.net/index.php?topic=7125.0

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: "Warn" command - slaynr + adduser to group
« Reply #4 on: April 04, 2016, 08:04:16 AM »
Oh, I just assumed he was using AWarn and wanted something different :P

Yeah, if all you need is a way to keep track of warned users than AWarn is probably the best solution out there.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline MiniCale

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: "Warn" command - slaynr + adduser to group
« Reply #5 on: April 05, 2016, 10:40:52 AM »
That looks good enough for now, Thanks guys I will give this a shot when I next update the server.