adds 'hide gambling win msgs' setting in cp

This commit is contained in:
Damen 2019-04-09 01:40:28 -04:00
parent d947770328
commit 43303726de
4 changed files with 20 additions and 6 deletions

View File

@ -9,7 +9,7 @@
#include < YSI\y_hooks > #include < YSI\y_hooks >
/* ** Definitions ** */ /* ** Definitions ** */
#define MAX_SETTINGS ( 12 ) #define MAX_SETTINGS ( 13 )
#define SETTING_BAILOFFERS ( 0 ) #define SETTING_BAILOFFERS ( 0 )
#define SETTING_EVENT_TP ( 1 ) #define SETTING_EVENT_TP ( 1 )
@ -23,13 +23,14 @@
#define SETTING_COINS_BAR ( 9 ) #define SETTING_COINS_BAR ( 9 )
#define SETTING_TOP_DONOR ( 10 ) #define SETTING_TOP_DONOR ( 10 )
#define SETTING_WEAPON_PICKUP ( 11 ) #define SETTING_WEAPON_PICKUP ( 11 )
#define SETTING_HIDE_GAMB_MSG ( 12 )
/* ** Variables ** */ /* ** Variables ** */
static stock 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" },
{ "Display User ID In Chat" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" }, { "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 ] bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ]
; ;

View File

@ -627,7 +627,11 @@ stock CheckForBlackjack( tableid )
// alert world // alert world
if ( g_blackjackPlayerState[ tableid ] [ player_index ] == BLACKJACK_STATE_WIN && payout > g_blackjackData[ tableid ] [ E_PAYOUT ] && payout >= 10000 ) { 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 ); 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 ) );
}
} }
} }
} }

View File

@ -686,7 +686,11 @@ public OnRouletteWheelStop( rouletteid, winner )
// inform users // inform users
if ( profit >= 10000 ) { 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 // give user points

View File

@ -288,6 +288,11 @@ public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, thir
// alert user // alert user
if ( iNetWin > g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] ) { 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" ) ) ); 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" ) ) );
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 { } else {
SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", cash_format( iNetWin ) ); SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", cash_format( iNetWin ) );
} }