replace number_format with cash_format
This commit is contained in:
parent
6e79b82423
commit
a59326f0a3
@ -92,7 +92,7 @@ stock RedirectAmmunation( playerid, listitem, custom_title[ ] = "{FFFFFF}Ammu-Na
|
||||
|
||||
// check for free or not
|
||||
if ( custom_multplier > 0.0 ) {
|
||||
format( szString, sizeof( szString ), "%s"COL_GOLD"%s\n", szString, number_format( floatround( g_AmmunationWeapons[ i ] [ E_PRICE ] * custom_multplier ) ) );
|
||||
format( szString, sizeof( szString ), "%s"COL_GOLD"%s\n", szString, cash_format( floatround( g_AmmunationWeapons[ i ] [ E_PRICE ] * custom_multplier ) ) );
|
||||
} else {
|
||||
strcat( szString, ""COL_GOLD"FREE\n" );
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ thread OnPlayerRedeemCashCard( playerid, card_id, card_value )
|
||||
|
||||
// alert and give cash
|
||||
GivePlayerCash( playerid, card_value );
|
||||
SendClientMessageToAllFormatted( COLOR_GREY, "[SERVER]"COL_WHITE" %s(%d) has redeemed a "COL_GOLD"%s"COL_WHITE" cash card.", ReturnPlayerName( playerid ), playerid, number_format( card_value ) );
|
||||
SendClientMessageToAllFormatted( COLOR_GREY, "[SERVER]"COL_WHITE" %s(%d) has redeemed a "COL_GOLD"%s"COL_WHITE" cash card.", ReturnPlayerName( playerid ), playerid, cash_format( card_value ) );
|
||||
|
||||
// insert into database
|
||||
mysql_single_query( sprintf( "UPDATE `CASH_CARDS` SET `USES` = `USES` + 1 WHERE `ID`=%d", card_id ) );
|
||||
|
@ -190,9 +190,9 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
|
||||
}
|
||||
|
||||
p_duelInvitation[ playerid ][ pID ] = gettime( ) + 60;
|
||||
ShowPlayerHelpDialog( pID, 10000, "%s wants to duel!~n~~n~~y~Location: ~w~%s~n~~y~Weapon: ~w~%s and %s~n~~y~Wager: ~w~%s", ReturnPlayerName( playerid ), g_duelLocationData [ g_duelData[ playerid ][ E_LOCATION_ID ] ][ E_NAME ], ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 0 ] ), ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 1 ] ), number_format(g_duelData[ playerid ][ E_BET ]));
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You have sent a duel invitation to %s for "COL_GOLD"%s"COL_WHITE".", ReturnPlayerName( pID ), number_format( g_duelData[ playerid ][ E_BET ] ) );
|
||||
SendClientMessageFormatted( pID, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You are invited to duel %s for "COL_GOLD"%s"COL_WHITE", use \"/duel accept %d\".", ReturnPlayerName( playerid ), number_format( g_duelData[ playerid ][ E_BET ] ), playerid );
|
||||
ShowPlayerHelpDialog( pID, 10000, "%s wants to duel!~n~~n~~y~Location: ~w~%s~n~~y~Weapon: ~w~%s and %s~n~~y~Wager: ~w~%s", ReturnPlayerName( playerid ), g_duelLocationData [ g_duelData[ playerid ][ E_LOCATION_ID ] ][ E_NAME ], ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 0 ] ), ReturnWeaponName( g_duelData[ playerid ][ E_WEAPON ][ 1 ] ), cash_format(g_duelData[ playerid ][ E_BET ]));
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You have sent a duel invitation to %s for "COL_GOLD"%s"COL_WHITE".", ReturnPlayerName( pID ), cash_format( g_duelData[ playerid ][ E_BET ] ) );
|
||||
SendClientMessageFormatted( pID, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You are invited to duel %s for "COL_GOLD"%s"COL_WHITE", use \"/duel accept %d\".", ReturnPlayerName( playerid ), cash_format( g_duelData[ playerid ][ E_BET ] ), playerid );
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@ -349,7 +349,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
|
||||
return ShowPlayerDialog( playerid, DIALOG_DUEL_WAGER, DIALOG_STYLE_INPUT, "{FFFFFF}Duel Settings - Set A Wager", "{FFFFFF}Please enter the wager for this duel:\n\n{FF0000}Wagers must be between $0 and $10,000,000.", "Select", "Back");
|
||||
|
||||
g_duelData[playerid][ E_BET ] = iBet;
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]{FFFFFF} You have changed the wager to %s.", number_format(g_duelData[playerid][ E_BET ]));
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]{FFFFFF} You have changed the wager to %s.", cash_format(g_duelData[playerid][ E_BET ]));
|
||||
ShowPlayerDuelMenu( playerid );
|
||||
return 1;
|
||||
}
|
||||
@ -386,13 +386,13 @@ CMD:duel( playerid, params[ ] )
|
||||
{
|
||||
if ( GetPlayerCash( targetid ) < waged_amount)
|
||||
{
|
||||
SendClientMessageFormatted( targetid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s has accepted but you don't have money to wage (%s).", ReturnPlayerName( playerid ), number_format( waged_amount ) );
|
||||
SendClientMessageFormatted( targetid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s has accepted but you don't have money to wage (%s).", ReturnPlayerName( playerid ), cash_format( waged_amount ) );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" You have accepted %s's duel invitation but they don't have money.", ReturnPlayerName( targetid ) );
|
||||
return 1;
|
||||
}
|
||||
else if ( GetPlayerCash( playerid ) < waged_amount)
|
||||
{
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s requires you to wage %s.", ReturnPlayerName( targetid ), number_format( waged_amount ) );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s requires you to wage %s.", ReturnPlayerName( targetid ), cash_format( waged_amount ) );
|
||||
SendClientMessageFormatted( targetid, -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s has accepted the duel invitation but they don't have money to wage.", ReturnPlayerName( playerid ) );
|
||||
return 1;
|
||||
}
|
||||
@ -504,7 +504,7 @@ stock ShowPlayerDuelMenu(playerid)
|
||||
ReturnWeaponName(g_duelData[ playerid ][ E_WEAPON ][0]),
|
||||
ReturnWeaponName(g_duelData[ playerid ][ E_WEAPON ][1]),
|
||||
g_duelLocationData[ g_duelData[ playerid ][ E_LOCATION_ID ] ][ E_NAME ],
|
||||
number_format(g_duelData[playerid][ E_BET ])
|
||||
cash_format(g_duelData[playerid][ E_BET ])
|
||||
);
|
||||
ShowPlayerDialog(playerid, DIALOG_DUEL, DIALOG_STYLE_TABLIST, ""COL_WHITE"{FFFFFF}Duel Settings", szBigString, "Select", "Cancel");
|
||||
return 1;
|
||||
@ -540,7 +540,7 @@ static stock forfeitPlayerDuel(playerid)
|
||||
new
|
||||
winning_prize = floatround(float(amount_waged) * 1.95); // We take 2.5% of the total pot
|
||||
GivePlayerCash(winnerid, winning_prize);
|
||||
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s(%d) has won the duel against %s(%d) for %s!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid, number_format(winning_prize));
|
||||
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s(%d) has won the duel against %s(%d) for %s!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid, cash_format(winning_prize));
|
||||
} else {
|
||||
SendClientMessageToAllFormatted( -1, ""COL_DUEL"[DUEL]"COL_WHITE" %s(%d) has won the duel against %s(%d)!", ReturnPlayerName(winnerid), winnerid, ReturnPlayerName(playerid), playerid);
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ function OnPlayerOrbitalCannonUpdate( facilityid, playerid )
|
||||
GivePlayerCash( playerid, -250000 );
|
||||
PlayerPlaySound( playerid, 1057, 0.0, 0.0, 0.0 );
|
||||
GameTextForPlayer( playerid, "~g~FIRED!", 2000, 3 );
|
||||
SendServerMessage( playerid, "You have launched an orbital cannon for "COL_GOLD"$250,000"COL_WHITE", you have %s left.", number_format( GetPlayerCash( playerid ) ) );
|
||||
SendServerMessage( playerid, "You have launched an orbital cannon for "COL_GOLD"$250,000"COL_WHITE", you have %s left.", cash_format( GetPlayerCash( playerid ) ) );
|
||||
return SetTimerEx( "OnPlayerFireOrbitalCannon", move_speed, false, "ddfff", playerid, rocket, current_pos[ 0 ], current_pos[ 1 ], current_pos[ 2 ] );
|
||||
}
|
||||
else
|
||||
|
@ -267,7 +267,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
||||
else GivePlayerWeapon( playerid, g_AmmunationWeapons[ i ] [ E_WEPID ], g_AmmunationWeapons[ i ] [ E_AMMO ] );
|
||||
|
||||
RedirectAmmunation( playerid, gun_category, "{FFFFFF}Gang Facility - Purchase Weapons", DIALOG_FACILITY_AMMU_BUY, gun_discount );
|
||||
SendServerMessage( playerid, "You have purchased %s(%d) for "COL_GOLD"%s"COL_WHITE"%s.", g_AmmunationWeapons[ i ] [ E_NAME ], g_AmmunationWeapons[ i ] [ E_AMMO ], price > 0.0 ? number_format( price ) : ( "FREE" ) );
|
||||
SendServerMessage( playerid, "You have purchased %s(%d) for "COL_GOLD"%s"COL_WHITE"%s.", g_AmmunationWeapons[ i ] [ E_NAME ], g_AmmunationWeapons[ i ] [ E_AMMO ], price > 0.0 ? cash_format( price ) : ( "FREE" ) );
|
||||
break;
|
||||
}
|
||||
x ++;
|
||||
|
@ -356,7 +356,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
||||
new iNetProfit = floatround( g_houseFurniture[ i ] [ E_COST ] / 2 );
|
||||
|
||||
GivePlayerCash( playerid, iNetProfit );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[FURNITURE]"COL_WHITE" You have successfully sold your "COL_WHITE"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_houseFurniture[ i ] [ E_NAME ], number_format( iNetProfit ) );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[FURNITURE]"COL_WHITE" You have successfully sold your "COL_WHITE"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_houseFurniture[ i ] [ E_NAME ], cash_format( iNetProfit ) );
|
||||
ShowPlayerDialog( playerid, DIALOG_FURNITURE, DIALOG_STYLE_LIST, "{FFFFFF}Furniture", "Purchase Furniture\nSelect Furniture Easily\nSelect Furniture Manually\nSelect Furniture Nearest\n"COL_RED"Remove All Furniture", "Confirm", "Back" );
|
||||
}
|
||||
}
|
||||
@ -1097,7 +1097,7 @@ stock ShowFurnitureList( playerid, category )
|
||||
szLargeString = ""COL_WHITE"Furniture\t"COL_WHITE"Cost\n";
|
||||
|
||||
for( new i = 0; i < sizeof( g_houseFurniture ); i++ ) if ( g_houseFurniture[ i ] [ E_CATEGORY ] == category )
|
||||
format( szLargeString, sizeof( szLargeString ), "%s%s\t"COL_GOLD"%s\n", szLargeString, g_houseFurniture[ i ] [ E_NAME ], number_format( g_houseFurniture[ i ] [ E_COST ] ) );
|
||||
format( szLargeString, sizeof( szLargeString ), "%s%s\t"COL_GOLD"%s\n", szLargeString, g_houseFurniture[ i ] [ E_NAME ], cash_format( g_houseFurniture[ i ] [ E_COST ] ) );
|
||||
|
||||
ShowPlayerDialog( playerid, DIALOG_FURNITURE_LIST, DIALOG_STYLE_TABLIST_HEADERS, "Furniture", szLargeString, "Select", "Back" );
|
||||
}
|
||||
|
@ -117,16 +117,7 @@ new
|
||||
/* ** Hooks ** */
|
||||
hook OnScriptInit( )
|
||||
{
|
||||
// initialize textdraws
|
||||
for ( new i = 0; i < MAX_BLACKJACK_TABLES; i ++ ) {
|
||||
initializeBlackjackTextdraws( i );
|
||||
}
|
||||
|
||||
// for tracking bets
|
||||
AddServerVariable( "blackjack_bets", "0.0", GLOBAL_VARTYPE_FLOAT );
|
||||
AddServerVariable( "blackjack_wins", "0.0", GLOBAL_VARTYPE_FLOAT );
|
||||
|
||||
// Reset Textdraw Variables
|
||||
// Reset Textdraw Variables
|
||||
for ( new i = 0; i < MAX_BLACKJACK_TABLES; i ++ ) {
|
||||
for ( new x = 0; x < MAX_BLACKJACK_CARDS; x ++ ) {
|
||||
g_blackjackDealerCards[ i ] [ x ] = Text: INVALID_TEXT_DRAW;
|
||||
@ -135,7 +126,12 @@ hook OnScriptInit( )
|
||||
g_blackjackSlotData[ i ] [ p ] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
initializeBlackjackTextdraws( i );
|
||||
}
|
||||
|
||||
// for tracking bets
|
||||
AddServerVariable( "blackjack_bets", "0.0", GLOBAL_VARTYPE_FLOAT );
|
||||
AddServerVariable( "blackjack_wins", "0.0", GLOBAL_VARTYPE_FLOAT );
|
||||
|
||||
// Create blackjack tables
|
||||
CreateBlackjackTable( 2500, 2230.37500, 1602.75000, 1006.15631, 0.00000, 82 );
|
||||
@ -292,7 +288,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
szBigString = "~y~~k~~PED_SPRINT~~w~ - Begin game/Stand~n~~y~~k~~GROUP_CONTROL_BWD~~w~ - Hit~n~~y~~k~~VEHICLE_ENTER_EXIT~~w~ - Exit";
|
||||
ShowPlayerHelpDialog( playerid, 0, szBigString );
|
||||
|
||||
SendServerMessage( playerid, "You have entered the %s hand blackjack table.", number_format( g_blackjackData[ id ] [ E_PAYOUT ] ) );
|
||||
SendServerMessage( playerid, "You have entered the %s hand blackjack table.", cash_format( g_blackjackData[ id ] [ E_PAYOUT ] ) );
|
||||
ApplyAnimation( playerid, "DEALER", "DEALER_IDLE", 4.1, 1, 1, 1, 1, 0, 1 );
|
||||
return 1;
|
||||
}
|
||||
@ -322,7 +318,7 @@ stock CreateBlackjackTable( payout, Float: X, Float: Y, Float: Z, Float: Angle,
|
||||
g_blackjackData[ id ] [ E_PAYOUT ] = payout;
|
||||
g_blackjackData[ id ] [ E_OBJECT ] = CreateDynamicObject( 2188, X, Y, Z, 0.00000, 0.00000, Angle, .worldid = world, .priority = 9999 );
|
||||
g_blackjackData[ id ] [ E_ACTOR ] = CreateDynamicActor( 171, X - 0.4 * floatcos( Angle - 90.0, degrees ), Y - 0.4 * floatsin( Angle - 90.0, degrees ), Z, Angle + 180.0, .worldid = world );
|
||||
g_blackjackData[ id ] [ E_DEALER_LABEL ] = CreateDynamic3DTextLabel( sprintf( "Press ENTER To Play Blackjack\n"COL_WHITE"%s Minimum", number_format( payout ) ), COLOR_GREY, X, Y, Z + 0.25, 15.0, .testlos = 0, .worldid = world );
|
||||
g_blackjackData[ id ] [ E_DEALER_LABEL ] = CreateDynamic3DTextLabel( sprintf( "Press ENTER To Play Blackjack\n"COL_WHITE"%s Minimum", cash_format( payout ) ), COLOR_GREY, X, Y, Z + 0.25, 15.0, .testlos = 0, .worldid = world );
|
||||
|
||||
g_blackjackData[ id ] [ E_PLAYER_LABEL ] [ 0 ] = CreateDynamic3DTextLabel( "Player 0", 0, X + 0.7 * floatcos( Angle - 90.0, degrees ), Y + 0.7 * floatsin( Angle - 90.0, degrees ), Z + 0.05, 15.0, .testlos = 0, .worldid = world );
|
||||
g_blackjackData[ id ] [ E_PLAYER_LABEL ] [ 1 ] = CreateDynamic3DTextLabel( "Player 1", 0, X + 0.7 * floatcos( Angle - 90.0 - 22.5, degrees ), Y + 0.7 * floatsin( Angle - 90.0 - 22.5, degrees ), Z + 0.05, 15.0, .testlos = 0, .worldid = world );
|
||||
@ -571,8 +567,8 @@ stock CheckForBlackjack( tableid )
|
||||
if ( dealer_score == player_score && dealer_score >= 17 ) {
|
||||
payout = g_blackjackData[ tableid ] [ E_PAYOUT ];
|
||||
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, number_format( payout ) );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~y~%s returned!", number_format( payout ) ), 4000, 3 );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has been returned %s due to a push.", ReturnPlayerName( playerid ), playerid, cash_format( payout ) );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~y~%s returned!", cash_format( payout ) ), 4000, 3 );
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
GivePlayerCash( playerid, payout );
|
||||
}
|
||||
@ -580,43 +576,43 @@ stock CheckForBlackjack( tableid )
|
||||
g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN;
|
||||
if ( IsPlayerHandBlackjack( tableid, player_index, player_score ) ) {
|
||||
payout = floatround( float( g_blackjackData[ tableid ] [ E_PAYOUT ] ) * 2.5 );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" Blackjack! %s(%d) has won %s!", ReturnPlayerName( playerid ), playerid, number_format( payout ) );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" Blackjack! %s(%d) has won %s!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) );
|
||||
} else {
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a card count of 21!", ReturnPlayerName( playerid ), playerid, number_format( payout ) );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a card count of 21!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) );
|
||||
}
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", number_format( payout ) ), 4000, 3 );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 );
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
GivePlayerCash( playerid, payout );
|
||||
}
|
||||
else if ( dealer_score == 21 ) {
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
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, number_format( 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, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ), IsDealerHandBlackjack( tableid, dealer_score ) ? ( "blackjack" ) : ( "21" ) );
|
||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||
}
|
||||
else if ( player_score > 21 ) {
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
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, number_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||
}
|
||||
else if ( dealer_score > 21 ) {
|
||||
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, number_format( payout ) );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", number_format( payout ) ), 4000, 3 );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, cash_format( payout ) );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 );
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
GivePlayerCash( playerid, payout );
|
||||
}
|
||||
else if ( player_score < dealer_score && dealer_score >= 17 ) {
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
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, number_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||
}
|
||||
else if ( player_score > dealer_score && dealer_score >= 17 ) {
|
||||
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, number_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", number_format( payout ) ), 4000, 3 );
|
||||
SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 );
|
||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||
GivePlayerCash( playerid, payout );
|
||||
}
|
||||
@ -624,7 +620,7 @@ 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, number_format( payout ) );
|
||||
SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -737,8 +733,11 @@ stock initializeBlackjackTextdraws( id )
|
||||
TextDrawUseBox( g_blackjackPlayerCards[ id ] [ c ] [ p ], 1 );
|
||||
TextDrawBoxColor( g_blackjackPlayerCards[ id ] [ c ] [ p ], 255 );
|
||||
TextDrawTextSize( g_blackjackPlayerCards[ id ] [ c ] [ p ], 22.000000, 37.000000 );
|
||||
|
||||
printf("%d", _:g_blackjackPlayerCards[ id ] [ c ] [ p ]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
stock IsPlayerHandBlackjack( tableid, player_index, card_count )
|
||||
@ -815,7 +814,7 @@ stock SetBlackjackDealerLabelValue( tableid, score ) {
|
||||
if ( score != -1 ) {
|
||||
UpdateDynamic3DTextLabelText( g_blackjackData[ tableid ] [ E_DEALER_LABEL ], COLOR_GREY, sprintf( "Dealer\nScore:"COL_WHITE" %d", score ) );
|
||||
} else {
|
||||
UpdateDynamic3DTextLabelText( g_blackjackData[ tableid ] [ E_DEALER_LABEL ], COLOR_WHITE, sprintf( "Press ENTER To Play Blackjack\n"COL_WHITE"%s Minimum", number_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ) );
|
||||
UpdateDynamic3DTextLabelText( g_blackjackData[ tableid ] [ E_DEALER_LABEL ], COLOR_WHITE, sprintf( "Press ENTER To Play Blackjack\n"COL_WHITE"%s Minimum", cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,10 +151,10 @@ CMD:boxing( playerid, params[ ] ) {
|
||||
|
||||
} else {
|
||||
|
||||
SendBoxing( playerid, "You have invited %s to a boxing match with a %s wager through %i round(s).", ReturnPlayerName( targetID ), number_format( g_boxingPlayerData[ playerid ] [ E_BET_AMOUNT_SET ] ), g_boxingPlayerData[ playerid ] [ E_ROUNDS_SET ] );
|
||||
SendBoxing( playerid, "You have invited %s to a boxing match with a %s wager through %i round(s).", ReturnPlayerName( targetID ), cash_format( g_boxingPlayerData[ playerid ] [ E_BET_AMOUNT_SET ] ), g_boxingPlayerData[ playerid ] [ E_ROUNDS_SET ] );
|
||||
SendBoxing( playerid, "To cancel your invite, use /boxing [CANCEL]." );
|
||||
|
||||
SendBoxing( targetID, "%s has invited you to a boxing match with a %s wager through %i round(s).", ReturnPlayerName( playerid ), number_format( g_boxingPlayerData[ playerid ] [ E_BET_AMOUNT_SET ] ), g_boxingPlayerData[ playerid ] [ E_ROUNDS_SET ] );
|
||||
SendBoxing( targetID, "%s has invited you to a boxing match with a %s wager through %i round(s).", ReturnPlayerName( playerid ), cash_format( g_boxingPlayerData[ playerid ] [ E_BET_AMOUNT_SET ] ), g_boxingPlayerData[ playerid ] [ E_ROUNDS_SET ] );
|
||||
SendBoxing( targetID, "To accept or decline the invite, use /boxing [ACCEPT/DECLINE]." );
|
||||
|
||||
}
|
||||
@ -323,7 +323,7 @@ stock EndMatch( playerid, targetID ) {
|
||||
} else {
|
||||
new winning_prize = floatround( float( g_boxingArenaData[ E_BET ] ) * 1.9 ); // We take 5% of the total pot
|
||||
GivePlayerCash( winnerid, winning_prize );
|
||||
SendBoxingGlobal( "%s has won a boxing match against %s for %s with a final score of %i!", ReturnPlayerName( winnerid ), ReturnPlayerName( loserid ), number_format( g_boxingArenaData[ E_BET ] ), g_boxingPlayerData[ winnerid ] [ E_SCORE ] );
|
||||
SendBoxingGlobal( "%s has won a boxing match against %s for %s with a final score of %i!", ReturnPlayerName( winnerid ), ReturnPlayerName( loserid ), cash_format( g_boxingArenaData[ E_BET ] ), g_boxingPlayerData[ winnerid ] [ E_SCORE ] );
|
||||
}
|
||||
|
||||
boxing_RestorePlayer( playerid );
|
||||
@ -362,7 +362,7 @@ stock boxing_ForfeitMatch( playerid, targetID ) {
|
||||
SendBoxingGlobal( "%s has won a boxing match by forfeit against %s.", ReturnPlayerName( targetID ), ReturnPlayerName( playerid ) );
|
||||
} else if ( g_boxingArenaData[ E_BET ] > 0 ) {
|
||||
GivePlayerCash( targetID, g_boxingArenaData[ E_BET ] );
|
||||
SendBoxingGlobal( "%s has won a boxing match by forfeit against %s for %s.", ReturnPlayerName( targetID ), ReturnPlayerName( playerid ), number_format( g_boxingArenaData[ E_BET ] ) );
|
||||
SendBoxingGlobal( "%s has won a boxing match by forfeit against %s for %s.", ReturnPlayerName( targetID ), ReturnPlayerName( playerid ), cash_format( g_boxingArenaData[ E_BET ] ) );
|
||||
}
|
||||
|
||||
boxing_RestorePlayer( playerid );
|
||||
|
@ -414,7 +414,7 @@ stock ResetLabel(handle)
|
||||
new const buy_in = TableData[handle][E_TABLE_BUY_IN];
|
||||
new const small_blind = TableData[handle][E_TABLE_SMALL_BLIND];
|
||||
UpdateDynamic3DTextLabelTextEx(TableData[handle][E_TABLE_POT_LABEL], COLOR_GREY,
|
||||
"Press ENTER To Play Poker\n{FFFFFF}%s Minimum\n%s / %s Blinds", number_format(buy_in), number_format(small_blind), number_format(small_blind * 2));
|
||||
"Press ENTER To Play Poker\n{FFFFFF}%s Minimum\n%s / %s Blinds", cash_format(buy_in), cash_format(small_blind), cash_format(small_blind * 2));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1030,7 +1030,7 @@ stock AddPlayerToTable(playerid, handle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(GetPlayerCash(playerid) < TableData[handle][E_TABLE_BUY_IN]) return SendPokerMessage(playerid, "You don't have enough money to access this table. Buy In: %s", number_format(TableData[handle][E_TABLE_BUY_IN]));
|
||||
if(GetPlayerCash(playerid) < TableData[handle][E_TABLE_BUY_IN]) return SendPokerMessage(playerid, "You don't have enough money to access this table. Buy In: %s", cash_format(TableData[handle][E_TABLE_BUY_IN]));
|
||||
|
||||
new index = Player_GetUnusedAttachIndex(playerid);
|
||||
if(index == cellmin)
|
||||
@ -1074,7 +1074,7 @@ stock AddPlayerToTable(playerid, handle)
|
||||
TableData[handle][E_TABLE_CHAIR_PLAYER_ID][slot] = playerid;
|
||||
GivePlayerCash(playerid, -TableData[handle][E_TABLE_BUY_IN]);
|
||||
PlayerData[playerid][E_PLAYER_TOTAL_CHIPS] = TableData[handle][E_TABLE_BUY_IN];
|
||||
SendPokerMessage(playerid, "You've been charged %s as a result of joining in the table.", number_format(TableData[handle][E_TABLE_BUY_IN]));
|
||||
SendPokerMessage(playerid, "You've been charged %s as a result of joining in the table.", cash_format(TableData[handle][E_TABLE_BUY_IN]));
|
||||
//Allow players to join a table where a game has already started but there are empty seats remaining (these players will be able to play once the current match finishes)
|
||||
if(TableData[handle][E_TABLE_CURRENT_STATE] != STATE_BEGIN)
|
||||
{
|
||||
@ -1136,13 +1136,13 @@ stock UpdateInfoTextdrawsForPlayer(playerid)
|
||||
{
|
||||
new handle = PlayerData[playerid][E_PLAYER_CURRENT_HANDLE];
|
||||
new tstring[64];
|
||||
format(tstring, sizeof(tstring), "~g~Chips:_~w~%s", number_format(PlayerData[playerid][E_PLAYER_TOTAL_CHIPS]));
|
||||
format(tstring, sizeof(tstring), "~g~Chips:_~w~%s", cash_format(PlayerData[playerid][E_PLAYER_TOTAL_CHIPS]));
|
||||
PlayerTextDrawSetString(playerid, PlayerData[playerid][E_PLAYER_INFO_TXT][2], tstring);
|
||||
format(tstring, sizeof(tstring), "~y~Pot:_~w~%s", number_format(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]));
|
||||
format(tstring, sizeof(tstring), "~y~Pot:_~w~%s", cash_format(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]));
|
||||
PlayerTextDrawSetString(playerid, PlayerData[playerid][E_PLAYER_INFO_TXT][3], tstring);
|
||||
format(tstring, sizeof(tstring), "~r~Last_bet:_~w~%s", number_format(TableData[handle][E_TABLE_LAST_BET]));
|
||||
format(tstring, sizeof(tstring), "~r~Last_bet:_~w~%s", cash_format(TableData[handle][E_TABLE_LAST_BET]));
|
||||
PlayerTextDrawSetString(playerid, PlayerData[playerid][E_PLAYER_INFO_TXT][4], tstring);
|
||||
format(tstring, sizeof(tstring), "~r~Your_bet:_~w~%s", number_format(PlayerData[playerid][E_PLAYER_CURRENT_BET]));
|
||||
format(tstring, sizeof(tstring), "~r~Your_bet:_~w~%s", cash_format(PlayerData[playerid][E_PLAYER_CURRENT_BET]));
|
||||
PlayerTextDrawSetString(playerid, PlayerData[playerid][E_PLAYER_INFO_TXT][5], tstring);
|
||||
return 1;
|
||||
}
|
||||
@ -1567,8 +1567,8 @@ public Poker_DealCards(handle)
|
||||
{
|
||||
PlayerData[big_blind][E_PLAYER_CURRENT_BET] = TableData[handle][E_TABLE_BIG_BLIND];
|
||||
PlayerData[small_blind][E_PLAYER_CURRENT_BET] = TableData[handle][E_TABLE_SMALL_BLIND];
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a small blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_SMALL_BLIND_ID]), number_format(TableData[handle][E_TABLE_SMALL_BLIND]));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a big blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_BIG_BLIND_ID]), number_format(TableData[handle][E_TABLE_BIG_BLIND]));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a small blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_SMALL_BLIND_ID]), cash_format(TableData[handle][E_TABLE_SMALL_BLIND]));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a big blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_BIG_BLIND_ID]), cash_format(TableData[handle][E_TABLE_BIG_BLIND]));
|
||||
new next_turn = GetTurnAfterPlayer(handle, TableData[handle][E_TABLE_PLAYER_BIG_BLIND_ID]);
|
||||
TableData[handle][E_TABLE_LAST_BET] = TableData[handle][E_TABLE_BIG_BLIND];
|
||||
SetLastToRaise(handle, next_turn);
|
||||
@ -1591,7 +1591,7 @@ public Poker_DealCards(handle)
|
||||
}
|
||||
else
|
||||
{
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a small blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_SMALL_BLIND_ID]), number_format(TableData[handle][E_TABLE_SMALL_BLIND]));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a small blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_SMALL_BLIND_ID]), cash_format(TableData[handle][E_TABLE_SMALL_BLIND]));
|
||||
RemoveChipsFromPlayer( small_blind, TableData[handle][E_TABLE_SMALL_BLIND]);
|
||||
PlayerData[small_blind][E_PLAYER_CURRENT_BET] = TableData[handle][E_TABLE_SMALL_BLIND];
|
||||
}
|
||||
@ -1610,7 +1610,7 @@ public Poker_DealCards(handle)
|
||||
else
|
||||
{
|
||||
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a big blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_BIG_BLIND_ID]), number_format(TableData[handle][E_TABLE_BIG_BLIND]));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s posts a big blind of %s.. * *", ReturnPlayerName(TableData[handle][E_TABLE_PLAYER_BIG_BLIND_ID]), cash_format(TableData[handle][E_TABLE_BIG_BLIND]));
|
||||
RemoveChipsFromPlayer( big_blind, TableData[handle][E_TABLE_BIG_BLIND]);
|
||||
PlayerData[big_blind][E_PLAYER_CURRENT_BET] = TableData[handle][E_TABLE_BIG_BLIND];
|
||||
TableData[handle][E_TABLE_LAST_BET] = TableData[handle][E_TABLE_BIG_BLIND];
|
||||
@ -1640,14 +1640,14 @@ static stock UpdateTable(handle)
|
||||
UpdateInfoTextdrawsForPlayer(playerid);
|
||||
new const seat = PlayerData[playerid][E_PLAYER_CURRENT_CHAIR_SLOT];
|
||||
new str[128 ];
|
||||
format(str, sizeof(str), "{34c5db}Chips: {db8d34}%s\n{db3a34}Last bet: {db8d34}%s", number_format(PlayerData[playerid][E_PLAYER_TOTAL_CHIPS]), number_format(PlayerData[playerid][E_PLAYER_CURRENT_BET]));
|
||||
format(str, sizeof(str), "{34c5db}Chips: {db8d34}%s\n{db3a34}Last bet: {db8d34}%s", cash_format(PlayerData[playerid][E_PLAYER_TOTAL_CHIPS]), cash_format(PlayerData[playerid][E_PLAYER_CURRENT_BET]));
|
||||
UpdateDynamic3DTextLabelText(TableData[handle][E_TABLE_BET_LABELS][seat], T_BET_LABEL_COLOR, str);
|
||||
SetChipsValue(handle, PlayerData[playerid][E_PLAYER_CURRENT_CHAIR_SLOT], PlayerData[playerid][E_PLAYER_TOTAL_CHIPS]);
|
||||
|
||||
}
|
||||
new str[256];
|
||||
new tmp[10];
|
||||
format(str, sizeof(str), "{59cdff}Main Pot: {ff9059}%s\n", number_format(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]));
|
||||
format(str, sizeof(str), "{59cdff}Main Pot: {ff9059}%s\n", cash_format(TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]));
|
||||
SetPotChipsValue(handle, TableData[handle][E_TABLE_POT_CHIPS][MAIN_POT]);
|
||||
if(Iter_Count(IT_Sidepots[handle] > 1))
|
||||
{
|
||||
@ -1655,7 +1655,7 @@ static stock UpdateTable(handle)
|
||||
foreach(new i: IT_Sidepots[handle])
|
||||
{
|
||||
if(i == MAIN_POT) continue;
|
||||
format(tmp, sizeof(tmp), "%s\n", number_format(TableData[handle][E_TABLE_POT_CHIPS][i]));
|
||||
format(tmp, sizeof(tmp), "%s\n", cash_format(TableData[handle][E_TABLE_POT_CHIPS][i]));
|
||||
strcat(str, tmp);
|
||||
}
|
||||
}
|
||||
@ -1983,7 +1983,7 @@ stock CheckShowdown(handle)
|
||||
GivePlayerCasinoRewardsPoints(high_id, fee_earned, .house_edge = 100.0);
|
||||
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}Prize: {377CC8}%s | -%0.0f%s percent fee.", number_format(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
||||
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee.", cash_format(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
||||
SendTableMessage(handle, "{9FCF30}****************************************************************************************");
|
||||
if (strmatch(HAND_RANKS[highest_rank >> 12], "Royal Flush")) printf("****\nRoyal Flush Player %s\n****\n", ReturnPlayerName(high_id));
|
||||
PlayerData[high_id][E_PLAYER_TOTAL_CHIPS] += w_chips;
|
||||
@ -2199,7 +2199,7 @@ stock bool: FoldPlayer(handle, playerid)
|
||||
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 );
|
||||
GivePlayerCasinoRewardsPoints(winner, fee_earned, .house_edge = 100.0);
|
||||
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee", number_format(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
||||
SendTableMessage(handle, "{9FCF30}Prize: {377CC8}%s | -%0.0f%s percent fee", cash_format(w_chips), T_POT_FEE_RATE * 100.0, "%%");
|
||||
SendTableMessage(handle, "{9FCF30}****************************************************************************************");
|
||||
PlayerData[winner][E_PLAYER_TOTAL_CHIPS] += w_chips;
|
||||
PlayerData[winner][E_PLAYER_TOTAL_CHIPS] += PlayerData[winner][E_PLAYER_CURRENT_BET];
|
||||
@ -2260,8 +2260,8 @@ hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
|
||||
if(PlayerData[playerid][E_PLAYER_TOTAL_CHIPS] >= dif)
|
||||
{
|
||||
KillPlayerTurnTimer(playerid);
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s calls %s .. * *", ReturnPlayerName(playerid), number_format(dif));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{22B1BD}** CALLS %s ** ", number_format(dif));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s calls %s .. * *", ReturnPlayerName(playerid), cash_format(dif));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{22B1BD}** CALLS %s ** ", cash_format(dif));
|
||||
RemoveChipsFromPlayer( playerid, dif);
|
||||
PlayerData[playerid][E_PLAYER_CURRENT_BET] = TableData[handle][E_TABLE_LAST_BET];
|
||||
SetPlayerClickedTxt(playerid, true);
|
||||
@ -2310,8 +2310,8 @@ stock ForcePlayerAllIn(playerid, handle, bool:checkpot = true)
|
||||
Iter_Add(IT_PlayersAllIn<handle>, playerid);
|
||||
new raise = PlayerData[playerid][E_PLAYER_TOTAL_CHIPS] + PlayerData[playerid][E_PLAYER_CURRENT_BET];
|
||||
PlayerData[playerid][E_PLAYER_CURRENT_BET] = raise;
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s goes all in with %s .. * *", ReturnPlayerName(playerid), number_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{9512CD}** ALL IN with %s ** ", number_format(raise));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s goes all in with %s .. * *", ReturnPlayerName(playerid), cash_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{9512CD}** ALL IN with %s ** ", cash_format(raise));
|
||||
PlayerData[playerid][E_PLAYER_TOTAL_CHIPS] = 0;
|
||||
if(checkpot)
|
||||
CheckPotAndNextTurn(playerid, handle);
|
||||
@ -2333,7 +2333,7 @@ hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
|
||||
{
|
||||
GivePlayerCash(playerid, -TableData[handle][E_TABLE_BUY_IN]);
|
||||
PlayerData[playerid][E_PLAYER_TOTAL_CHIPS] = TableData[handle][E_TABLE_BUY_IN];
|
||||
SendTableMessage(handle, ""COL_GREY"-- "COL_WHITE"Player %s has paid the buy-in fee of %s chips to keep playing.", ReturnPlayerName(playerid), number_format(TableData[handle][E_TABLE_BUY_IN]));
|
||||
SendTableMessage(handle, ""COL_GREY"-- "COL_WHITE"Player %s has paid the buy-in fee of %s chips to keep playing.", ReturnPlayerName(playerid), cash_format(TableData[handle][E_TABLE_BUY_IN]));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2378,7 +2378,7 @@ hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
|
||||
}
|
||||
else if(raise <= TableData[handle][E_TABLE_LAST_BET])
|
||||
{
|
||||
SendPokerMessage(playerid, "Value must be greater than the last bet: %s", number_format(TableData[handle][E_TABLE_LAST_BET]));
|
||||
SendPokerMessage(playerid, "Value must be greater than the last bet: %s", cash_format(TableData[handle][E_TABLE_LAST_BET]));
|
||||
ShowPlayerRaiseDialog(playerid);
|
||||
return 1;
|
||||
}
|
||||
@ -2387,8 +2387,8 @@ hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
|
||||
ApplyAnimation(playerid, "INT_OFFICE", "OFF_Sit_Idle_Loop", 4.1, 1, 1, 1, 0, 0, 1);
|
||||
KillPlayerTurnTimer(playerid);
|
||||
//all in - not mandatory
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s goes all in with %s .. * *", ReturnPlayerName(playerid), number_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{9512CD}** ALL IN with %s ** ", number_format(raise));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s goes all in with %s .. * *", ReturnPlayerName(playerid), cash_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{9512CD}** ALL IN with %s ** ", cash_format(raise));
|
||||
Iter_Add(IT_PlayersAllIn<handle>, playerid);
|
||||
RemoveChipsFromPlayer( playerid, raise);
|
||||
SetLastToRaise(handle, playerid);
|
||||
@ -2407,13 +2407,13 @@ hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
|
||||
RemoveChipsFromPlayer( playerid, dif);
|
||||
if(PlayerData[playerid][E_PLAYER_RCHOICE] == E_RAISE_BET)
|
||||
{
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s bets %s .. * *", ReturnPlayerName(playerid), number_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{31CA15}** BETS %s ** ", number_format(raise));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s bets %s .. * *", ReturnPlayerName(playerid), cash_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{31CA15}** BETS %s ** ", cash_format(raise));
|
||||
}
|
||||
else
|
||||
{
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s raises to %s .. * *", ReturnPlayerName(playerid), number_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{31CA15}** RAISES to %s ** ", number_format(raise));
|
||||
SendTableMessage(handle, "{2DD9A9} * * %s raises to %s .. * *", ReturnPlayerName(playerid), cash_format(raise));
|
||||
SetPlayerChatBubbleEx(playerid, -1, 30.0, 2000, "{31CA15}** RAISES to %s ** ", cash_format(raise));
|
||||
}
|
||||
CheckPotAndNextTurn(playerid, handle);
|
||||
}
|
||||
@ -2605,7 +2605,7 @@ CMD:ctable(playerid, params[])
|
||||
new Float:Pos[3];
|
||||
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
|
||||
new table = CreatePokerTable(buy_in, small_blind, Pos[0], Pos[1], Pos[2]-0.6, seats, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
|
||||
SendPokerMessage(playerid, "You have created table ID: %d | Small blind: %s | Big blind: %s | Buy In: %s | Seats: %d", table, number_format(small_blind), number_format(small_blind*2), number_format(buy_in), seats);
|
||||
SendPokerMessage(playerid, "You have created table ID: %d | Small blind: %s | Big blind: %s | Buy In: %s | Seats: %d", table, cash_format(small_blind), cash_format(small_blind*2), cash_format(buy_in), seats);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
TextDrawShowForPlayer( i, g_rouletteNumberTD[ rouletteid ] );
|
||||
|
||||
if ( ! p_rouletteBetLocked{ i } ) {
|
||||
SendServerMessage( i, "%s(%d) has waged %s with this spin, press SPACE to join the spin!", ReturnPlayerName( playerid ), playerid, number_format( totalBet ) );
|
||||
SendServerMessage( i, "%s(%d) has waged %s with this spin, press SPACE to join the spin!", ReturnPlayerName( playerid ), playerid, cash_format( totalBet ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
g_rouletteTableData[ rouletteid ] [ E_SPINNING_TIMER ] = SetTimerEx( "OnSpinRouletteTable", 25, false, "ddd", rouletteid, 0, 1 );
|
||||
|
||||
// inform other players
|
||||
SendServerMessage( playerid, "You have begun the spin with a wager of %s. Good luck!", number_format( totalBet ) );
|
||||
SendServerMessage( playerid, "You have begun the spin with a wager of %s. Good luck!", cash_format( totalBet ) );
|
||||
}
|
||||
else SendServerMessage( playerid, "You have joined the spin. Good luck!" );
|
||||
}
|
||||
@ -280,7 +280,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
if ( ( p_rouletteBetValue[ playerid ] /= 2 ) < 1000 )
|
||||
p_rouletteBetValue[ playerid ] = 1000;
|
||||
|
||||
SendServerMessage( playerid, "You are now betting %s, gamble responsibly!", number_format( p_rouletteBetValue[ playerid ] ) );
|
||||
SendServerMessage( playerid, "You are now betting %s, gamble responsibly!", cash_format( p_rouletteBetValue[ playerid ] ) );
|
||||
}
|
||||
|
||||
// increase bet
|
||||
@ -289,7 +289,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
if ( ( p_rouletteBetValue[ playerid ] *= 2 ) > g_rouletteTableData[ rouletteid ] [ E_MAX_BET ] )
|
||||
p_rouletteBetValue[ playerid ] = g_rouletteTableData[ rouletteid ] [ E_MAX_BET ];
|
||||
|
||||
SendServerMessage( playerid, "You are now betting %s, gamble responsibly!", number_format( p_rouletteBetValue[ playerid ] ) );
|
||||
SendServerMessage( playerid, "You are now betting %s, gamble responsibly!", cash_format( p_rouletteBetValue[ playerid ] ) );
|
||||
}
|
||||
|
||||
// Cancel Bets
|
||||
@ -331,7 +331,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
|
||||
// Exceeded The Maximum
|
||||
if ( totalBet + p_rouletteBetValue[ playerid ] > g_rouletteTableData[ rouletteid ] [ E_MAX_BET ] ) {
|
||||
return SendError( playerid, "You are only allowed to bet a total of %s per spin on this table.", number_format( g_rouletteTableData[ rouletteid ] [ E_MAX_BET ] ) );
|
||||
return SendError( playerid, "You are only allowed to bet a total of %s per spin on this table.", cash_format( g_rouletteTableData[ rouletteid ] [ E_MAX_BET ] ) );
|
||||
}
|
||||
|
||||
PlayerPlaySound( playerid, 1083, 0.0, 0.0, 5.0 );
|
||||
@ -370,7 +370,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
SetDynamicObjectMaterialText( g_rouletteChip[ playerid ] [ 0 ] [ column ], 0, " ", .backcolor = color );
|
||||
g_rouletteChip[ playerid ] [ 1 ] [ column ] = CreateDynamicObject(1905, offsetX, offsetY, g_rouletteTableData[ rouletteid ] [ E_Z ] - height + 0.125, 0.0, 0.0, 0.0, .worldid = g_rouletteTableData[ rouletteid ] [ E_WORLD ], .priority = 9999);
|
||||
SetDynamicObjectMaterialText( g_rouletteChip[ playerid ] [ 1 ] [ column ], 0, ConvertRouletteChipValue( g_rouletteChipValue[ playerid ] [ column ] ), 50, "Arial", 44, 1, color, -1, 1 );
|
||||
g_rouletteChipLabel[ playerid ] [ column ] = CreateDynamic3DTextLabel( sprintf( "%s", number_format( g_rouletteChipValue[ playerid ] [ column ] ) ), g_rouletteChipColor[ playerid ], offsetX, offsetY, g_rouletteTableData[ rouletteid ] [ E_Z ] - 0.15 + ( float( playerid ) / 100 ), 5.0 ); //INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, playerid );
|
||||
g_rouletteChipLabel[ playerid ] [ column ] = CreateDynamic3DTextLabel( sprintf( "%s", cash_format( g_rouletteChipValue[ playerid ] [ column ] ) ), g_rouletteChipColor[ playerid ], offsetX, offsetY, g_rouletteTableData[ rouletteid ] [ E_Z ] - 0.15 + ( float( playerid ) / 100 ), 5.0 ); //INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, playerid );
|
||||
//printf("(%s) CREATED CHIP %d:%d", ReturnPlayerName( playerid ), g_rouletteChip[ playerid ] [ column ], _: g_rouletteChipLabel[ playerid ] [ column ] );
|
||||
}
|
||||
else
|
||||
@ -378,7 +378,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
|
||||
SetDynamicObjectMaterialText( g_rouletteChip[ playerid ] [ 1 ] [ column ], 0, ConvertRouletteChipValue( g_rouletteChipValue[ playerid ] [ column ] ), 50, "Arial", 44, 1, color, -1, 1 );
|
||||
SetDynamicObjectPos( g_rouletteChip[ playerid ] [ 0 ] [ column ], offsetX, offsetY, g_rouletteTableData[ rouletteid ] [ E_Z ] - height );
|
||||
SetDynamicObjectPos( g_rouletteChip[ playerid ] [ 1 ] [ column ], offsetX, offsetY, g_rouletteTableData[ rouletteid ] [ E_Z ] - height + 0.125 );
|
||||
UpdateDynamic3DTextLabelText( g_rouletteChipLabel[ playerid ] [ column ], g_rouletteChipColor[ playerid ], sprintf( "%s", number_format( g_rouletteChipValue[ playerid ] [ column ] ) ) );
|
||||
UpdateDynamic3DTextLabelText( g_rouletteChipLabel[ playerid ] [ column ], g_rouletteChipColor[ playerid ], sprintf( "%s", cash_format( g_rouletteChipValue[ playerid ] [ column ] ) ) );
|
||||
//printf("(%s) UPDATED CHIP %d:%d", ReturnPlayerName( playerid ), g_rouletteChip[ playerid ] [ column ], _: g_rouletteChipLabel[ playerid ] [ column ] );
|
||||
}
|
||||
}
|
||||
@ -473,7 +473,7 @@ stock CreateRouletteTable( Float: X, Float: Y, Float: Z, Float: Angle, world, ma
|
||||
X += 1.365 * floatcos( Angle + 98.0, degrees );
|
||||
Y += 1.365 * floatsin( Angle + 98.0, degrees );
|
||||
|
||||
CreateDynamic3DTextLabel( sprintf( "Press ENTER To Play Roulette\n"COL_WHITE"%s Maximum", number_format( maxbet ) ), COLOR_GREY, X, Y, Z + 0.02, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, .worldid = world, .testlos = 0 );
|
||||
CreateDynamic3DTextLabel( sprintf( "Press ENTER To Play Roulette\n"COL_WHITE"%s Maximum", cash_format( maxbet ) ), COLOR_GREY, X, Y, Z + 0.02, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, .worldid = world, .testlos = 0 );
|
||||
|
||||
new Float: a_x = g_rouletteTableData[ id ] [ E_X ] + 1.4 * floatcos( Angle + 29.0, degrees );
|
||||
new Float: a_y = g_rouletteTableData[ id ] [ E_Y ] + 1.4 * floatsin( Angle + 29.0, degrees );
|
||||
@ -685,7 +685,7 @@ 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, number_format( profit ) );
|
||||
SendGlobalMessage( -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
|
||||
@ -693,12 +693,12 @@ public OnRouletteWheelStop( rouletteid, winner )
|
||||
|
||||
// gametext
|
||||
if ( profit > 0 ) {
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", number_format( profit ) ), 4000, 3 );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and profited %s! (winning no %d)", number_format( waged ), number_format( profit ), winner );
|
||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( profit ) ), 4000, 3 );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and profited %s! (winning no %d)", cash_format( waged ), cash_format( profit ), winner );
|
||||
} else {
|
||||
profit *= -1; // to improve the client message
|
||||
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)", number_format( waged ), number_format( profit ), winner );
|
||||
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[ROULETTE]"COL_WHITE" You have bet a total of %s and lost %s! (winning no %d)", cash_format( waged ), cash_format( profit ), winner );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user