Posts: 27
Threads: 1
Joined: Mar 2012
Reputation:
0
you just need to add peoples xuid here : Vip_xuids=xuid_here,xuid_here,xuid_here
but not in this plugin...it needs to go in the sv_config.ini in the addon folder
Posts: 103
Threads: 17
Joined: Nov 2011
Reputation:
-6
09-05-2012, 18:59
(This post was last modified: 09-06-2012, 06:57 by NooB_StalkeR.)
@ Pozzuh
Yeah I guess I got a little confuzed. The !add command is from GodPlugin and is used to put xuids in permission groups. I have asked Ozone about this.
Posts: 5,135
Threads: 241
Joined: Nov 2010
Reputation:
100
Sky just tried to help. No need to insult him.
Posts: 103
Threads: 17
Joined: Nov 2011
Reputation:
-6
(09-05-2012, 19:42)Pozzuh Wrote: Sky just tried to help. No need to insult him.
Yeah my bad. I just took his answer as an insult. I allready stated that I have to manually add them to my ini.
Im still not sure if its an addon, permission plugin, god plugin, or user error. I am unable to get into it right now.
The reason I originally thought it was a permission plugin problem was that even though I am using !add command which is from another plugin, it only controls settings of the permission plugin. If I use Moderator or Admin it works. But any custom groups will not. Custom groups I create with the permission plugin settings in my ini.
Does anyone else use custom groups with permission plugin?
Posts: 15
Threads: 0
Joined: Oct 2012
Reputation:
0
i just created few custom groups, its no good as either u have to type every command manually or it just dosnt work, also a greeting plugin dosnt even regocnize the ranks just says player joined server when it should say welcome player(rank) player(name) to server.
i dunno why it acts like this...
Posts: 836
Threads: 48
Joined: Feb 2012
Reputation:
11
12-10-2012, 18:38
(This post was last modified: 12-10-2012, 18:44 by hillbilly.)
ive added a few custom groups, including Senior Mods and VIPS, all work as expected.
Usergroups=Admin,Moderator,User,Senior_Moderator,Trainee_Moderator,VIP
//Add admin xuids here (Go ingame and use !getxuid)
Admin_xuids=
//Admins can use all commands (Do not change!).
Admin_commands=*ALL*
//Add moderator xuids here
Moderator_xuids=
//Add commands moderators can use here
Moderator_commands=!tempbanc,!tmpban
//VIP xuids
VIP_xuids=
//VIP cmds
VIP_commands=
//Trainee_Moderator_xuids
Trainee_Moderator_xuids=!kickc
//Add commands moderators can use here
Trainee_Moderator_commands=
//super_mod
Senior_Moderator_xuids=
//super_mod_commands
Senior_Moderator_commands=!tempbanc,!tp,!tmpban
//Add commands everyone can use
User_commands=
//Everyone who isn't in any other group is a user (Do not change!).
User_xuids=*EVERYONE*
Posts: 15
Threads: 0
Joined: Oct 2012
Reputation:
0
12-13-2012, 23:43
(This post was last modified: 12-15-2012, 00:04 by lordevil10.)
(12-10-2012, 18:38)hillbilly Wrote: ive added a few custom groups, including Senior Mods and VIPS, all work as expected.
Usergroups=Admin,Moderator,User,Senior_Moderator,Trainee_Moderator,VIP
//Add admin xuids here (Go ingame and use !getxuid)
Admin_xuids=
//Admins can use all commands (Do not change!).
Admin_commands=*ALL*
//Add moderator xuids here
Moderator_xuids=
//Add commands moderators can use here
Moderator_commands=!tempbanc,!tmpban
//VIP xuids
VIP_xuids=
//VIP cmds
VIP_commands=
//Trainee_Moderator_xuids
Trainee_Moderator_xuids=!kickc
//Add commands moderators can use here
Trainee_Moderator_commands=
//super_mod
Senior_Moderator_xuids=
//super_mod_commands
Senior_Moderator_commands=!tempbanc,!tp,!tmpban
//Add commands everyone can use
User_commands=
//Everyone who isn't in any other group is a user (Do not change!).
User_xuids=*EVERYONE* well... only thing i have diffrent from u is that i dont have those //lines as they shouldnt be necessary
edit: ok i think u cant make it so if u create a group for certain people (mainly to identify them) u cant let them use *all* commands... u have to put them one by one -.-
Posts: 144
Threads: 6
Joined: Dec 2012
Reputation:
12
01-10-2013, 04:24
(This post was last modified: 01-11-2013, 03:51 by SgtLegend.)
Hey guys,
Just thought I'd make a quick addition to this great plugin which is protected XUID commands, basically a friend asked if it was possible to protect specific XUID's against commands such as kicks, bans etc., so basically I have altered the plugin source to allow for this.
Essentially it looks like a group but its simply a list of assigned XUID's that get checked by the plugin along with commands you set that you want to protect, add the following to your sv_config.ini file under the [Permission] heading.
Code: //XUID safe commands, the following id's will be protected from the commands following this line, these are comma seperated
Protected_xuids=
//Commands that the above xuids are protected from, E.g. !ban,!kick
Protected_commands=
Source:
Code: using System;
using System.Collections.Generic;
using System.Text;
using Addon;
//Pozzuh xuid = 0110000102fd9a03
namespace _PermissionPlugin
{
public class _PermissionPlugin : CPlugin
{
public List<string> Admins;
public List<string> UserGroups;
public override void OnServerLoad()
{
ServerPrint("Permission plugin loaded. Author: Pozzuh. Version 1.0 Beta");
initUserGroups();
firstStart();
}
void firstStart()
{
if (GetServerCFG("Permission", "Usergroups", "x") == "x")
SetServerCFG("Permission", "Usergroups", "Admin,Moderator,User");
if (GetServerCFG("Permission", "Admin_xuids", "x") == "x")
SetServerCFG("Permission", "Admin_xuids", "xuid1,xuid2,xuid3");
if (GetServerCFG("Permission", "Admin_commands", "x") == "x")
SetServerCFG("Permission", "Admin_commands", "*ALL*");
if (GetServerCFG("Permission", "Moderator_xuids", "x") == "x")
SetServerCFG("Permission", "Moderator_xuids", "xuid1,xuid2,xuid3");
if (GetServerCFG("Permission", "Moderator_commands", "x") == "x")
SetServerCFG("Permission", "Moderator_commands", "!help,!getxuid,!gettype");
if (GetServerCFG("Permission", "User_commands", "x") == "x")
SetServerCFG("Permission", "User_commands", "!help,!getxuid,!gettype");
if (GetServerCFG("Permission", "User_xuids", "x") == "x")
SetServerCFG("Permission", "User_xuids", "*EVERYONE*");
}
void initUserGroups()
{
UserGroups = new List<string>();
string UserGroups_string = GetServerCFG("Permission", "Usergroups", "Admin,Moderator,User");
foreach (string Group in UserGroups_string.Split(','))
UserGroups.Add(Group);
}
List<string> getUsersInGroup(string groupname)
{
List<string> group = new List<string>();
string group_string = GetServerCFG("Permission", groupname + "_xuids", " ");
if (group_string != " ")
foreach (string xuid in group_string.Split(','))
group.Add(xuid);
else
if (groupname != "User")
ServerPrint("No users set for group: " + groupname);
return group;
}
List<string> getCommandsAllowedInGroup(string groupname)
{
List<string> group = new List<string>();
string group_string = GetServerCFG("Permission", groupname + "_commands", " ");
if (group_string != " ")
foreach (string cmd in group_string.Split(','))
group.Add(cmd);
else
ServerPrint("No commands set for group: " + groupname);
return group;
}
string getUserGroup(string xuid)
{
foreach (string group in UserGroups)
{
List<string> usersInGroup = new List<string>();
usersInGroup = getUsersInGroup(group);
if (usersInGroup.Contains(xuid))
return group;
}
return "User";
}
List<string> getProtectedCommands()
{
List<string> commands = new List<string>();
string _commands = GetServerCFG("Permission", "Protected_commands", "");
if (!string.IsNullOrEmpty(_commands))
{
foreach (string _command in _commands.Split(','))
{
commands.Add(_command);
}
}
else
{
ServerPrint("No protected commands were found");
}
return commands;
}
ServerClient determinePlayer(string msg)
{
List<ServerClient> clients = GetClients();
// Break the message down
string[] chunks = msg.Split(' ');
foreach (string chunk in chunks)
{
// Loop through each client and see if a client number/name matches
foreach (ServerClient client in clients)
{
if (client.ClientNum.ToString() == chunk || client.Name == chunk || client.Name.ToLower().Contains(chunk))
{
return client;
}
}
}
return null;
}
public override ChatType OnSay(string Message, ServerClient Client)
{
string userIsInGroup = getUserGroup(Client.XUID);
string lowMsg = Message.ToLower();
// Check if a command was issued
if (!lowMsg.StartsWith("!"))
return ChatType.ChatAll;
if (lowMsg.StartsWith("!getxuid")) //Can't be used in the permission plugin OH THE IRONY
{
TellClient(Client.ClientNum, "Your xuid is: \'" + Client.XUID + "\'.", true);
return ChatType.ChatNone;
}
if (lowMsg.StartsWith("!gettype")) //Can't be used in the permission plugin OH THE IRONY
{
TellClient(Client.ClientNum, "Your user type is: \'" + userIsInGroup + "\'.", true);
return ChatType.ChatNone;
}
if (lowMsg.StartsWith("!help") || lowMsg.StartsWith("!cmdlist"))
{
List<string> allowed_commands = getCommandsAllowedInGroup(userIsInGroup);
string msg = "You can use the following commands^1:^7 ";
for (int i = 0; i < allowed_commands.Count; i++)
{
if (i == (allowed_commands.Count - 2))
msg += allowed_commands[i] + "^1 and^7 ";
else if (i == (allowed_commands.Count - 1))
msg += allowed_commands[i] + "^1.";
else
msg += allowed_commands[i] + "^1,^7 ";
}
TellClient(Client.ClientNum, msg, true);
return ChatType.ChatNone;
}
// Check if the user is allowed to use the command on the chosen user
string protected_xuids = GetServerCFG("Permission", "Protected_xuids", "");
List<string> protected_commands = getProtectedCommands();
ServerClient against_player = determinePlayer(Message);
if (against_player != null && protected_xuids.Length > 0 && protected_commands.Count > 0)
{
foreach (string command in protected_commands)
{
if (lowMsg.Split(' ')[0] == command && protected_xuids.Contains(against_player.XUID))
{
TellClient(Client.ClientNum, "^1You aren't allowed to use that command against ^7" + against_player.Name, true);
return ChatType.ChatNone;
}
}
}
if (userIsInGroup != "Admin")
{
List<string> allowed_commands = getCommandsAllowedInGroup(userIsInGroup);
if (allowed_commands.Contains(lowMsg.Split(' ')[0]))
return ChatType.ChatContinue;
else
{
TellClient(Client.ClientNum, "^1You aren't allowed to use that command!", true);
return ChatType.ChatNone;
}
}
return ChatType.ChatContinue;
}
}
}
I have also attached a tested and working DLL for the plugin, hope this helps others.
aaaPermissionPlugin.zip (Size: 3.49 KB / Downloads: 56)
I now host all my MW3 projects on my private GIT repo
Posts: 144
Threads: 6
Joined: Dec 2012
Reputation:
12
Sorry for the double post, I have updated my above post as I found an issue with the update that caused un-expected behavior.
The issue is fixed now and everything above has been updated.
I now host all my MW3 projects on my private GIT repo
Posts: 15
Threads: 0
Joined: Oct 2012
Reputation:
0
(01-10-2013, 12:59)SgtLegend Wrote: Sorry for the double post, I have updated my above post as I found an issue with the update that caused un-expected behavior.
The issue is fixed now and everything above has been updated. sorry to be pain in the b*tt but is that plugin u posted compatible with teknomw3?
i host my server there mainly because of more skilled players and i find them funnier for some reason.
i do own steam version too but i dont rlly use it
|