Помогите сделать

sadamark

Участник
Сообщения
9
Реакции
1
Кто может сделать так чтобы когда игрок пишет !кы или !rs в чате никто кроме него этого не видел. И чтобы писало что он сбросил счет только ему.. Исходник ниже.
 

Вложения

  • resetscore.sp
    2.9 КБ · Просмотры: 21

R1KO

fuck society
Сообщения
9,460
Реакции
7,799
  • Команда форума
  • #2
PHP:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_AUTHOR    "tuty & GoDtm666"
#define PLUGIN_VERSION    "1.3.1"
#pragma semicolon 1
new Handle:gPluginEnabled = INVALID_HANDLE;

public Plugin:myinfo =
{
    name = "ResetScore",
    author = PLUGIN_AUTHOR,
    description = "Type !resetscore in chat to reset your score.",
    version = PLUGIN_VERSION,
    url = "www.ligs.us"
};

public OnPluginStart()
{
    RegConsoleCmd( "say", CommandSay );
    RegConsoleCmd( "say_team", CommandSay );
    LoadTranslations("resetscore.phrases.txt");
    gPluginEnabled = CreateConVar( "sm_resetscore", "1" );
    CreateConVar( "resetscore_version", PLUGIN_VERSION, "Reset Score", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
}

public OnClientPutInServer(client)
{
    CreateTimer(15.0, TimerAnnounce, client);
}

public Action:TimerAnnounce(Handle:timer, any:client)
{
    if(IsClientInGame(client))
    {
        PrintToChat(client, "\x04Play Hard\x01 %t", "announce_chat");
    }
}

public Action:CommandSay( id, args )
{
    decl String:Said[ 128 ];
    GetCmdArgString( Said, sizeof( Said ) - 1 );
    StripQuotes( Said );
    TrimString( Said );
    if( StrEqual( Said, "!resetscore" ) || StrEqual( Said, "!restartscore" ) || StrEqual( Said, "!RDK" ) || StrEqual( Said, "!КВЛ" ) || StrEqual( Said, "!rdk" ) || StrEqual( Said, "!квл" ) || StrEqual( Said, "!кы" ) || StrEqual( Said, "!рс" ) || StrEqual( Said, "!рдк" ) || StrEqual( Said, "!rs" ) )
    {
        if( GetConVarInt( gPluginEnabled ) == 0 )
        {
            PrintToChat( id, "\x04Play Hard\x01 %t", "plugin_disabled_chat" );
            return Plugin_Handled;
        }
        if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
        {
            PrintToChat( id, "\x04Play Hard\x01 %t", "reset_already_chat");
            return Plugin_Handled;
        }
        SetClientFrags( id, 0 );
        SetClientDeaths( id, 0 );
        decl String:Name[ 32 ];
        GetClientName( id, Name, sizeof( Name ) - 1 );
        PrintToChat( id, "\x04Play Hard\x01 %t", "reset_chat");

		return Plugin_Handled;
    }
    return Plugin_Continue;
}

stock SetClientFrags( index, frags )
{
    SetEntProp( index, Prop_Data, "m_iFrags", frags );
    return 1;
}

stock SetClientDeaths( index, deaths )
{
    SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
    return 1;
}
 

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,756
когда игрок пишет !кы или !rs в чате никто кроме него этого не видел
Удали строки:
PHP:
        decl String:mesg[100];
        Format(mesg,sizeof(mesg),"\x04Play Hard\x01 %t", "reset_chat_all", "\x03", Name, "\x01");
        new Handle:hBf = StartMessageAll("SayText2");
        if (hBf != INVALID_HANDLE)
        {
            BfWriteByte(hBf, id);
            BfWriteByte(hBf, true);
            BfWriteString(hBf, mesg);
            EndMessage();
        }
 

sadamark

Участник
Сообщения
9
Реакции
1
PHP:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_AUTHOR    "tuty & GoDtm666"
#define PLUGIN_VERSION    "1.3.1"
#pragma semicolon 1
new Handle:gPluginEnabled = INVALID_HANDLE;

public Plugin:myinfo =
{
    name = "ResetScore",
    author = PLUGIN_AUTHOR,
    description = "Type !resetscore in chat to reset your score.",
    version = PLUGIN_VERSION,
    url = "www.ligs.us"
};

public OnPluginStart()
{
    RegConsoleCmd( "say", CommandSay );
    RegConsoleCmd( "say_team", CommandSay );
    LoadTranslations("resetscore.phrases.txt");
    gPluginEnabled = CreateConVar( "sm_resetscore", "1" );
    CreateConVar( "resetscore_version", PLUGIN_VERSION, "Reset Score", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
}

public OnClientPutInServer(client)
{
    CreateTimer(15.0, TimerAnnounce, client);
}

public Action:TimerAnnounce(Handle:timer, any:client)
{
    if(IsClientInGame(client))
    {
        PrintToChat(client, "\x04Play Hard\x01 %t", "announce_chat");
    }
}

public Action:CommandSay( id, args )
{
    decl String:Said[ 128 ];
    GetCmdArgString( Said, sizeof( Said ) - 1 );
    StripQuotes( Said );
    TrimString( Said );
    if( StrEqual( Said, "!resetscore" ) || StrEqual( Said, "!restartscore" ) || StrEqual( Said, "!RDK" ) || StrEqual( Said, "!КВЛ" ) || StrEqual( Said, "!rdk" ) || StrEqual( Said, "!квл" ) || StrEqual( Said, "!кы" ) || StrEqual( Said, "!рс" ) || StrEqual( Said, "!рдк" ) || StrEqual( Said, "!rs" ) )
    {
        if( GetConVarInt( gPluginEnabled ) == 0 )
        {
            PrintToChat( id, "\x04Play Hard\x01 %t", "plugin_disabled_chat" );
            return Plugin_Handled;
        }
        if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
        {
            PrintToChat( id, "\x04Play Hard\x01 %t", "reset_already_chat");
            return Plugin_Handled;
        }
        SetClientFrags( id, 0 );
        SetClientDeaths( id, 0 );
        decl String:Name[ 32 ];
        GetClientName( id, Name, sizeof( Name ) - 1 );
        PrintToChat( id, "\x04Play Hard\x01 %t", "reset_chat");

		return Plugin_Handled;
    }
    return Plugin_Continue;
}

stock SetClientFrags( index, frags )
{
    SetEntProp( index, Prop_Data, "m_iFrags", frags );
    return 1;
}

stock SetClientDeaths( index, deaths )
{
    SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
    return 1;
}


Спасибо работает! никто не видит! Подскажи как убрать фразу
Play Hard Patriot обнулил свой счёт.
А то пишет:
Play Hard Вы успешно обнулили свой счёт!
Play Hard Patriot обнулил свой счёт.
 

R1KO

fuck society
Сообщения
9,460
Реакции
7,799
  • Команда форума
  • #6
ну посмтри в исходнике
там же видно эти фразы
 

sadamark

Участник
Сообщения
9
Реакции
1
Спасибо!)
 
Последнее редактирование:
Сверху Снизу