From b1c708bf819cb717afefdd72c1d59b0a84d4b8b8 Mon Sep 17 00:00:00 2001 From: Sultan1337 Date: Mon, 24 Jun 2019 14:52:30 -0700 Subject: [PATCH] chatban-fix fixes --- gamemodes/irresistible/cnr/features/cop/cop_chat.pwn | 5 +++-- gamemodes/sf-cnr.pwn | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/cop/cop_chat.pwn b/gamemodes/irresistible/cnr/features/cop/cop_chat.pwn index c00bd4a..44f9f18 100644 --- a/gamemodes/irresistible/cnr/features/cop/cop_chat.pwn +++ b/gamemodes/irresistible/cnr/features/cop/cop_chat.pwn @@ -76,7 +76,7 @@ hook OnPlayerText( playerid, text[ ] ) { if ( text[ 0 ] == '!' && ! IsPlayerSettingToggled( playerid, SETTING_CHAT_PREFIXES ) ) { - if ( p_Class[ playerid ] == CLASS_POLICE ) + if ( p_Class[ playerid ] == CLASS_POLICE && ! IsPlayerChatBanned ( playerid ) ) { format( szBigString, 144, "%s", text ); @@ -109,7 +109,8 @@ CMD:t( playerid, params[ ] ) ; if ( GetPlayerClass( playerid ) != CLASS_POLICE ) return SendError( playerid, "Only police can use this command!" ); - else if ( sscanf( params, "s[90]", msg ) ) return SendUsage( playerid, "/t [MESSAGE]" ); + else if ( IsPlayerChatBanned( playerid ) ) return SendError( playerid, "You can not use this feature as you are chat banned." ); + else if ( sscanf( params, "s[90]", msg ) ) return SendUsage( playerid, "/t [MESSAGE]" ); else { if ( p_Class[ playerid ] == CLASS_POLICE ) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 5bc179d..da4c29d 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -1624,7 +1624,7 @@ public OnPlayerText( playerid, text[ ] ) DCC_SendChannelMessageFormatted( discordChatChan, "**[%s] (VIP) %s(%d):** %s", getCurrentTime(), ReturnPlayerName( playerid ), playerid, text[ 1 ] ); SendClientMessageToAllFormatted( 0x3eff3eff, "[VIP] %s(%d):{9ec34f} %s", ReturnPlayerName( playerid ), playerid, text[ 1 ] ); return 0; - } + } } case '$': { @@ -2242,6 +2242,7 @@ CMD:vsay( playerid, params[ ] ) ; if ( p_VIPLevel[ playerid ] < 1 ) return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); + else if ( IsPlayerChatBanned( playerid ) ) return SendError( playerid, "You have been chat banned and are not allowed to chat." ); else if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/vsay [MESSAGE]" ); else if ( textContainsIP( msg ) ) return SendServerMessage( playerid, "Please do not advertise." ); else @@ -3378,6 +3379,7 @@ CMD:me( playerid, params[ ] ) new action[70]; if ( p_Muted{ playerid } == true && g_iTime < p_MutedTime[ playerid ] ) return SendError( playerid, "You cannot use this feature as you are muted." ); else if ( GetPlayerScore( playerid ) < 25 ) return SendError( playerid, "You need at least 25 score to use this feature (spamming purposes)." ); + else if ( IsPlayerChatBanned( playerid ) ) return SendError( playerid, "You have been chat banned and are not allowed to chat." ); else if ( sscanf( params, "s[70]", action ) ) return SendUsage( playerid, "/me [ACTION]" ); else {