04-06-2012, 16:32
My version of it. Only allows ASCII characters.
Options are
CSHARP Code
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Addon;
-
- namespace ASCIIName
- {
- public class Class1 : CPlugin
- {
- string command = "kickClient";
- string commandMsg = string.Empty;
- string srvMsg = string.Empty;
-
- public override void OnServerLoad()
- {
- try
- {
- ServerPrint("\n ASCIIName loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz and Pozzuh\n");
- ServerPrint(" youtube.com/zxz0O0 \n itsmods.com\n");
-
- command = GetServerCFG("ASCIIName", "Command", "kickClient");
- srvMsg = GetServerCFG("ASCIIName", "ServerMsg", string.Empty);
- commandMsg = GetServerCFG("ASCIIName", "CommandMsg", string.Empty);
- }
- catch (Exception e)
- {
- ServerPrint(e.Message);
- }
- }
-
- public override void OnPlayerConnect(ServerClient Client)
- {
- if (Encoding.UTF8.GetByteCount(Client.Name) != Client.Name.Length)
- {
- if (!string.IsNullOrEmpty(srvMsg))
- ServerSay(string.Format(srvMsg, Client.Name, Client.XUID), false);
- ServerPrint("ASCIIName executed: " + command + " " + Client.ClientNum + " \"" + commandMsg + "\"");
- ServerPrint("ASCIIName Name was: " + Client.Name);
- ServerCommand(command + " " + Client.ClientNum + " \"" + commandMsg + "\"");
- }
- }
- }
- }
Options are
Code:
[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=
//Message to be displayed to the client who is being kicked
CommandMsg=