fixes bank money saving, moves into it's own function, removes sm limit, increases ic limit to 10,000
This commit is contained in:
parent
36f48e753b
commit
687bd240f0
@ -14,6 +14,9 @@
|
|||||||
/* ** Variables ** */
|
/* ** Variables ** */
|
||||||
static stock p_BankMoney [ MAX_PLAYERS ];
|
static stock p_BankMoney [ MAX_PLAYERS ];
|
||||||
|
|
||||||
|
/* ** Forwards ** */
|
||||||
|
forward OnPlayerBankMoneyChanged ( playerid, amount );
|
||||||
|
|
||||||
/* ** Hooks ** */
|
/* ** Hooks ** */
|
||||||
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
||||||
{
|
{
|
||||||
|
@ -494,7 +494,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_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 ( 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." );
|
||||||
else if ( GetPlayerScore( playerid ) < 1000 ) return SendError( playerid, "You need at least 1,000 score to send coins to other players." );
|
else if ( GetPlayerScore( playerid ) < 1000 ) return SendError( playerid, "You need at least 1,000 score to send coins to other players." );
|
||||||
|
@ -3189,11 +3189,11 @@ CMD:sendmoney( playerid, params[ ] )
|
|||||||
if ( amount > 25000 )
|
if ( amount > 25000 )
|
||||||
printf("[sendmoney] %s -> %s - %s", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), cash_format( amount ) ); // 8hska7082bmahu
|
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 ));
|
printf("ISP banned %s for making a 75M transaction", ReturnPlayerName( playerid ));
|
||||||
AdvancedBan( playerid, "Server", "Suspicious Transaction", ReturnPlayerIP( playerid ) );
|
AdvancedBan( playerid, "Server", "Suspicious Transaction", ReturnPlayerIP( playerid ) );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
GivePlayerCash( pID, amount );
|
GivePlayerCash( pID, amount );
|
||||||
GivePlayerCash( playerid, -( amount ) );
|
GivePlayerCash( playerid, -( amount ) );
|
||||||
@ -4628,7 +4628,17 @@ function unpause_Player( playerid )
|
|||||||
// save player money on each monetary movement
|
// save player money on each monetary movement
|
||||||
if ( IsPlayerLoggedIn( playerid ) )
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user