ItsMods

Full Version: Aliases nicknames
You're currently viewing a stripped down version of our content. View the full version with proper formatting.


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 MessageServerClient Client)
        {
            List<
stringNames = new List<string>(File.ReadAllLines(path));

            for (
int i 0Names.Counti++)
            {
                
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}"NewNameMessage), 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