Sourcebans prefix

KENEZEZ

Участник
Сообщения
43
Реакции
3
Здравствуйте. Подскажите, пожалуйста, где можно изменить данный префикс?
Все что нашел в sourcebans:
C-подобный:
stock void PrepareBan(int client, int target, int time, char[] reason, int size)
{
    #if defined DEBUG
    LogToFile(logFile, "PrepareBan()");
    #endif
    if (!target || !IsClientInGame(target))
        return;
    char authid[64], name[32], bannedSite[512];
    if (!GetClientAuthId(target, AuthId_Steam2, authid, sizeof(authid)))
        return;
    GetClientName(target, name, sizeof(name));


    if (CreateBan(client, target, time, reason))
    {
        if (!time)
        {
            if (reason[0] == '\0')
            {
                CShowActivity(client, "%t", "Permabanned player", name);
            } else {
                CShowActivity(client, "%t", "Permabanned player reason", name, reason);
            }
        } else {
            if (reason[0] == '\0')
            {
                CShowActivity(client, "%t", "Banned player", name, time);
            } else {
                CShowActivity(client, "%t", "Banned player reason", name, time, reason);
            }
        }
        LogAction(client, target, "\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", client, target, time, reason);

        if (time > 5 || time == 0)
            time = 5;
        Format(bannedSite, sizeof(bannedSite), "%T", "Banned Check Site", target, WebsiteAddress);
        BanClient(target, time, BANFLAG_AUTO, bannedSite, bannedSite, "sm_ban", client);
    }

    g_BanTarget[client] = -1;
    g_BanTime[client] = -1;
}

И это:
C-подобный:
if (!time)
    {
        if (Reason[0] == '\0')
        {
            CShowActivityEx(admin, Prefix, "%t", "Permabanned player", Name);
        } else {
            CShowActivityEx(admin, Prefix, "%t", "Permabanned player reason", Name, Reason);
        }
    } else {
        if (Reason[0] == '\0')
        {
            CShowActivityEx(admin, Prefix, "%t", "Banned player", Name, time);
        } else {
            CShowActivityEx(admin, Prefix, "%t", "Banned player reason", Name, time, Reason);
        }
    }

    LogAction(admin, client, "\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", admin, client, time, Reason);

    if (PlayerDataPack[admin] != INVALID_HANDLE)
    {
        CloseHandle(PlayerDataPack[admin]);
        CloseHandle(ReasonPack);
        PlayerDataPack[admin] = INVALID_HANDLE;
    }

    // Kick player
    if (GetClientUserId(client) == UserId)
        KickClient(client, "%t", "Banned Check Site", WebsiteAddress);
}
Но префикс он берет с другого плагина, видимо, и никак не пойму с какого
 

Вложения

  • Снимок123.PNG
    Снимок123.PNG
    28.1 КБ · Просмотры: 59

KENEZEZ

Участник
Сообщения
43
Реакции
3
Ну ты сам посмотри код, что ты сюда прикрепил, там сразу видны переводы или мультиязычность
Ну, если ни в одном переводчике
Сообщения автоматически склеены:

Если ты про [SM] , то он вшит в ShowActivity
То есть, никак не изменить?
 

ZizionarD

Участник
Сообщения
596
Реакции
66
@KENEZEZ, пробуй так:
1. Изменить #define SERVER_TAG "[\x0CMy Server Tag\x01]" на свое
2. Скомпилировать плагин
3. ПРОФИТ!!!
C-подобный:
/* Colors available=>
\x01 = default
\x02 = darkred
\x03 = purple/teamcolor (idk)
\x04 = green
\x05 = lightgreen
\x06 = lime
\x07 = red
\x08 = grey
\x09 = yellow
\x0A = bluegrey
\x0B = blue
\x0C = darkblue
\x0D = grey2
\x0E = orchid
\x0F = lightred
\x10 = gold
*/
#include <sourcemod>

#pragma semicolon 1

#define MAXTEXTCOLORS 100

#define SERVER_TAG "[\x0CMy Server Tag\x01]"

// Plugin definitions
#define PLUGIN_VERSION "1.0"

public Plugin:myinfo =
{
    name = "Default SM Text Replacer",
    author = "Mitch/Bacardi/Cruze",
    description = "Replaces the '[SM]' text with more color!",
    version = PLUGIN_VERSION,
    url = ""
};



public OnPluginStart()
{
    HookUserMessage(GetUserMessageId("TextMsg"), TextMsg, true);
}
public Action:TextMsg(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
{
    if(reliable)
    {
        new String:buffer[256];
        PbReadString(bf, "params", buffer, sizeof(buffer), 0);
        if(StrContains(buffer, "[SM]") == 0)
        {
            new Handle:pack;
            CreateDataTimer(0.0, timer_strip, pack);

            WritePackCell(pack, playersNum);
            for(new i = 0; i < playersNum; i++)   
            {
                WritePackCell(pack, players[i]);
            }
            WritePackString(pack, buffer);
            ResetPack(pack);
            return Plugin_Handled;
        }
    }
    return Plugin_Continue;
}

public Action:timer_strip(Handle:timer, Handle:pack)
{
    new playersNum = ReadPackCell(pack);
    new players[playersNum];
    new client, count;

    for(new i = 0; i < playersNum; i++)
    {
        client = ReadPackCell(pack);
        if(IsClientInGame(client))
        {
            players[count++] = client;
        }
    }

    if(count < 1) return;
    
    playersNum = count;
    
    new String:buffer[255];
    ReadPackString(pack, buffer, sizeof(buffer));
    new String:QuickFormat[255];
    Format(QuickFormat, sizeof(QuickFormat), "%s", SERVER_TAG);
    ReplaceStringEx(buffer, sizeof(buffer), "[SM]", QuickFormat);
    
    new Handle:bf = StartMessage("SayText2", players, playersNum, USERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
    //BfWriteString(bf, buffer);
    PbSetInt(bf, "ent_idx", -1);
    PbSetBool(bf, "chat", true);
    PbSetString(bf, "msg_name", buffer);
    PbAddString(bf, "params", "");
    PbAddString(bf, "params", "");
    PbAddString(bf, "params", "");
    PbAddString(bf, "params", "");
    EndMessage();
}
 
Сверху Снизу