From 43303726de8a1d442a3c4a5736c920cf63174f5b Mon Sep 17 00:00:00 2001 From: Damen Date: Tue, 9 Apr 2019 01:40:28 -0400 Subject: [PATCH] adds 'hide gambling win msgs' setting in cp --- .../irresistible/cnr/features/player/player_settings.pwn | 5 +++-- gamemodes/irresistible/cnr/features/visage/blackjack.pwn | 8 ++++++-- gamemodes/irresistible/cnr/features/visage/roulette.pwn | 6 +++++- .../irresistible/cnr/features/visage/slot_machines.pwn | 7 ++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index fed63e4..3208cd2 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 ( 12 ) +#define MAX_SETTINGS ( 13 ) #define SETTING_BAILOFFERS ( 0 ) #define SETTING_EVENT_TP ( 1 ) @@ -23,13 +23,14 @@ #define SETTING_COINS_BAR ( 9 ) #define SETTING_TOP_DONOR ( 10 ) #define SETTING_WEAPON_PICKUP ( 11 ) +#define SETTING_HIDE_GAMB_MSG ( 12 ) /* ** Variables ** */ static stock g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = { { "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" }, { "Display User ID In Chat" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" }, - { "Manual Pickup Weapon" } + { "Manual Pickup Weapon" }, { "Hide Gambling Win Msgs" } }, bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ] ; diff --git a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn index b57c66f..0a2d1bb 100644 --- a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn +++ b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn @@ -627,8 +627,12 @@ stock CheckForBlackjack( tableid ) // alert world if ( g_blackjackPlayerState[ tableid ] [ player_index ] == BLACKJACK_STATE_WIN && payout > g_blackjackData[ tableid ] [ E_PAYOUT ] && payout >= 10000 ) { UpdateServerVariable( "blackjack_wins", 0, GetGVarFloat( "blackjack_wins" ) + ( float( payout ) / 1000000.0 ), "", GLOBAL_VARTYPE_FLOAT ); - SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); - } + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); + } + } } } return dealer_score; diff --git a/gamemodes/irresistible/cnr/features/visage/roulette.pwn b/gamemodes/irresistible/cnr/features/visage/roulette.pwn index 40a3953..d509f1e 100644 --- a/gamemodes/irresistible/cnr/features/visage/roulette.pwn +++ b/gamemodes/irresistible/cnr/features/visage/roulette.pwn @@ -686,7 +686,11 @@ public OnRouletteWheelStop( rouletteid, winner ) // inform users if ( profit >= 10000 ) { - SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); + } } // give user points diff --git a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn index 98a84f4..fd7c0e2 100644 --- a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn +++ b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn @@ -288,7 +288,12 @@ public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, thir // alert user if ( iNetWin > g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] ) { SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, cash_format( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] >= 25000 ? ( "Visage" ) : ( "Caligulas" ) ) ); - } else { + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, cash_format( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] >= 25000 ? ( "Visage" ) : ( "Caligulas" ) ) ); + } + } else { SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", cash_format( iNetWin ) ); }