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 >
/* ** 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 ]
;

View File

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

View File

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

View File

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