General > Developers Corner

Undercover mod Command

(1/4) > >>

Mr582:
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>

Megiddo:
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.

Mr582:

--- Quote from: Megiddo 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.

--- End quote ---

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.

Megiddo:
You can do that by simply putting the logic for echoing (the fancy log function) in the appropriate branches.

Mr582:

--- Quote from: Megiddo 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.

--- End quote ---

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

Navigation

[0] Message Index

[#] Next page

Go to full version