fixed issue with player chat message not sending if option enabled

This commit is contained in:
Lorenc Pekaj 2018-12-27 18:08:12 +11:00
parent 5c3445fd1c
commit d9129b600c
2 changed files with 11 additions and 7 deletions

View File

@ -31,7 +31,7 @@ static stock
g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = { g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = {
{ "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" }, { "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" },
{ "Prevent Auto-Save" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" }, { "Prevent Auto-Save" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" },
{ "Manual Pickup Weapon" }, { "Prevent Passive Mode" }, { "Display Chat ID's" } { "Manual Pickup Weapon" }, { "Prevent Passive Mode" }, { "Display User ID In Chat" }
}, },
bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ] bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ]
; ;

View File

@ -2033,14 +2033,18 @@ public OnPlayerText( playerid, text[ ] )
} }
} }
} }
DCC_SendChannelMessageFormatted( discordGeneralChan, "**%s(%d):** %s", ReturnPlayerName( playerid ), playerid, text ); // p_Class[ playerid ] == CLASS_POLICE ? 12 : 4 DCC_SendChannelMessageFormatted( discordGeneralChan, "**%s(%d):** %s", ReturnPlayerName( playerid ), playerid, text ); // p_Class[ playerid ] == CLASS_POLICE ? 12 : 4
foreach ( new iPlayer : Player ) // custom player id setting
{ foreach ( new iPlayer : Player ) {
if ( IsPlayerSettingToggled( iPlayer, SETTING_CHAT_ID ) ) if ( IsPlayerSettingToggled( iPlayer, SETTING_CHAT_ID ) ) {
return SendClientMessageFormatted( iPlayer, GetPlayerColor( playerid ), "%s(%d): "COL_WHITE"%s", ReturnPlayerName( playerid ), playerid, text ), 0; SendClientMessageFormatted( iPlayer, GetPlayerColor( playerid ), "%s(%d): "COL_WHITE"%s", ReturnPlayerName( playerid ), playerid, text );
} else {
SendPlayerMessageToPlayer( iPlayer, playerid, text );
}
} }
return 1; return 0;
} }
function RapeDamage( playerid ) function RapeDamage( playerid )