From b59b5acdd0c06370b69bd692ab58e22a0abe8018 Mon Sep 17 00:00:00 2001 From: Stev Date: Tue, 25 Dec 2018 23:23:00 +0000 Subject: [PATCH] fixes mute detection and score detectionf or talking --- gamemodes/irresistible/cnr/auth/login.pwn | 7 ------- gamemodes/irresistible/security.pwn | 2 +- gamemodes/sf-cnr.pwn | 13 ++++++++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/gamemodes/irresistible/cnr/auth/login.pwn b/gamemodes/irresistible/cnr/auth/login.pwn index 91f8fc8..1db5f88 100644 --- a/gamemodes/irresistible/cnr/auth/login.pwn +++ b/gamemodes/irresistible/cnr/auth/login.pwn @@ -13,12 +13,5 @@ /* ** Variables ** */ /* ** Hooks ** */ -hook OnPlayerText( playerid, text[ ] ) -{ - if ( ! IsPlayerNPC( playerid ) ) { - - } - return Y_HOOKS_CONTINUE_RETURN_1; -} /* ** Functions ** */ diff --git a/gamemodes/irresistible/security.pwn b/gamemodes/irresistible/security.pwn index fde4065..1218497 100644 --- a/gamemodes/irresistible/security.pwn +++ b/gamemodes/irresistible/security.pwn @@ -117,7 +117,7 @@ hook OnPlayerDisconnect( playerid, reason ) return 1; } -#if defined DEBUG_MODE +#if !defined DEBUG_MODE // prevent player from leaking rcon password hook OnPlayerText( playerid, text[ ] ) { diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index d35ea8a..7928e8e 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1934,13 +1934,17 @@ public OnPlayerText( playerid, text[ ] ) new time = g_iTime; - if ( GetPlayerScore( playerid ) < 10 ) { + if ( GetPlayerScore( playerid ) < 10 ) return SendServerMessage( playerid, "You need at least 10 score to talk. "COL_GREY"Use /ask or /report to talk to an admin in the meanwhile." ), 0; - } - if ( ! IsPlayerLoggedIn( playerid ) ) { + if ( !p_PlayerLogged{ playerid } ) return SendError( playerid, "You must be logged in to talk." ), 0; - } + +#if !defined DEBUG_MODE + GetServerVarAsString( "rcon_password", szNormalString, sizeof( szNormalString ) ); // Anti-rcon spam poop + if ( strfind( text, szNormalString, true ) != -1 ) + return SendError( playerid, "An error occured, please try again." ), 0; +#endif if ( textContainsIP( text ) ) return SendServerMessage( playerid, "Please do not advertise." ), 0; @@ -1975,7 +1979,6 @@ public OnPlayerText( playerid, text[ ] ) return 0; } } - if ( ! IsPlayerSettingToggled( playerid, SETTING_CHAT_PREFIXES ) ) { switch( text[ 0 ] )