From af8fad34ed1e7ec64dee3c81f3974486d6acb0aa Mon Sep 17 00:00:00 2001 From: Stev Date: Wed, 26 Dec 2018 10:02:48 +0000 Subject: [PATCH] displaying ID in global chat changeable in settings /cp --- gamemodes/irresistible/cnr/commands/admin/_admin.pwn | 2 +- gamemodes/irresistible/cnr/commands/admin/admin_three.pwn | 2 +- .../irresistible/cnr/features/player/player_settings.pwn | 8 ++++---- gamemodes/sf-cnr.pwn | 6 ++++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index fb2a964..68c1e89 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -74,7 +74,7 @@ static stock { 2, "/kick", "Kicking a player from the server" }, /* ** Level 3 Commands ** */ - { 3, "/banlog", "Finding ban information about a player"} + { 3, "/banlog", "Finding ban information about a player" }, { 3, "/smlog", "Cash transaction log from a player" }, { 3, "/iclog", "IC transaction log from a player" }, { 3, "/resetwep", "Resetting weapons from a player" }, diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn index a8c1b5f..1127bd2 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn @@ -565,7 +565,7 @@ thread OnPlayerBanLog( playerid, const Name[ ] ) ban_reason[ 80 ], ban_by[ 24 ], ban_date, - ban_expire, + ban_expire ; for ( new row = 0; row < rows; row ++ ) diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index b410721..0ec67ac 100644 --- a/gamemodes/irresistible/cnr/features/player/player_settings.pwn +++ b/gamemodes/irresistible/cnr/features/player/player_settings.pwn @@ -9,7 +9,7 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define MAX_SETTINGS ( 13 ) +#define MAX_SETTINGS ( 14 ) #define SETTING_BAILOFFERS ( 0 ) #define SETTING_EVENT_TP ( 1 ) @@ -24,13 +24,14 @@ #define SETTING_TOP_DONOR ( 10 ) #define SETTING_WEAPON_PICKUP ( 11 ) #define SETTING_PASSIVE_MODE ( 12 ) +#define SETTING_CHAT_ID ( 13 ) /* ** Variables ** */ static stock g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = { { "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" }, - { "Manual Pickup Weapon" }, { "Prevent Passive Mode" } + { "Manual Pickup Weapon" }, { "Prevent Passive Mode" }, { "Display Chat ID's" } }, bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ] ; @@ -160,7 +161,7 @@ CMD:passive( playerid, params[ ] ) return 1; } -CMD:passivelist( playerid, params[ ]) +CMD:passivelist( playerid, params[ ] ) { new count = 0; @@ -187,7 +188,6 @@ stock IsPlayerSettingToggled( playerid, settingid ) { return p_PlayerSettings[ playerid ] { settingid }; } - stock IsPlayerVIPSkinToggled( playerid ) { return p_PlayerSettings[ playerid ] { SETTING_VIPSKIN }; } diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 7928e8e..8f8c9d2 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -2011,6 +2011,12 @@ public OnPlayerText( playerid, text[ ] ) } } DCC_SendChannelMessageFormatted( discordGeneralChan, "**%s(%d):** %s", ReturnPlayerName( playerid ), playerid, text ); // p_Class[ playerid ] == CLASS_POLICE ? 12 : 4 + + foreach ( new iPlayer : Player ) + { + if ( IsPlayerSettingToggled( iPlayer, SETTING_CHAT_ID ) ) + return SendClientMessageFormatted( iPlayer, GetPlayerColor( playerid ), "%s(%d): "COL_WHITE"%s", ReturnPlayerName( playerid ), playerid, text ), 0; + } return 1; }