Posts: 2
Threads: 0
Joined: May 2012
Reputation:
0
05-29-2012, 02:06
(This post was last modified: 05-29-2012, 02:08 by Devilion.)
Quote:[ASCIIName]
//Command to be executed, kickClient, tempBanClient or banClient
Command=kickClient
//Message to be displayed when an action is taken, valid placeholders {0} - name and {1} xuid
ServerMsg=User was name bad!
//Message to be displayed to the client who is being kicked
CommandMsg=Change you name (use 0-9 and a-Z)
CommandMsg1=Same ID,Change you ID
badPlayers_xuid=xuid6,xuid7,xuid8
//example:badPlayers_xuid=0110000112181148,01100001707af3ec,0110000123862132,011000012c512cb2
i need to autokick xuid 0000000000000000
it really annoying, it always cause all being ban.[/quote]
Posts: 13
Threads: 1
Joined: Mar 2012
Reputation:
1
05-31-2012, 08:00
(This post was last modified: 05-31-2012, 09:10 by jiuweiljp.)
sorry for my poor english.
modify version
-------sv_config.ini---------
Code: [ASCIIName]
//Command to be executed, kickClient, tempBanClient or banClient
Command=dropclient
//Message to be displayed to the client who is being kicked
CommandMsg=Change you name (use 0-9 and a-Z)
//message to be dispalyed to the xuid e70d9398 deny connect
CommandMsg1=Error ID,Please change you ID.
//deny bad xuid connect
badPlayers_xuid=0110000112181148,01100001707af3ec,0110000123862132,0110000100000000
--------source code--------
Code: using System;
using System.Collections.Generic;
//using System.Collections;
using System.Text;
//using System.IO;
//using System.Threading;
//using System.Timers;
using Addon;
namespace ASCIIName
{
public class Class_Asciiname : CPlugin
{
string command = "dropClient";
string commandMsg = string.Empty;
string commandMsg1 = string.Empty;
string commandMsg2 = "You is a bad Player,deny connect";
string badPlayers1 = "01100001e70d9398";
List<string> badPlayers = new List<string>();
List<string> allplayers = new List<string>();
List<string> allplayers_name = new List<string>();
List<ServerClient> clientss = new List<ServerClient>();
public override void OnServerLoad()
{
try
{
ServerPrint("ASCIIName loaded Author: zxz0O0 Thanks to Nukem, Jariz and Pozzuh\n and AntiInvisibleName plug mod ljp");
command = GetServerCFG("ASCIIName", "Command", "dropClient");
}
catch (Exception e)
{
ServerPrint(e.Message.ToString());
}
}
public override void OnPlayerConnect(ServerClient Client)
{
commandMsg = GetServerCFG("ASCIIName", "CommandMsg", string.Empty);
if (Encoding.UTF8.GetByteCount(Client.Name) != Client.Name.Length)
{
ServerPrint("ASCIIName executed: " + command + " " + Client.Name + " \"" + commandMsg + "\"");
ServerCommand(command + " " + Client.ClientNum + " \"" + commandMsg + "\"");
}
else if (Array.Exists(Client.Name.ToCharArray(), c => (int)c <= 31) || Array.Exists(Client.Name.ToCharArray(), c => (int)c >= 191) )
{
ServerPrint("ASCIIName executed Invisible name: " + command + " " + Client.Name + " \"" + commandMsg + "\"");
ServerCommand(command + " " + Client.ClientNum + " \"" + commandMsg + "\"");
}
if (!allplayers.Contains(Client.XUID) || !allplayers_name.Contains(Client.Name))
{
allplayers.Add(Client.XUID);
allplayers_name.Add (Client.Name);
ServerSay("^7[^1NOTICE!^7] Player: ^3" + Client.Name + "^7 has connected!", false);
}
else
{
ServerSay("^7[^2Welcome!^7] Player: ^3" + Client.Name + "^7 has Reconnected!", false);
}
}
public override string OnCheckBan(string xuidd)
{
commandMsg1 = GetServerCFG("ASCIIName", "CommandMsg1", string.Empty);
string badPlayersXUID = GetServerCFG("ASCIIName","badPlayers_xuid", "");
if(!badPlayersXUID.Equals(""))
{
badPlayers = new List<string>(badPlayersXUID.ToLower().Split(','));
}
ServerPrint ("xuidd is " + xuidd + " try connect");
if (badPlayers1.Equals(xuidd))
{
ServerSay("^7Player[E70D].xuid: ^3" + badPlayers1 + "^7 Deny connect!", false);
return commandMsg1;
}
foreach ( string bad in badPlayers )
{
if(bad.Equals(xuidd))
{
ServerSay("^7Player.xuid[Bad]: ^3" + bad + "^7 Deny connect!", false);
return commandMsg2;
}
}
clientss = GetClients();
foreach (ServerClient game_boy in clientss)
{
if (game_boy.Name != "")
ServerPrint ("Xuid "+ game_boy.XUID + " Name " + game_boy.Name + " Ping " + game_boy.Ping + " CLient_Num " + game_boy.ClientNum);
if (game_boy.Name != "" && game_boy.XUID == xuidd)
{
ServerSay("^7Same.xuid in game ^3" + xuidd + "^7 Deny connect! ", false);
iPrintLnBold ("^1[Warn:] ^3Have same ID player try connect to server",game_boy);
return "Sorry! Same ID players in game,you change ID try connect.";
}
}
clientss.Clear();
return null;
}
}
}
AntiInvisibleName.rar (Size: 3.29 KB / Downloads: 147)
Posts: 13
Threads: 1
Joined: Mar 2012
Reputation:
1
(05-29-2012, 02:06)Devilion Wrote: Quote:[ASCIIName]
//Command to be executed, kickClient, tempBanClient or banClient
Command=kickClient
//Message to be displayed when an action is taken, valid placeholders {0} - name and {1} xuid
ServerMsg=User was name bad!
//Message to be displayed to the client who is being kicked
CommandMsg=Change you name (use 0-9 and a-Z)
CommandMsg1=Same ID,Change you ID
badPlayers_xuid=xuid6,xuid7,xuid8
//example:badPlayers_xuid=0110000112181148,01100001707af3ec,0110000123862132,011000012c512cb2
i need to autokick xuid 0000000000000000
it really annoying, it always cause all being ban. [/quote]
Are you sure xuid is 0000000000000000
Posts: 14
Threads: 4
Joined: Jan 2011
Reputation:
0
can you give me a plugin, but these messages are not displayed, because teasing
ServerSay("^7[^1NOTICE!^7] Player: ^3" + Client.Name + "^7 has connected!", false);
ServerSay("^7[^2Welcome!^7] Player: ^3" + Client.Name + "^7 has Reconnected!", false);
???????????????????????????????????????????????????????????????????????????????
Posts: 7
Threads: 2
Joined: Apr 2013
Reputation:
0
|