Merge pull request #60 from Sultan1337/chatban-fixex

chatban-fix
This commit is contained in:
Lorenc Pekaj 2019-06-25 15:33:53 +10:00 committed by GitHub
commit e9fa4c9d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -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 )

View File

@ -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
{