Drixevel-Archive / Chat-Processor

A Sourcemod plugin which allows other plugins to add and manage chat related features.
GNU General Public License v3.0
58 stars 28 forks source link

No messages #15

Closed matijafistric closed 7 years ago

matijafistric commented 7 years ago

After i updated to 2.0.3 nobody can see messages in chat, on version 2.0.2 everybody but author could see them but now nobody can. I'm on version 1.1.0 right now cause its seems to be working except there is thousands of lines of OnSayText2 error everyday and it doesn't work like specified in .cfg file but at least people can talk in chat. Any response will be appreciated.

Drixevel-Archive commented 7 years ago

Not sure how to replicate the bug with 2.0.3 since it sprung up once then when I started debugging, disappeared. Any info on this bug would be helpful.

matijafistric commented 7 years ago

Since im on version 1.1.0 and plugins are made for higher than that, i cant use couple of things, in example: -myjailbreak things that require answering in chat(math and so on) -hl_gangs - cant create a gang cause it doesnt recognize what i type in chat

Those are most critical ones thats why i named them, if you can help in any way or have any idea how to fix it i would greatly appreciate it.

shanapu commented 7 years ago

Since im on version 1.1.0 and plugins are made for higher than that, i cant use couple of things, in example: -myjailbreak things that require answering in chat(math and so on)

if you still wana use 1.1.x for whatever reason. you can edit myjailbreak & compile it to fit with old chat-processor versions.

  1. download chat-processors old inc file. https://github.com/Drixevel/Chat-Processor/raw/458e496ca5925e0c1a90bea4f1dd3e0ff9f728fa/scripting/include/chat-processor.inc
  2. undo the changes for math.sp & playertags.sp https://github.com/shanapu/MyJailbreak/commit/997fb405e9b0f19113d8449efd367cd5ebaad726
  3. compile https://github.com/shanapu/MyJailbreak/wiki/Compile-MyJailbreak
  4. profit
matijafistric commented 7 years ago

My intention is to fix problems with chat processor, not trying to adapt to problems and the only reason im still on 1.1.0 is that if i update CP it brings all kinds of problems with it.

Thanks for suggestion though

Kxnrl commented 7 years ago

if remove bNewChat var , author will see double chat, but othersis normal.

Kxnrl commented 7 years ago

L 02/20/2017 - 09:57:23: [chat-processor.smx] Before total 1 L 02/20/2017 - 09:57:23: [chat-processor.smx] PushArrayCell 0.Misaka senpai

playersNum always is 1

Kxnrl commented 7 years ago

this work fine.. temp fix. `

int target_list[MAXPLAYERS+1], target_count;
bool m_bChatAll = GetChatType(m_szFlag);

if(IsPlayerAlive(m_iSender))
{
    if(m_bChatAll)
    {
        for(int i = 1; i<= MaxClients; ++i)
            if(IsClientInGame(i) && i != m_iSender)
                target_list[target_count++] = i;
    }
    else
    {
        for(int i = 1; i<= MaxClients; ++i)
            if(IsClientInGame(i) && i != m_iSender && GetClientTeam(i) == GetClientTeam(m_iSender))
                target_list[target_count++] = i;
    }
}
else
{
    switch(GetConVarInt(FindConVar("sv_deadtalk")))
    {
        case 0:
        {
            if(!m_bChatAll)
            {
                for(int i = 1; i<= MaxClients; ++i)
                    if(IsClientInGame(i) && !IsPlayerAlive(i) && i != m_iSender && GetClientTeam(i) == GetClientTeam(m_iSender))
                        target_list[target_count++] = i;
            }
            else
            {
                for(int i = 1; i<= MaxClients; ++i)
                    if(IsClientInGame(i) && !IsPlayerAlive(i) && i != m_iSender)
                        target_list[target_count++] = i;
            }
        }
        case 1:
        {
            if(!m_bChatAll)
            {
                for(int i = 1; i<= MaxClients; ++i)
                    if(IsClientInGame(i) && !IsPlayerAlive(i) && i != m_iSender && GetClientTeam(i) == GetClientTeam(m_iSender))
                        target_list[target_count++] = i;
            }
            else
            {
                for(int i = 1; i<= MaxClients; ++i)
                    if(IsClientInGame(i) && !IsPlayerAlive(i) && i != m_iSender)
                        target_list[target_count++] = i;
            }

        }
        case 2:
        {
            if(!m_bChatAll)
            {
                for(int i = 1; i<= MaxClients; ++i)
                    if(IsClientInGame(i) && i != m_iSender && GetClientTeam(i) == GetClientTeam(m_iSender))
                        target_list[target_count++] = i;
            }
            else
            {
                for(int i = 1; i<= MaxClients; ++i)
                    if(IsClientInGame(i) && i != m_iSender)
                        target_list[target_count++] = i;
            }
        }
    }
}

Handle bf = StartMessageEx(MsgId, target_list, target_count, USERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
PbSetInt(bf, "ent_idx", m_iSender);
PbSetBool(bf, "chat", m_bChat);
PbSetString(bf, "msg_name", m_szBuffer);
PbAddString(bf, "params", "");
PbAddString(bf, "params", "");
PbAddString(bf, "params", "");
PbAddString(bf, "params", "");
EndMessage();

`

and

` stock bool GetChatType(const char[] flag) { if(StrContains(flag, "_All") != -1) return true;

return false;

} `

Drixevel-Archive commented 7 years ago

Pushed a fix for this bug, probably needs more testing.

Kxnrl commented 7 years ago

yeap. I pushed a pull request.