remove auto-save feature because it is already automatic now

This commit is contained in:
Lorenc Pekaj 2019-01-01 22:46:57 +11:00
parent df6c8385b6
commit 304881b123
8 changed files with 17 additions and 26 deletions

View File

@ -453,7 +453,6 @@ CMD:business( playerid, params[ ] )
UpdateBusinessData( b );
UpdateBusinessTitle( b );
GivePlayerCash( playerid, -( g_businessData[ b ] [ E_COST ] ) );
autosaveStart( playerid, true );
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[BUSINESS]"COL_WHITE" You have bought this business for "COL_GOLD"%s"COL_WHITE".", cash_format( g_businessData[ b ] [ E_COST ] ) );
return 1;
}

View File

@ -160,7 +160,6 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
return SendError( playerid, "You don't have enough money for this ($5,000,000)." );
GivePlayerCash( playerid, -5000000 );
autosaveStart( playerid, true ); // auto-save
new aID = p_apartmentEnter{ playerid };
g_apartmentData[ aID ] [ E_CREATED ] = true;

View File

@ -426,7 +426,6 @@ CMD:h( playerid, params[ ] )
return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
GivePlayerCash( playerid, -( g_houseData[ i ] [ E_COST ] ) );
autosaveStart( playerid, true ); // force_save
SendServerMessage( playerid, "You have bought this home for "COL_GOLD"%s"COL_WHITE"!", cash_format( g_houseData[ i ] [ E_COST ] ) );
SetHouseOwner( i, p_AccountID[ playerid ], ReturnPlayerName( playerid ) );

View File

@ -9,14 +9,14 @@
#include < YSI\y_hooks >
/* ** Definitions ** */
#define MAX_SETTINGS ( 14 )
#define MAX_SETTINGS ( 13 )
#define SETTING_BAILOFFERS ( 0 )
#define SETTING_EVENT_TP ( 1 )
#define SETTING_GANG_INVITES ( 2 )
#define SETTING_CHAT_PREFIXES ( 3 )
#define SETTING_RANSOMS ( 4 )
#define SETTING_AUTOSAVE ( 5 )
#define SETTING_CHAT_ID ( 5 )
#define SETTING_CONNECTION_LOG ( 6 )
#define SETTING_HITMARKER ( 7 )
#define SETTING_VIPSKIN ( 8 )
@ -24,14 +24,13 @@
#define SETTING_TOP_DONOR ( 10 )
#define SETTING_WEAPON_PICKUP ( 11 )
#define SETTING_PASSIVE_MODE ( 12 )
#define SETTING_CHAT_ID ( 13 )
/* ** Variables ** */
static stock
g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = {
{ "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" },
{ "Prevent Auto-Save" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" },
{ "Manual Pickup Weapon" }, { "Prevent Passive Mode" }, { "Display User ID In Chat" }
{ "Display User ID In Chat" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" },
{ "Manual Pickup Weapon" }, { "Prevent Passive Mode" }
},
bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ]
;

View File

@ -210,7 +210,6 @@ CMD:garage( playerid, params[ ] )
UpdateGarageData( g );
UpdateGarageTitle( g );
GivePlayerCash( playerid, -( g_garageData[ g ] [ E_PRICE ] ) );
autosaveStart( playerid, true ); // auto-save
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You have bought this garage for "COL_GOLD"%s"COL_WHITE".", cash_format( g_garageData[ g ] [ E_PRICE ] ) );
return 1;
}

View File

@ -354,7 +354,6 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
new bID = CreateBuyableVehicle( playerid, model, random( 126 ), random( 126 ), X, Y, Z, fA, g_BuyableVehicleData[ data_id ] [ E_PRICE ] );
if ( bID == -1 ) return SendClientMessage( playerid, -1, ""COL_GREY"[VEHICLE]"COL_WHITE" Unable to create a vehicle due to a unexpected error." );
GivePlayerCash( playerid, -g_BuyableVehicleData[ data_id ] [ E_PRICE ] );
autosaveStart( playerid, true ); // auto-save
GetVehicleParamsEx( g_vehicleData[ playerid ] [ bID ] [ E_VEHICLE_ID ], engine, lights, alarm, doors, bonnet, boot, objective );
SetVehicleParamsEx( g_vehicleData[ playerid ] [ bID ] [ E_VEHICLE_ID ], VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective );

View File

@ -0,0 +1,13 @@
-- CREATE A MIGRATION ENTRY
INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190101_cnr_remove_xp_autosave');
-- BEGIN
-- -- REMOVE REDUNDANT COLUMN XP IN USERS
ALTER TABLE `USERS` DROP `XP`;
-- -- REMOVE AUTO SAVE SETTING
DELETE FROM `SETTINGS` WHERE SETTING_ID = 5;
-- -- REPLACE AUTO SAVE SETTING WITH CHAT ID SETTING
UPDATE SETTINGS SET SETTING_ID = 5 WHERE SETTING_ID = 13;

View File

@ -8022,22 +8022,6 @@ stock returnCityName( city )
return string;
}
stock autosaveStart( playerid, bool: force_save = false )
{
new
iTime = g_iTime;
if ( IsPlayerSettingToggled( playerid, SETTING_AUTOSAVE ) && force_save == false )
return;
if ( GetPVarInt( playerid, "last_transaction" ) > iTime && force_save == false )
return;
SavePlayerData( playerid );
SetPVarInt( playerid, "last_transaction", iTime + 15 );
SendClientMessage( playerid, -1, IsPlayerSettingToggled( playerid, SETTING_AUTOSAVE ) ? ( ""COL_LRED"[AUTO-SAVE]"COL_WHITE" Your statistics have been saved." ) : (""COL_LRED"[AUTO-SAVE]"COL_WHITE" Your statistics have been saved, "COL_GREY"you can disable this over /cp"COL_WHITE"." ) );
}
stock getCurrentDate( )
{
static