Author Topic: Undercover mod Command  (Read 8859 times)

0 Members and 1 Guest are viewing this topic.

Mr582

  • Guest
Undercover mod Command
« on: August 22, 2013, 07:04:03 PM »
Ok so I need a command that makes it so that if a player is a mod, He can use the command like !undercov and it switches his group. I need it to be like

If Ply:IsUserGroup("moderator") then switch group to undercover

elseif Ply:IsUserGroup("undercover") then switch group to moderator

That is all i know that the command needs to do. It needs to be silent too. Thank you and if you help I will give you credit.

EDIT: Also is there a way to make it so when the undercover group preforms commands you see (Someone) instead of <NAMEHERE>
« Last Edit: August 22, 2013, 07:30:40 PM by Mr582 »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Undercover mod Command
« Reply #1 on: August 22, 2013, 07:37:27 PM »
You're almost there. The other function you'll need for this is SetUserGroup(). Anonymous echoes are a product of the echo mode configuration, it can't be set on a per-command basis.
Experiencing God's grace one day at a time.

Mr582

  • Guest
Re: Undercover mod Command
« Reply #2 on: August 22, 2013, 07:47:08 PM »
You're almost there. The other function you'll need for this is SetUserGroup(). Anonymous echoes are a product of the echo mode configuration, it can't be set on a per-command basis.

What you are basically saying is that I would need to make a plugin of my own to sort the echoes out if I understand you correctly. I think in can get the commands working but if you could help me with the echoes. For the echoes I want it to be like if Ply:IsUserGroup("undercover") then make all command echoes 1 or make all commands silent.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Undercover mod Command
« Reply #3 on: August 22, 2013, 08:13:07 PM »
You can do that by simply putting the logic for echoing (the fancy log function) in the appropriate branches.
Experiencing God's grace one day at a time.

Mr582

  • Guest
Re: Undercover mod Command
« Reply #4 on: August 22, 2013, 08:16:48 PM »
You can do that by simply putting the logic for echoing (the fancy log function) in the appropriate branches.

Thank you. I will make a script in the morning and post it here if it dosent work to see if any of you lua experts will help me. I think I have a good understanding of what I am going to do but the thing is I don't understand the hooks thing. Not sure if hooks are needed but I will see when I am done.

PS I am new to lua. 2 weeks of being exposed to the language

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given