From 1ac960569cbe6e2f7fab57368b81fdfad35ae557 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 17 Apr 2019 20:08:22 -0400 Subject: [PATCH] gives business bank money upon selling & resets business bank --- .../irresistible/cnr/features/business/business.pwn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/business/business.pwn b/gamemodes/irresistible/cnr/features/business/business.pwn index f3dd31f..70ad150 100644 --- a/gamemodes/irresistible/cnr/features/business/business.pwn +++ b/gamemodes/irresistible/cnr/features/business/business.pwn @@ -695,7 +695,8 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) } new - iCashMoney = floatround( g_businessData[ iBusiness ] [ E_COST ] / 2 ); + iCashMoney = floatround( g_businessData[ iBusiness ] [ E_COST ] / 2 ), + iBankMoney = g_businessData[ iBusiness ][ E_BANK ]; p_OwnedBusinesses[ playerid ] --; g_businessData[ iBusiness ] [ E_OWNER_ID ] = 0; @@ -704,10 +705,10 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) StopBusinessExportMission( iBusiness ); UpdateBusinessData( iBusiness ); UpdateBusinessTitle( iBusiness ); // No point querying (add on resale) - GivePlayerCash( playerid, iCashMoney ); - + + GivePlayerCash( playerid, iCashMoney + iBankMoney ); SetPlayerPosEx( playerid, g_businessData[ iBusiness ] [ E_X ], g_businessData[ iBusiness ] [ E_Y ], g_businessData[ iBusiness ] [ E_Z ], 0 ), SetPlayerVirtualWorld( playerid, 0 ); - SendServerMessage( playerid, "You have successfully sold your business for "COL_GOLD"%s"COL_WHITE".", cash_format( iCashMoney ) ); + SendServerMessage( playerid, "You have successfully sold your business for "COL_GOLD"%s"COL_WHITE" and withdrawn "COL_GOLD"%i"COL_WHITE" from the business bank.", cash_format( iCashMoney ), cash_format( iBankMoney ) ); DeletePVar( playerid, "biz_sell_id" ); return 1; @@ -1543,6 +1544,7 @@ stock ResetBusiness( iBusiness, bool: hard_reset = false ) // data g_businessData[ iBusiness ] [ E_PRODUCT ] = 0; g_businessData[ iBusiness ] [ E_SUPPLIES ] = 0; + g_businessData[ iBusiness ] [ E_BANK ] = 0; // upgrades g_businessData[ iBusiness ] [ E_CAR_MODEL_ID ] = 554;