diff --git a/core/ChatTriggers.cpp b/core/ChatTriggers.cpp index c0b00aae..cf6baa36 100644 --- a/core/ChatTriggers.cpp +++ b/core/ChatTriggers.cpp @@ -185,12 +185,21 @@ void ChatTriggers::OnSayCommand_Pre() { CCommand command; #endif - int client = g_ConCmds.GetCommandClient(); + int client; + CPlayer *pPlayer; + + client = g_ConCmds.GetCommandClient(); m_bIsChatTrigger = false; m_bWasFloodedMessage = false; /* The server console cannot do this */ - if (client == 0) + if (client == 0 || (pPlayer = g_Players.GetPlayerByIndex(client)) == NULL) + { + RETURN_META(MRES_IGNORED); + } + + /* We guarantee the client is connected */ + if (!pPlayer->IsConnected()) { RETURN_META(MRES_IGNORED); } diff --git a/plugins/antiflood.sp b/plugins/antiflood.sp index c965745a..ae39c1e6 100644 --- a/plugins/antiflood.sp +++ b/plugins/antiflood.sp @@ -72,8 +72,6 @@ public bool:OnClientFloodCheck(client) return false; } - PrintToServer("OCFC: %f %f %d", g_LastTime[client], GetGameTime(), g_FloodTokens[client]); - if (g_LastTime[client] > GetGameTime()) { /* If player has 3 or more flood tokens, block their message */ @@ -97,8 +95,6 @@ public OnClientFloodResult(client, bool:blocked) new Float:curTime = GetGameTime(); new Float:newTime = curTime + max_chat; - PrintToServer("OCFR: %f, %f", g_LastTime[client], GetGameTime()); - if (g_LastTime[client] > curTime) { /* If the last message was blocked, update their time limit */