adjustments, fixes, etc.
This commit is contained in:
parent
438e25e7d7
commit
7d30117650
@ -629,7 +629,8 @@ CMD:chatban( playerid, params[ ] )
|
|||||||
p_ChatBannedBy[ pID ] = ReturnPlayerName( playerid );
|
p_ChatBannedBy[ pID ] = ReturnPlayerName( playerid );
|
||||||
p_ChatBanReason[ pID ] = reason;
|
p_ChatBanReason[ pID ] = reason;
|
||||||
mysql_single_query( sprintf( "INSERT INTO `CHAT_BANS` (`ID`, `NAME`, `BANNED_BY_ID`, `BANNED_BY`, `REASON`) VALUES (%d, '%s', %d, '%s', '%s')", p_AccountID[ pID ], mysql_escape( ReturnPlayerName( pID ) ), p_AccountID[ playerid ], mysql_escape( ReturnPlayerName( playerid ) ), mysql_escape( reason ) ) );
|
mysql_single_query( sprintf( "INSERT INTO `CHAT_BANS` (`ID`, `NAME`, `BANNED_BY_ID`, `BANNED_BY`, `REASON`) VALUES (%d, '%s', %d, '%s', '%s')", p_AccountID[ pID ], mysql_escape( ReturnPlayerName( pID ) ), p_AccountID[ playerid ], mysql_escape( ReturnPlayerName( playerid ) ), mysql_escape( reason ) ) );
|
||||||
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat banned by %s for '%s'.", ReturnPlayerName( pID ), reason );
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat banned by %s for '%s'.", ReturnPlayerName( playerid ), reason );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat banned %s for '%s'.", ReturnPlayerName( pID ), reason );
|
||||||
AddAdminLogLineFormatted( "%s(%d) has chat banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
AddAdminLogLineFormatted( "%s(%d) has chat banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
SaveToAdminLog( playerid, p_AccountID[ pID ], "chat ban" );
|
SaveToAdminLog( playerid, p_AccountID[ pID ], "chat ban" );
|
||||||
}
|
}
|
||||||
@ -651,7 +652,8 @@ CMD:unchatban( playerid, params[ ] )
|
|||||||
{
|
{
|
||||||
p_ChatBanned{ pID } = false;
|
p_ChatBanned{ pID } = false;
|
||||||
mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) );
|
mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) );
|
||||||
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( pID ) );
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( pID ) );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat unbanned %s.", ReturnPlayerName( pID ) );
|
||||||
AddAdminLogLineFormatted( "%s(%d) has chat unbanned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
AddAdminLogLineFormatted( "%s(%d) has chat unbanned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
SaveToAdminLog( playerid, p_AccountID[ pID ], "chat unban" );
|
SaveToAdminLog( playerid, p_AccountID[ pID ], "chat unban" );
|
||||||
}
|
}
|
||||||
|
@ -14,16 +14,16 @@
|
|||||||
#include "irresistible\cnr\features\cop\emp.pwn"
|
#include "irresistible\cnr\features\cop\emp.pwn"
|
||||||
|
|
||||||
/* ** Hooks ** */
|
/* ** Hooks ** */
|
||||||
hook OnPlayerGiveDamage( playerid, damagedid, Float: amount, weaponid, bodypart )
|
/*hook OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid, bodypart )
|
||||||
{
|
{
|
||||||
if ( p_Class[ damagedid ] == CLASS_POLICE )
|
if ( p_Class[ playerid ] == CLASS_POLICE && !IsPlayerNPC( playerid ) )
|
||||||
{
|
{
|
||||||
new Float: x, Float: y, Float: z;
|
new Float: x, Float: y, Float: z;
|
||||||
|
|
||||||
GetPlayerPos( damagedid, x, y, z );
|
GetPlayerPos( playerid, x, y, z );
|
||||||
|
|
||||||
if ( x >= -1650.0 && x <= -1571.0 && y >= 647.0 && y <= 711.0 )
|
if ( x >= -1650.0 && x <= -1571.0 && y >= 647.0 && y <= 711.0 )
|
||||||
return ShowPlayerHelpDialog( playerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0;
|
return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}*/
|
@ -556,7 +556,7 @@ hook OnPlayerUpdateEx( playerid )
|
|||||||
Float: radius = 25.0,
|
Float: radius = 25.0,
|
||||||
closestCivilian = GetClosestPlayerEx( playerid, CLASS_CIVILIAN, radius );
|
closestCivilian = GetClosestPlayerEx( playerid, CLASS_CIVILIAN, radius );
|
||||||
|
|
||||||
if ( GetPlayerWantedLevel( closestCivilian ) != 0 )
|
if ( closestCivilian != INVALID_PLAYER_ID && GetPlayerWantedLevel( closestCivilian ) != 0 )
|
||||||
{
|
{
|
||||||
return ShowPlayerHelpDialog( playerid, 4000, "Use ~y~/taze [ID]~w~, ~b~/cuff [ID]~w~, and ~r~/ar [ID] ~w~commands to arrest." );
|
return ShowPlayerHelpDialog( playerid, 4000, "Use ~y~/taze [ID]~w~, ~b~/cuff [ID]~w~, and ~r~/ar [ID] ~w~commands to arrest." );
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ CMD:irresistiblecoins( playerid, params[ ] )
|
|||||||
|
|
||||||
if ( sscanf( params[ 5 ],"uf", senttoid, coins ) ) return SendUsage( playerid, "/irresistiblecoins send [PLAYER_ID] [COINS]" );
|
if ( sscanf( params[ 5 ],"uf", senttoid, coins ) ) return SendUsage( playerid, "/irresistiblecoins send [PLAYER_ID] [COINS]" );
|
||||||
else if ( !IsPlayerConnected( senttoid ) || IsPlayerNPC( senttoid ) ) return SendError( playerid, "Invalid Player ID." );
|
else if ( !IsPlayerConnected( senttoid ) || IsPlayerNPC( senttoid ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
else if ( p_VIPLevel[ playerid ] < VIP_BRONZE ) return SendError( playerid, "You are not a Bronze V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
|
else if ( p_VIPLevel[ playerid ] < VIP_REGULAR ) return SendError( playerid, "You are not a Regular V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
|
||||||
else if ( coins < 0.1 || coins > 10000.0 ) return SendError( playerid, "You can only send between 0.1 and 10,000.0 coins at a single time." );
|
else if ( coins < 0.1 || coins > 10000.0 ) return SendError( playerid, "You can only send between 0.1 and 10,000.0 coins at a single time." );
|
||||||
else if ( coins > 99999999 || coins < 0 ) return SendError( playerid, "You can only send between 0.1 and 5,000.0 coins at a single time." ); // Making cash go over billions...
|
else if ( coins > 99999999 || coins < 0 ) return SendError( playerid, "You can only send between 0.1 and 5,000.0 coins at a single time." ); // Making cash go over billions...
|
||||||
else if ( GetPlayerIrresistibleCoins( playerid ) < coins ) return SendError( playerid, "You do not have this number of coins to send." );
|
else if ( GetPlayerIrresistibleCoins( playerid ) < coins ) return SendError( playerid, "You do not have this number of coins to send." );
|
||||||
|
@ -572,7 +572,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, cash_format( payout ) );
|
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 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~y~%s returned!", cash_format( payout ) ), 4000, 3 );
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
||||||
}
|
}
|
||||||
@ -585,18 +585,18 @@ 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, cash_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!", cash_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 );
|
if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
||||||
}
|
}
|
||||||
else if ( dealer_score == 21 ) {
|
else if ( dealer_score == 21 ) {
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
if ( payout != 0 ) 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, cash_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 );
|
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 ], .house_edge = 1.5 );
|
if ( payout != 0 ) 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, cash_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 );
|
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||||
@ -605,12 +605,12 @@ 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, cash_format( payout ) );
|
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 );
|
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 );
|
||||||
GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
||||||
}
|
}
|
||||||
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 ], .house_edge = 1.5 );
|
if ( payout != 0 ) 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, cash_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 );
|
GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 );
|
||||||
@ -619,7 +619,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, cash_format( 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, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) );
|
||||||
GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_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 );
|
if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 );
|
||||||
GivePlayerCash( playerid, payout );
|
GivePlayerCash( playerid, payout );
|
||||||
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 );
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,6 @@ CMD:casino( playerid, params[ ] )
|
|||||||
|
|
||||||
/* ** Functions ** */
|
/* ** Functions ** */
|
||||||
stock GivePlayerCasinoRewardsPoints( playerid, bet_amount, Float: house_edge ) {
|
stock GivePlayerCasinoRewardsPoints( playerid, bet_amount, Float: house_edge ) {
|
||||||
if ( bet_amount == 0 ) return 1;
|
|
||||||
if ( bet_amount < 0 ) bet_amount *= -1; // profit or loss, does not matter
|
if ( bet_amount < 0 ) bet_amount *= -1; // profit or loss, does not matter
|
||||||
// printf("(%f * ((%f * 100.0) * (%f / 100.0))) / %f\n",bet_amount, house_edge, CASINO_REWARDS_PAYOUT_PERCENT, 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;
|
new Float: final_points = ( bet_amount * ( ( house_edge / 100.0 ) * ( CASINO_REWARDS_PAYOUT_PERCENT / 100.0 ) ) ) / CASINO_REWARDS_DIVISOR;
|
||||||
|
@ -694,7 +694,7 @@ public OnRouletteWheelStop( rouletteid, winner )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// give user points
|
// give user points
|
||||||
GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 );
|
if ( profit != 0 ) GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 );
|
||||||
|
|
||||||
// gametext
|
// gametext
|
||||||
if ( profit > 0 ) {
|
if ( profit > 0 ) {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#pragma option -d3
|
#pragma option -d3
|
||||||
#pragma dynamic 7200000
|
#pragma dynamic 7200000
|
||||||
|
|
||||||
// #define DEBUG_MODE
|
#define DEBUG_MODE
|
||||||
|
|
||||||
#if defined DEBUG_MODE
|
#if defined DEBUG_MODE
|
||||||
#pragma option -d3
|
#pragma option -d3
|
||||||
@ -2519,6 +2519,11 @@ CMD:myaccid( playerid, params[ ] )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CMD:discord( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
return SendServerMessage( playerid, "Visit 'sfcnr.com/discord' to join our Discord server!" );
|
||||||
|
}
|
||||||
|
|
||||||
CMD:job( playerid, params[ ] )
|
CMD:job( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
if ( p_VIPLevel[ playerid ] >= VIP_PLATINUM && p_VIPJob{ playerid } != p_Job{ playerid } )
|
if ( p_VIPLevel[ playerid ] >= VIP_PLATINUM && p_VIPJob{ playerid } != p_Job{ playerid } )
|
||||||
|
Loading…
Reference in New Issue
Block a user