reconfigure comps with appropriate house edge
This commit is contained in:
parent
1929f83ef2
commit
c56e99943d
@ -2173,14 +2173,17 @@ new
|
|||||||
;
|
;
|
||||||
|
|
||||||
/* ** Casino Rewards Points ** */
|
/* ** Casino Rewards Points ** */
|
||||||
#define CASINO_REWARDS_DIVISOR 5000.0 // (for every X in $10K, they get Y points)
|
#define CASINO_REWARDS_PAYOUT_PERCENT 20.0
|
||||||
#define CASINO_REWARDS_COST_MP 15 // 10x the supa save costs
|
#define CASINO_REWARDS_DIVISOR 10.0 // 1000 points becomes 1 point
|
||||||
|
#define CASINO_REWARDS_COST_MP 0.5 // half of the price (since it costs (1/payout_percent) times more)
|
||||||
|
|
||||||
new
|
new
|
||||||
g_casinoRewardsShopItems[ ] = {
|
g_casinoRewardsShopItems[ ] = {
|
||||||
5, 6, 7, 8, 9, 10, 11
|
5, 6, 7, 8, 9, 10, 11
|
||||||
},
|
},
|
||||||
Float: p_CasinoRewardsPoints [ MAX_PLAYERS ]
|
Float: p_CasinoRewardsPoints [ MAX_PLAYERS ],
|
||||||
|
Text3D: p_RewardsLabel_4Drags [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... },
|
||||||
|
Text3D: p_RewardsLabel_Caligs [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* ** Easter Eggs ** */
|
/* ** Easter Eggs ** */
|
||||||
@ -3314,7 +3317,7 @@ main()
|
|||||||
|
|
||||||
public OnGameModeInit()
|
public OnGameModeInit()
|
||||||
{
|
{
|
||||||
SetGameModeText( "Cops And Robbers" );
|
SetGameModeText( "Cops And Robbers/DM/Gangs" );
|
||||||
SetServerRule( "hostname", SERVER_NAME );
|
SetServerRule( "hostname", SERVER_NAME );
|
||||||
SetServerRule( "language", "All (English)" );
|
SetServerRule( "language", "All (English)" );
|
||||||
UsePlayerPedAnims( );
|
UsePlayerPedAnims( );
|
||||||
@ -4953,6 +4956,10 @@ public OnServerUpdate( )
|
|||||||
PlayerTextDrawSetString( playerid, p_LocationTD[ playerid ], GetPlayerArea( playerid ) );
|
PlayerTextDrawSetString( playerid, p_LocationTD[ playerid ], GetPlayerArea( playerid ) );
|
||||||
PlayerTextDrawSetString( playerid, p_ExperienceTD[ playerid ], sprintf( "%08d", p_XP[ playerid ] ) );
|
PlayerTextDrawSetString( playerid, p_ExperienceTD[ playerid ], sprintf( "%08d", p_XP[ playerid ] ) );
|
||||||
|
|
||||||
|
// Update casino labels
|
||||||
|
UpdateDynamic3DTextLabelText( p_RewardsLabel_Caligs[ playerid ], COLOR_GOLD, sprintf( "[CASINO REWARDS]\n\n"COL_WHITE"You have %0.2f rewards points!", p_CasinoRewardsPoints[ playerid ] ) );
|
||||||
|
UpdateDynamic3DTextLabelText( p_RewardsLabel_4Drags[ playerid ], COLOR_GOLD, sprintf( "[CASINO REWARDS]\n\n"COL_WHITE"You have %0.2f rewards points!", p_CasinoRewardsPoints[ playerid ] ) );
|
||||||
|
|
||||||
// Toggle total coin bar
|
// Toggle total coin bar
|
||||||
if ( !p_PlayerSettings[ playerid ] { SETTING_COINS_BAR } )
|
if ( !p_PlayerSettings[ playerid ] { SETTING_COINS_BAR } )
|
||||||
PlayerTextDrawSetString( playerid, p_CoinsTD[ playerid ], sprintf( "%05.3f", p_IrresistibleCoins[ playerid ] ) );
|
PlayerTextDrawSetString( playerid, p_CoinsTD[ playerid ], sprintf( "%05.3f", p_IrresistibleCoins[ playerid ] ) );
|
||||||
@ -6034,6 +6041,12 @@ public OnPlayerConnect( playerid )
|
|||||||
removeExcessiveBuildings( playerid );
|
removeExcessiveBuildings( playerid );
|
||||||
initializePlayerInteriors( playerid );
|
initializePlayerInteriors( playerid );
|
||||||
|
|
||||||
|
// Create casino label
|
||||||
|
DestroyDynamic3DTextLabel( p_RewardsLabel_Caligs[ playerid ] );
|
||||||
|
DestroyDynamic3DTextLabel( p_RewardsLabel_4Drags[ playerid ] );
|
||||||
|
p_RewardsLabel_Caligs[ playerid ] = CreateDynamic3DTextLabel( "[CASINO REWARDS]", COLOR_GOLD, 2157.6294, 1599.4355, 1006.1797, 20.0, .playerid = playerid );
|
||||||
|
p_RewardsLabel_4Drags[ playerid ] = CreateDynamic3DTextLabel( "[CASINO REWARDS]", COLOR_GOLD, 1951.7191, 997.55550, 992.85940, 20.0, .playerid = playerid );
|
||||||
|
|
||||||
// Reset some variables
|
// Reset some variables
|
||||||
p_Spawned { playerid } = false;
|
p_Spawned { playerid } = false;
|
||||||
p_GangID [ playerid ] = INVALID_GANG_ID;
|
p_GangID [ playerid ] = INVALID_GANG_ID;
|
||||||
@ -19685,16 +19698,20 @@ public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, thir
|
|||||||
// readjust casino pool data
|
// readjust casino pool data
|
||||||
UpdateCasinoPoolData( poolid, .pool_increment = -iNetWin, .total_win = iNetWin );
|
UpdateCasinoPoolData( poolid, .pool_increment = -iNetWin, .total_win = iNetWin );
|
||||||
|
|
||||||
|
// alert user
|
||||||
|
if ( iNetWin >= 10000 ) {
|
||||||
|
SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, ConvertPrice( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( "Caligulas" ) );
|
||||||
|
} else {
|
||||||
|
SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", ConvertPrice( iNetWin ) );
|
||||||
|
}
|
||||||
|
|
||||||
// give the cash
|
// give the cash
|
||||||
GivePlayerCash( playerid, iNetWin );
|
GivePlayerCash( playerid, iNetWin );
|
||||||
PlayerPlaySound( playerid, 4201, 0.0, 0.0, 0.0 ); // Coin fall
|
PlayerPlaySound( playerid, 4201, 0.0, 0.0, 0.0 ); // Coin fall
|
||||||
|
|
||||||
GameTextForPlayer( playerid, "~w~~h~winner!", 5000, 6 );
|
GameTextForPlayer( playerid, "~w~~h~winner!", 5000, 6 );
|
||||||
return SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino!", ReturnPlayerName( playerid ), playerid, ConvertPrice( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( "Caligulas" ) );
|
return 1;
|
||||||
// return SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", ConvertPrice( iNetWin ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] );
|
|
||||||
return GameTextForPlayer( playerid, "~w~~h~no win!", 2500, 6 );
|
return GameTextForPlayer( playerid, "~w~~h~no win!", 2500, 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22484,7 +22501,7 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
|
|||||||
{
|
{
|
||||||
if ( x == listitem )
|
if ( x == listitem )
|
||||||
{
|
{
|
||||||
new Float: rewards_cost = float( g_shopItemData[ i ] [ E_PRICE ] * CASINO_REWARDS_COST_MP ) / CASINO_REWARDS_DIVISOR;
|
new Float: rewards_cost = ( float( g_shopItemData[ i ] [ E_PRICE ] ) * CASINO_REWARDS_COST_MP ) / CASINO_REWARDS_DIVISOR;
|
||||||
|
|
||||||
if ( p_CasinoRewardsPoints[ playerid ] < rewards_cost )
|
if ( p_CasinoRewardsPoints[ playerid ] < rewards_cost )
|
||||||
return SendError( playerid, "You need %0.2f more rewards points for this item.", rewards_cost );
|
return SendError( playerid, "You need %0.2f more rewards points for this item.", rewards_cost );
|
||||||
@ -27484,8 +27501,6 @@ stock initializeCheckpoints( )
|
|||||||
CreateDynamic3DTextLabel("[REFILL AMMO]", COLOR_GOLD, 1579.5439, -1635.5166, 13.5609, 20.0);
|
CreateDynamic3DTextLabel("[REFILL AMMO]", COLOR_GOLD, 1579.5439, -1635.5166, 13.5609, 20.0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CreateDynamic3DTextLabel("[CASINO REWARDS]", COLOR_GOLD, 2157.6294, 1599.4355, 1006.1797, 20.0);
|
|
||||||
CreateDynamic3DTextLabel("[CASINO REWARDS]", COLOR_GOLD, 1951.7191, 997.5555, 992.8594, 20.0);
|
|
||||||
CreateDynamic3DTextLabel("[REFILL AMMO]", COLOR_GOLD, -1615.2600, 685.5120, 7.1875, 20.0);
|
CreateDynamic3DTextLabel("[REFILL AMMO]", COLOR_GOLD, -1615.2600, 685.5120, 7.1875, 20.0);
|
||||||
CreateDynamic3DTextLabel("[PAWNSHOP]", COLOR_GOLD, 1333.0847, -1080.0726, 968.0430, 20.0);
|
CreateDynamic3DTextLabel("[PAWNSHOP]", COLOR_GOLD, 1333.0847, -1080.0726, 968.0430, 20.0);
|
||||||
CreateDynamic3DTextLabel("[SHOP]", COLOR_GOLD, -29.0409,-184.7446,1003.5469, 20.0);
|
CreateDynamic3DTextLabel("[SHOP]", COLOR_GOLD, -29.0409,-184.7446,1003.5469, 20.0);
|
||||||
@ -36049,6 +36064,7 @@ stock TriggerPlayerSlotMachine( playerid, machineid )
|
|||||||
return SendError( playerid, "You must have at least %s to use this slot machine.", ConvertPrice( entryFee ) ), ( p_AutoSpin{ playerid } = false ), 1;
|
return SendError( playerid, "You must have at least %s to use this slot machine.", ConvertPrice( entryFee ) ), ( p_AutoSpin{ playerid } = false ), 1;
|
||||||
|
|
||||||
// Update casino pool
|
// Update casino pool
|
||||||
|
GivePlayerCasinoRewardsPoints( playerid, g_slotmachineData[ machineid ] [ E_ENTRY_FEE ], .house_edge = g_slotmachineData[ machineid ] [ E_ENTRY_FEE ] == 10000 ? 10.0 : 25.0 );
|
||||||
UpdateCasinoPoolData( g_slotmachineData[ machineid ] [ E_POOL_ID ], .pool_increment = poolContribute, .total_win = 0, .total_gambled = entryFee );
|
UpdateCasinoPoolData( g_slotmachineData[ machineid ] [ E_POOL_ID ], .pool_increment = poolContribute, .total_win = 0, .total_gambled = entryFee );
|
||||||
|
|
||||||
// Charge the player
|
// Charge the player
|
||||||
@ -37153,9 +37169,11 @@ stock GetBusinessAirModelIndex( modelid ) {
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock GivePlayerCasinoRewardsPoints( playerid, lost_amount ) {
|
stock GivePlayerCasinoRewardsPoints( playerid, bet_amount, Float: house_edge ) {
|
||||||
if ( lost_amount < 0 ) print("[casino error] negative reward amount used"), lost_amount *= -1;
|
if ( bet_amount < 0 ) bet_amount *= -1; // profit or loss, does not matter
|
||||||
p_CasinoRewardsPoints[ playerid ] += lost_amount / CASINO_REWARDS_DIVISOR;
|
// printf("(%f * ((%f * 100.0) * (%f / 100.0))) / %f\n",bet_amount, house_edge, CASINO_REWARDS_PAYOUT_PERCENT, CASINO_REWARDS_DIVISOR);
|
||||||
|
new Float: final_points = ( bet_amount * ( ( house_edge / 100.0 ) * ( CASINO_REWARDS_PAYOUT_PERCENT / 100.0 ) ) ) / CASINO_REWARDS_DIVISOR;
|
||||||
|
p_CasinoRewardsPoints[ playerid ] += final_points;
|
||||||
mysql_single_query( sprintf( "UPDATE `USERS` SET `CASINO_REWARDS`=%f WHERE `ID`=%d", p_CasinoRewardsPoints[ playerid ], p_AccountID[ playerid ] ) );
|
mysql_single_query( sprintf( "UPDATE `USERS` SET `CASINO_REWARDS`=%f WHERE `ID`=%d", p_CasinoRewardsPoints[ playerid ], p_AccountID[ playerid ] ) );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -37168,7 +37186,7 @@ stock ShowPlayerRewardsMenu( playerid )
|
|||||||
{
|
{
|
||||||
strcat( szString, ""COL_WHITE"Item\t"COL_WHITE"Purpose\t"COL_WHITE"Rewards Points\n" );
|
strcat( szString, ""COL_WHITE"Item\t"COL_WHITE"Purpose\t"COL_WHITE"Rewards Points\n" );
|
||||||
for( new i; i < sizeof( g_shopItemData ); i++ ) if ( IsCasinoRewardsShopItem( i ) ) {
|
for( new i; i < sizeof( g_shopItemData ); i++ ) if ( IsCasinoRewardsShopItem( i ) ) {
|
||||||
new Float: rewards_cost = float( g_shopItemData[ i ] [ E_PRICE ] * CASINO_REWARDS_COST_MP ) / CASINO_REWARDS_DIVISOR;
|
new Float: rewards_cost = ( float( g_shopItemData[ i ] [ E_PRICE ] ) * CASINO_REWARDS_COST_MP ) / CASINO_REWARDS_DIVISOR;
|
||||||
format( szString, sizeof( szString ), "%s%s\t"COL_GREY"%s\t"COL_GOLD"%0.2f points\n", szString, g_shopItemData[ i ] [ E_NAME ], g_shopItemData[ i ] [ E_USAGE ], rewards_cost );
|
format( szString, sizeof( szString ), "%s%s\t"COL_GREY"%s\t"COL_GOLD"%0.2f points\n", szString, g_shopItemData[ i ] [ E_NAME ], g_shopItemData[ i ] [ E_USAGE ], rewards_cost );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37194,6 +37212,8 @@ stock GetPlayerAccountID( playerid ) return p_AccountID[ playerid ];
|
|||||||
|
|
||||||
stock GetPlayerVIPLevel( playerid ) return p_VIPLevel[ playerid ];
|
stock GetPlayerVIPLevel( playerid ) return p_VIPLevel[ playerid ];
|
||||||
|
|
||||||
|
stock GetPlayerAdminLevel( playerid ) return p_AdminLevel[ playerid ];
|
||||||
|
|
||||||
stock IsPlayerSpawned( playerid ) return p_Spawned{ playerid };
|
stock IsPlayerSpawned( playerid ) return p_Spawned{ playerid };
|
||||||
|
|
||||||
stock UpdatePlayerEntranceExitTick( playerid, ms = 2500 ) {
|
stock UpdatePlayerEntranceExitTick( playerid, ms = 2500 ) {
|
||||||
|
@ -567,6 +567,7 @@ stock CheckForBlackjack( tableid )
|
|||||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has been returned %s due to a push.", ReturnPlayerName( playerid ), playerid, ConvertPrice( payout ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has been returned %s due to a push.", ReturnPlayerName( playerid ), playerid, ConvertPrice( payout ) );
|
||||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
||||||
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
}
|
}
|
||||||
else if ( player_score == 21 ) {
|
else if ( player_score == 21 ) {
|
||||||
@ -578,16 +579,17 @@ stock CheckForBlackjack( tableid )
|
|||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a card count of 21!", ReturnPlayerName( playerid ), playerid, ConvertPrice( payout ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a card count of 21!", ReturnPlayerName( playerid ), playerid, ConvertPrice( payout ) );
|
||||||
}
|
}
|
||||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
||||||
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
}
|
}
|
||||||
else if ( dealer_score == 21 ) {
|
else if ( dealer_score == 21 ) {
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ] );
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST;
|
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST;
|
||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a dealer %s.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ), IsDealerHandBlackjack( tableid, dealer_score ) ? ( "blackjack" ) : ( "21" ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a dealer %s.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ), IsDealerHandBlackjack( tableid, dealer_score ) ? ( "blackjack" ) : ( "21" ) );
|
||||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||||
}
|
}
|
||||||
else if ( player_score > 21 ) {
|
else if ( player_score > 21 ) {
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ] );
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST;
|
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST;
|
||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||||
@ -596,10 +598,11 @@ stock CheckForBlackjack( tableid )
|
|||||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( payout ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( payout ) );
|
||||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
||||||
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
}
|
}
|
||||||
else if ( player_score < dealer_score && dealer_score >= 17 ) {
|
else if ( player_score < dealer_score && dealer_score >= 17 ) {
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ] );
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST;
|
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST;
|
||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||||
@ -608,6 +611,7 @@ stock CheckForBlackjack( tableid )
|
|||||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
||||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, ConvertPrice( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( payout ) ), 4000, 3 );
|
||||||
|
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
/* ** Constants ** */
|
/* ** Constants ** */
|
||||||
stock VISAGE_ENTRANCE = ITER_NONE;
|
stock VISAGE_ENTRANCE = ITER_NONE;
|
||||||
stock const VISAGE_INTERIOR = 10;
|
stock const VISAGE_INTERIOR = 15;
|
||||||
stock const VISAGE_WORLD = 30;
|
stock const VISAGE_WORLD = 79;
|
||||||
|
|
||||||
/* ** Hooks ** */
|
/* ** Hooks ** */
|
||||||
hook OnGameModeInit( )
|
hook OnGameModeInit( )
|
||||||
|
@ -1956,7 +1956,7 @@ stock CheckShowdown(handle)
|
|||||||
new w_chips = floatround(float(TableData[handle][E_TABLE_POT_CHIPS][pot_id]) * (1.0 - T_POT_FEE_RATE));
|
new w_chips = floatround(float(TableData[handle][E_TABLE_POT_CHIPS][pot_id]) * (1.0 - T_POT_FEE_RATE));
|
||||||
new fee_earned = floatround((float(TableData[handle][E_TABLE_POT_CHIPS][pot_id]) / 1000.0) * T_POT_FEE_RATE);
|
new fee_earned = floatround((float(TableData[handle][E_TABLE_POT_CHIPS][pot_id]) / 1000.0) * T_POT_FEE_RATE);
|
||||||
UpdateServerVariable( "poker_fees", 0, GetGVarFloat( "poker_fees" ) + fee_earned, "", GLOBAL_VARTYPE_FLOAT );
|
UpdateServerVariable( "poker_fees", 0, GetGVarFloat( "poker_fees" ) + fee_earned, "", GLOBAL_VARTYPE_FLOAT );
|
||||||
GivePlayerCasinoRewardsPoints(high_id, fee_earned);
|
GivePlayerCasinoRewardsPoints(high_id, fee_earned, .house_edge = 100.0);
|
||||||
SendTableMessage(handle, "{9FCF30}****************************************************************************************");
|
SendTableMessage(handle, "{9FCF30}****************************************************************************************");
|
||||||
SendTableMessage(handle, "{9FCF30}Player {FF8000}%s {9FCF30}has won with a {377CC8}%s", ReturnPlayerName(high_id), HAND_RANKS[highest_rank >> 12]);
|
SendTableMessage(handle, "{9FCF30}Player {FF8000}%s {9FCF30}has won with a {377CC8}%s", ReturnPlayerName(high_id), HAND_RANKS[highest_rank >> 12]);
|
||||||
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee.", ConvertPrice(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee.", ConvertPrice(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
||||||
@ -1977,7 +1977,7 @@ stock CheckShowdown(handle)
|
|||||||
if(!Iter_Contains(IT_PlayersInGame<handle>, p)) continue;
|
if(!Iter_Contains(IT_PlayersInGame<handle>, p)) continue;
|
||||||
if(PlayerRanks[p] == highest_rank)
|
if(PlayerRanks[p] == highest_rank)
|
||||||
{
|
{
|
||||||
GivePlayerCasinoRewardsPoints(p, floatround(float(fee_earned) / float(count)));
|
GivePlayerCasinoRewardsPoints(p, floatround(float(fee_earned) / float(count)), .house_edge = 100.0);
|
||||||
SendTableMessage(handle, "{9FCF30}%s", ReturnPlayerName(p));
|
SendTableMessage(handle, "{9FCF30}%s", ReturnPlayerName(p));
|
||||||
PlayerData[p][E_PLAYER_TOTAL_CHIPS] += amount;
|
PlayerData[p][E_PLAYER_TOTAL_CHIPS] += amount;
|
||||||
}
|
}
|
||||||
@ -2173,7 +2173,7 @@ stock bool: FoldPlayer(handle, playerid)
|
|||||||
new w_chips = floatround(float(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]) * (1.0 - T_POT_FEE_RATE));
|
new w_chips = floatround(float(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]) * (1.0 - T_POT_FEE_RATE));
|
||||||
new fee_earned = floatround((float(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]) / 1000.0) * T_POT_FEE_RATE);
|
new fee_earned = floatround((float(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]) / 1000.0) * T_POT_FEE_RATE);
|
||||||
UpdateServerVariable( "poker_fees", 0, GetGVarFloat( "poker_fees" ) + fee_earned, "", GLOBAL_VARTYPE_FLOAT );
|
UpdateServerVariable( "poker_fees", 0, GetGVarFloat( "poker_fees" ) + fee_earned, "", GLOBAL_VARTYPE_FLOAT );
|
||||||
GivePlayerCasinoRewardsPoints(winner, fee_earned);
|
GivePlayerCasinoRewardsPoints(winner, fee_earned, .house_edge = 100.0);
|
||||||
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee", ConvertPrice(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee", ConvertPrice(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
||||||
SendTableMessage(handle, "{9FCF30}****************************************************************************************");
|
SendTableMessage(handle, "{9FCF30}****************************************************************************************");
|
||||||
PlayerData[winner][E_PLAYER_TOTAL_CHIPS] += w_chips;
|
PlayerData[winner][E_PLAYER_TOTAL_CHIPS] += w_chips;
|
||||||
|
@ -672,13 +672,15 @@ public OnRouletteWheelStop( rouletteid, winner )
|
|||||||
SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, ConvertPrice( profit ) );
|
SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, ConvertPrice( profit ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// give user points
|
||||||
|
GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 );
|
||||||
|
|
||||||
// gametext
|
// gametext
|
||||||
if ( profit > 0 ) {
|
if ( profit > 0 ) {
|
||||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( profit ) ), 4000, 3 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", ConvertPrice( profit ) ), 4000, 3 );
|
||||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and profited %s! (winning no %d)", ConvertPrice( waged ), ConvertPrice( profit ), winner );
|
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and profited %s! (winning no %d)", ConvertPrice( waged ), ConvertPrice( profit ), winner );
|
||||||
} else {
|
} else {
|
||||||
profit *= -1; // to improve the client message
|
profit *= -1; // to improve the client message
|
||||||
GivePlayerCasinoRewardsPoints( playerid, profit );
|
|
||||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and lost %s! (winning no %d)", ConvertPrice( waged ), ConvertPrice( profit ), winner );
|
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and lost %s! (winning no %d)", ConvertPrice( waged ), ConvertPrice( profit ), winner );
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include < irresistible\helpers >
|
#include < irresistible\helpers >
|
||||||
#include < irresistible\floodcontrol >
|
#include < irresistible\floodcontrol >
|
||||||
#include < irresistible\mailer >
|
#include < irresistible\mailer >
|
||||||
#include < irresistible\colours >
|
#include < irresistible\colors >
|
||||||
#include < irresistible\attachments >
|
#include < irresistible\attachments >
|
||||||
#include < irresistible\lookup >
|
#include < irresistible\lookup >
|
||||||
#include < irresistible\servervars >
|
#include < irresistible\servervars >
|
||||||
|
Loading…
Reference in New Issue
Block a user