Заказать игровой сервер Контакты (заказать плагин/исправить ошибки/другое) Поиск

[ вход ]
[ последние сообщения ]

  • Страница 1 из 1
  • 1
Форум » SourceMod >> CS:Source >> CSGO » Обсуждение » Цвет
Цвет
Beelzebub Дата: Суббота, 01.12.2012, 13:40:30 | Сообщение # 1
Сообщений: 202
Репутация: 13 [ +/- ]
Вот пишу плагин и при выборе цвета письма в чате не меняется цвет.

Code
#define CHAT_LGREEN 2


Code
    public Action:Command_ColorsMenu(client, args)
{
   new Handle:colorsmenu = CreateMenu(ColorsMenu_Handler);
   SetMenuTitle(colorsmenu, "Chat Colors");

   new clientcolor = ClientColoredChat[client];

   if(clientcolor == CHAT_LGREEN)
   {
    AddMenuItem(colorsmenu, "white", "LGREEN (x)");
   }

Этот код от менюшки цвета.

Code
public ColorsMenu_Handler(Handle:menu, MenuAction:action, client, param)
{
   if (action == MenuAction_Select)
   {
    switch (param)
    {
     case 0: //default
     {
      ClientColoredChat[client] = CHAT_LGREEN;
     }


Code
public Action:Command_PlayerChat(client, args)   
{
   if(client != 0)
   {
    if(GetUserFlagBits(client) & ADMFLAG_RESERVATION)
    {
     if(ClientColoredChat[client] == CHAT_WHITE)
     {
      return Plugin_Continue;
     }
     else
     {
      decl String:sName[32], String:sText[192];
        
      GetClientName(client, sName, sizeof(sName));
      GetCmdArgString(sText, sizeof(sText));

      //Strip the quotes off
      new startidx = 0;
      if (sText[0] == '"')
      {
       startidx = 1;
       new len = strlen(sText);

       if (sText[len-1] == '"')
       {
        sText[len-1] = '\0';
       }
      }

      new String:sNewText[192];
      strcopy(sNewText, sizeof(sText), sText[startidx]);

      //Formats the message for display
      new String:sNewMessage[192];

      if(ClientColoredChat[client] == CHAT_LGREEN)
      {
       Format(sNewMessage, sizeof(sNewMessage), "%s%s : %s", "\x03", sName, sNewText);
       PrintToChatAll("%s", sNewMessage);
      }
        
      return Plugin_Handled;
     }
    }
   }

   return Plugin_Continue;
}



Code
stock SayText2All(author_index, const String:message[])
{
   for(new i=1;i<=MaxClients;i++)
   {
    if(IsClientInGame(i))
    {
     SayText2(i, author_index, message);
    }
   }
}


Сообщение отредактировал Beelzebub - Суббота, 01.12.2012, 17:28:37
 
Форум » SourceMod >> CS:Source >> CSGO » Обсуждение » Цвет
  • Страница 1 из 1
  • 1
Поиск: