Server admin where are you??
#1
Lightbulb 
Is it possible to make a plugin to tell at clients if admins are on the server if they type !admins and the console answer : console: No admins on this server or Server admins Moder.gr are/is ( if one admin ) on this server. ( server admins must set with their xuids )
Reply

#2
Yes, it is possible

I think :S
[Image: r212360a129ce9b84444093b6cd2699013a1fbn155.png]
Reply

#3
Yes
Reply

#4
if anyone can fix it because i dont know how to programm C
Reply

#5
To fix what?
[Image: r212360a129ce9b84444093b6cd2699013a1fbn155.png]
Reply

#6
(08-18-2012, 17:23)G-Man Wrote: To fix what?
the plugin for me Smile
Reply

#7
Hello,

It uses the admins from permission plugin.

Installation:
- Extract the zip file attached.
- Put the .dll in the plugin folder.
- Add "!admins" to the command allowed in permission's plugin.

Source code:
Code:
using System; using System.Collections; using System.Collections.Generic; using System.Text; using Addon; namespace ShowAdmins { public class ShowAdmins: CPlugin { // List of admins xuids private ArrayList Admins_Xuids = new ArrayList(); // On Server load public override void OnServerLoad() { try { // Split the admins xuids from permission String[] Get_Admins = GetServerCFG("Permission", "Admin_xuids", "0").Split(','); // Loop the admijns list foreach (String admin in Get_Admins) { // Add the admin to the list this.Admins_Xuids.Add(admin); } // Indicate that the plugin is correctly loaded ServerPrint("Plugin ShowAdmins loaded!"); } catch(Exception e) { // Wtf ServerPrint("Plugin ShowAdmins: OnServerLoad catched exception: " + e.Message); } } // On Say public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat) { try { // If the message starts with !admins if (Message.StartsWith("!admins")) { // Will store the string with the admins String admins = ""; // Get the list of players List<ServerClient> Clients = GetClients(); // If the list is not null if (Clients != null) { // Needed to know the first admin added Boolean first = true; int Admins_nbr = 0; // Loop the player list foreach (ServerClient player in Clients) { // If the player is an admin if (Admins_Xuids.Contains(player.XUID)) { if (first) { // First admin to add admins += player.Name; first = false; } else { // Other admins admins += ", " + player.Name; } Admins_nbr++; } } if (Admins_nbr == 0) { // No admins TellClient(Client.ClientNum, "No admins on this server", true); } else if (Admins_nbr == 1) { // Show 1 admin present TellClient(Client.ClientNum, "Server admins " + admins +" is on this server", true); } else { // Show that more than one admin present TellClient(Client.ClientNum, "Server admins " + admins +" are on this server", true); } } } } catch(Exception e) { // Wtf ServerPrint("Plugin ShowAdmins: OnSay catched exception: " + e.Message); } return ChatType.ChatContinue; } } }


Attached Files
.zip   ShowAdmins.zip (Size: 2.45 KB / Downloads: 150)
Reply

#8
Thanks a lot narkos Smile
Reply

#9
(08-19-2012, 11:29)narkos Wrote: Hello,

It uses the admins from permission plugin.

Installation:
- Extract the zip file attached.
- Put the .dll in the plugin folder.
- Add "!admins" to the command allowed in permission's plugin.

Source code:
Code:
using System; using System.Collections; using System.Collections.Generic; using System.Text; using Addon; namespace ShowAdmins { public class ShowAdmins: CPlugin { // List of admins xuids private ArrayList Admins_Xuids = new ArrayList(); // On Server load public override void OnServerLoad() { try { // Split the admins xuids from permission String[] Get_Admins = GetServerCFG("Permission", "Admin_xuids", "0").Split(','); // Loop the admijns list foreach (String admin in Get_Admins) { // Add the admin to the list this.Admins_Xuids.Add(admin); } // Indicate that the plugin is correctly loaded ServerPrint("Plugin ShowAdmins loaded!"); } catch(Exception e) { // Wtf ServerPrint("Plugin ShowAdmins: OnServerLoad catched exception: " + e.Message); } } // On Say public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat) { try { // If the message starts with !admins if (Message.StartsWith("!admins")) { // Will store the string with the admins String admins = ""; // Get the list of players List<ServerClient> Clients = GetClients(); // If the list is not null if (Clients != null) { // Needed to know the first admin added Boolean first = true; int Admins_nbr = 0; // Loop the player list foreach (ServerClient player in Clients) { // If the player is an admin if (Admins_Xuids.Contains(player.XUID)) { if (first) { // First admin to add admins += player.Name; first = false; } else { // Other admins admins += ", " + player.Name; } Admins_nbr++; } } if (Admins_nbr == 0) { // No admins TellClient(Client.ClientNum, "No admins on this server", true); } else if (Admins_nbr == 1) { // Show 1 admin present TellClient(Client.ClientNum, "Server admins " + admins +" is on this server", true); } else { // Show that more than one admin present TellClient(Client.ClientNum, "Server admins " + admins +" are on this server", true); } } } } catch(Exception e) { // Wtf ServerPrint("Plugin ShowAdmins: OnSay catched exception: " + e.Message); } return ChatType.ChatContinue; } } }


I Think i might add this to god plugin ...
Reply

#10
this is my code it will show u all the admins and mods online and insted of the text showing in the chat messgae it will show u in the HUD message

the command is
Quote:!admins

sv_config.ini settings
PHP Code:
//You can add more user groups here Usergroups=Admin,Moderator,User,Trainee_Moderator,Senior_Moderator //Add all xuids here (Go ingame and use !getxuid) Admin_xuids= Moderator_xuids= Trainee_Moderator_xuids= Senior_Moderator_xuids= //Add commands moderators can use here Admin_commands=*ALL* Moderator_commands= Trainee_Moderator_commands= Senior_Moderator_commands=
and the code is here

PHP Code:
using Addon; using System; using System.Collections; using System.Collections.Generic; namespace ShowAdmins { public class ShowAdmins : CPlugin { private ArrayList Admin_Xuids = new ArrayList(); private ArrayList Moderator_Xuids = new ArrayList(); private ArrayList Senior_Moderator_Xuids = new ArrayList(); private ArrayList Trainee_Moderator_Xuids = new ArrayList(); public override void OnServerLoad() { try { string[] array = base.GetServerCFG("Permission", "Admin_xuids", "0").Split(new char[] { ',' }); string[] array2 = base.GetServerCFG("Permission", "Moderator_xuids", "0").Split(new char[] { ',' }); string[] array3 = base.GetServerCFG("Permission", "Senior_Moderator_xuids", "0").Split(new char[] { ',' }); string[] array4 = base.GetServerCFG("Permission", "Trainee_Moderator_xuids", "0").Split(new char[] { ',' }); string[] array5 = array; for (int i = 0; i < array5.Length; i++) { string value = array5[i]; this.Admin_Xuids.Add(value); } string[] array6 = array2; for (int j = 0; j < array6.Length; j++) { string value2 = array6[j]; this.Moderator_Xuids.Add(value2); } string[] array7 = array3; for (int k = 0; k < array7.Length; k++) { string value3 = array7[k]; this.Senior_Moderator_Xuids.Add(value3); } string[] array8 = array4; for (int l = 0; l < array8.Length; l++) { string value4 = array8[l]; this.Trainee_Moderator_Xuids.Add(value4); } base.ServerPrint("Plugin ShowAdmins loaded!"); } catch (Exception ex) { base.ServerPrint("Plugin ShowAdmins: OnServerLoad catched exception: " + ex.Message); } } public override ChatType OnSay(string Message, ServerClient Client, bool TeamChat) { try { ChatType result; if (!Message.StartsWith("!admins")) { ChatType chatType = ChatType.ChatContinue; result = chatType; return result; } Message.Split(new char[] { ' ' }); string text = ""; List<ServerClient> clients = base.GetClients(); if (clients != null) { bool flag = true; int num = 0; foreach (ServerClient current in clients) { if (this.Admin_Xuids.Contains(current.XUID)) { if (flag) { text += current.Name; flag = false; } else { text = text + ", " + current.Name; } num++; } if (this.Moderator_Xuids.Contains(current.XUID)) { if (flag) { text += current.Name; flag = false; } else { text = text + ", " + current.Name; } num++; } if (this.Senior_Moderator_Xuids.Contains(current.XUID)) { if (flag) { text += current.Name; flag = false; } else { text = text + ", " + current.Name; } num++; } if (this.Trainee_Moderator_Xuids.Contains(current.XUID)) { if (flag) { text += current.Name; flag = false; } else { text = text + ", " + current.Name; } num++; } } if (num == 0) { base.iPrintLnBold("^2No Admins or Mods are ^1ONLINE^2 on this server", Client); } else { if (num == 1) { base.iPrintLnBold("^2Admin^1/^2Mod ^1[" + text + " ]^2is on this server", Client); } else { base.iPrintLnBold("^2Admins^1&^2 Mods^1[" + text + "]^2 are on this server", Client); } } } result = ChatType.ChatNone; return result; } catch (Exception ex) { base.ServerPrint("Plugin ShowAdmins: OnSay catched exception: " + ex.Message); } return ChatType.ChatContinue; } } }


Attached Files
.rar   ShowAdmins.rar (Size: 5.86 KB / Downloads: 58)
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Rainbow How can i add my private server in unranked? Geded12 6 10,482 12-06-2025, 08:25
Last Post: jackey78
  [Release] Windows 8.1 Fix for MW3 Server Addon master131 16 30,727 09-29-2014, 23:08
Last Post: SuperNovaAO
Brick [Release] MW3 Server Administration Addon iRoNinja 5 10,846 11-10-2013, 15:46
Last Post: Casper
Exclamation Help cmdlist, dvarlist server crash Nerus 17 16,410 11-09-2013, 23:54
Last Post: Nerus
  Our Level Fastfile is Different from the Server. CheeseToast 6 15,493 11-03-2013, 17:52
Last Post: CheeseToast
  Dedicated Server External (public) IP Nerus 3 9,542 11-02-2013, 14:16
Last Post: Casper
  MW3 Server Version superg1973 7 17,462 10-28-2013, 01:15
Last Post: kotyra972
  Help how to turn off map in dedicated server pero123 8 9,547 10-15-2013, 19:00
Last Post: Nekochan
  Issue with server addon and NAT dimitrifrom31 3 8,142 10-08-2013, 18:11
Last Post: iRoNinja
Question Help Admin menu koren30 4 6,707 10-07-2013, 20:17
Last Post: Yamato

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.