fixes bank money saving, moves into it's own function, removes sm limit, increases ic limit to 10,000

This commit is contained in:
Damen 2019-01-15 18:04:57 -05:00
parent 36f48e753b
commit 687bd240f0
3 changed files with 17 additions and 4 deletions

View File

@ -14,6 +14,9 @@
/* ** Variables ** */
static stock p_BankMoney [ MAX_PLAYERS ];
/* ** Forwards ** */
forward OnPlayerBankMoneyChanged ( playerid, amount );
/* ** Hooks ** */
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{

View File

@ -494,7 +494,7 @@ CMD:irresistiblecoins( playerid, params[ ] )
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 ( 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 ( coins < 0.1 || coins > 5000.0 ) return SendError( playerid, "You can only send between 0.1 and 5,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 ( GetPlayerIrresistibleCoins( playerid ) < coins ) return SendError( playerid, "You do not have this number of coins to send." );
else if ( GetPlayerScore( playerid ) < 1000 ) return SendError( playerid, "You need at least 1,000 score to send coins to other players." );

View File

@ -3189,11 +3189,11 @@ CMD:sendmoney( playerid, params[ ] )
if ( amount > 25000 )
printf("[sendmoney] %s -> %s - %s", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), cash_format( amount ) ); // 8hska7082bmahu
if ( amount > 90000000 ) {
/*if ( amount > 90000000 ) {
printf("ISP banned %s for making a 75M transaction", ReturnPlayerName( playerid ));
AdvancedBan( playerid, "Server", "Suspicious Transaction", ReturnPlayerIP( playerid ) );
return 1;
}
}*/
GivePlayerCash( pID, amount );
GivePlayerCash( playerid, -( amount ) );
@ -4628,7 +4628,17 @@ function unpause_Player( playerid )
// save player money on each monetary movement
if ( IsPlayerLoggedIn( playerid ) )
{
mysql_single_query( sprintf( "UPDATE `USERS` SET `CASH` = %d, `BANKMONEY` = %d WHERE `ID` = %d", GetPlayerCash( playerid ), GetPlayerBankMoney( playerid ), GetPlayerAccountID( playerid ) ) );
mysql_single_query( sprintf( "UPDATE `USERS` SET `CASH` = %d WHERE `ID` = %d", GetPlayerCash( playerid ), GetPlayerAccountID( playerid ) ) );
}
return 1;
}
public OnPlayerBankMoneyChanged( playerid, amount )
{
// save player bank money on each monetary movement
if ( IsPlayerLoggedIn( playerid ) )
{
mysql_single_query( sprintf( "UPDATE `USERS` SET `BANKMONEY` = %d WHERE `ID` = %d", GetPlayerBankMoney( playerid ), GetPlayerAccountID( playerid ) ) );
}
return 1;
}