ULX

Author Topic: Custom Rank Only Chats?  (Read 1446 times)

0 Members and 1 Guest are viewing this topic.

Offline YouNMe

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Custom Rank Only Chats?
« on: December 08, 2015, 12:52:24 AM »
So in ULX there's asay and ssay which is admin chat and super admin chat I want to know how I can make commands like this for other ranks, as there are many players who'd like to talk to a group of people which are usually staff or their own rank (trusted/donator) and have to either PM it to all of them or say it out loud for the whole server to hear, I want to make it so that there's a chat for those users to chat with users of their same rank and above e.g. donator chat would use { to talk to other donators & above just like admins use @ and superadmins use &

I know this is a unusual request but it can be done as shown by asay and ssay but I have no idea how to do it.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Custom Rank Only Chats?
« Reply #1 on: December 08, 2015, 06:40:08 AM »
Last time I checked ssay wasn't in default ULX. Anyways, it would be pretty simple to create a rank-limited chat. Just replace the if statement checking for the asay permission to a check for their group:

Code: [Select]
if not ULib.ucl.query( v, seeasayAccess ) and v ~= calling_ply then -- Calling player always gets to see the echo
Code: [Select]
if not v:IsUserGroup( "myrank" ) and v ~= calling_ply then -- Calling player always gets to see the echo
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.