Triggering a command on ULX using another addon

I want to make an addon that can ban people under certain circumstances.
However, I do not want to make my own banning/kicking system.
Also this is a addon that is exclusive to my server, which runs ulx.

Is there any way to manually trigger a ban command, regardless of what rank a person has, from another addon? (so the ban command is run by the server I guess?)

You can use the ulx ban concommand.

If you want to do it regardless of rank run it on the server using

RunConsoleCommand

And use, as code_gs said, the ulx ban command.

SIDE NOTE: Be wary if you need to network something the client does over to the server. Put in sanity checks to make sure that the right player is being banned and that the player should even be banned at all.

[lua]
local banTarget = player.GetAll()[1]
ulx.ban( NULL,banTarget, 9001, “cheese” )
[/lua]
?


ULib.addBan(target:SteamID(), 15, "some reason", target:Nick())