ENG Text (Click to View)
RUS Text (Click to View)
Source code
PHP Code:
using System;
using Addon;
using System.IO;
using System.Collections.Generic;
namespace SC
{
public class Aliases : CPlugin
{
string path = "plugins\\aliases.txt";
string TextColor;
public override ChatType OnSay(string Message, ServerClient Client)
{
List<string> Names = new List<string>(File.ReadAllLines(path));
for (int i = 0; i < Names.Count; i++)
{
string line = Names[i];
string oldName = line.Split('=')[0];
string NewName = line.Split('=')[1];
if (!Message.StartsWith("!"))
{
if (oldName == Client.Name)
{
ServerSay(string.Format("{0}^7:^2 {1}", NewName, Message), true);
return ChatType.ChatNone;
}
}
}
return ChatType.ChatContinue;
}
}
}
Please write how to insert BB code to post "CSHARP code"
Credits:
@S3VDIT0 - Made the plugin
@frst_ - Special thanks