From a2ee7a830ef307b2f17b62ad9f2e45655afaf603 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 27 Jan 2019 19:29:55 +1100 Subject: [PATCH 1/5] move changes cmd into cnr/changelog.pwn --- gamemodes/irresistible/cnr/_cnr.pwn | 1 + gamemodes/irresistible/cnr/changelog.pwn | 73 +++++++++++++++++++ .../irresistible/cnr/commands/_commands.pwn | 1 - 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 gamemodes/irresistible/cnr/changelog.pwn diff --git a/gamemodes/irresistible/cnr/_cnr.pwn b/gamemodes/irresistible/cnr/_cnr.pwn index cf9abd4..3b808af 100644 --- a/gamemodes/irresistible/cnr/_cnr.pwn +++ b/gamemodes/irresistible/cnr/_cnr.pwn @@ -20,6 +20,7 @@ #include "irresistible\cnr\wanted_level.pwn" #include "irresistible\cnr\jobs.pwn" #include "irresistible\cnr\model_preview.pwn" +#include "irresistible\cnr\changelog.pwn" // reliant on core definitions #include "irresistible\cnr\auth\_auth.pwn" diff --git a/gamemodes/irresistible/cnr/changelog.pwn b/gamemodes/irresistible/cnr/changelog.pwn new file mode 100644 index 0000000..0acb97a --- /dev/null +++ b/gamemodes/irresistible/cnr/changelog.pwn @@ -0,0 +1,73 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Cloudy, Lorenc + * Module: cnr\commands\cmd_changes.pwn + * Purpose: /changes to show all changes by a player + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Error Checking ** */ +#if !defined SERVER_CHANGES_FILE + #endinput +#endif + +/* ** Commands ** */ +CMD:changes( playerid, params[ ] ) return cmd_updates( playerid, params ); // Command by Cloudy & Sponyy +CMD:updates( playerid, params[ ] ) +{ + new + File: handle = fopen( "updates.txt", io_read ); + + if ( ! handle ) + return SendError( playerid, "There are no updates to show." ); + + erase( szNormalString ); + erase( szHugeString ); + + while ( fread( handle, szNormalString ) ) + { + new + find = strfind( szNormalString, "(+)" ); + + // additions + if( find != -1 ) + { + strins( szNormalString, "{23D96F}added{FFFFFF}\t\t", find + 3 ); + strdel( szNormalString, find, find + 3); + } + + // removals + find = strfind( szNormalString, "(-)" ); + if( find != -1 ) + { + strins( szNormalString, "{D92323}removed{FFFFFF}\t", find + 3 ); + strdel( szNormalString, find, find + 3 ); + } + + // fixes + find = strfind( szNormalString, "(*)" ); + if ( find != -1 ) + { + strins( szNormalString, "{D9A823}fixed{FFFFFF}\t\t", find + 3 ); + strdel( szNormalString, find, find + 3 ); + } + + // fixes + find = strfind( szNormalString, "(/)" ); + if ( find != -1 ) + { + strins( szNormalString, "{c0c0c0}changed{FFFFFF}\t", find + 3 ); + strdel( szNormalString, find, find + 3 ); + } + + // append + strcat( szHugeString, szNormalString ); + } + + fclose( handle ); + ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, "{FFFFFF}Recent Updates - " #FILE_BUILD, szHugeString, "Okay", "" ); + SendServerMessage( playerid, "You're now viewing the latest changes to the gamemode (version "#FILE_BUILD")." ); + return 1; +} \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/commands/_commands.pwn b/gamemodes/irresistible/cnr/commands/_commands.pwn index defedbd..9b01742 100644 --- a/gamemodes/irresistible/cnr/commands/_commands.pwn +++ b/gamemodes/irresistible/cnr/commands/_commands.pwn @@ -9,7 +9,6 @@ #include "irresistible\cnr\commands\admin\_admin.pwn" /* ** Files ** */ -#include "irresistible\cnr\commands\cmd_changes.pwn" #include "irresistible\cnr\commands\cmd_twitter.pwn" #include "irresistible\cnr\commands\cmd_highscores.pwn" #include "irresistible\cnr\commands\cmd_nametags.pwn" From 499e1fdc488850e111d46a7aed9d710b26fa2946 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 27 Jan 2019 19:32:16 +1100 Subject: [PATCH 2/5] update gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d96f5f2..aacca12 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ pawno/* # filterscripts filterscripts/* !filterscripts/objects.pwn +!filterscri # plugins plugins/* @@ -35,7 +36,8 @@ gamemodes/irresistible/config/database.pwn scriptfiles/**/* !scriptfiles/COD/ !scriptfiles/COD/** -!scriptfiles/updates.txt +!scriptfiles/changelogs/ +!scriptfiles/changelogs/** # npc npcmodes/**/* From a3eee5ae2660a28304539e304be411fda8a3db59 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 27 Jan 2019 19:52:42 +1100 Subject: [PATCH 3/5] move to scriptfiles/changelogs/cnr --- gamemodes/irresistible/cnr/changelog.pwn | 129 ++++++++++-------- .../cnr/commands/admin/admin_six.pwn | 2 +- .../irresistible/cnr/commands/cmd_changes.pwn | 73 ---------- gamemodes/irresistible/config/server.pwn | 4 +- gamemodes/sf-cnr.pwn | 6 +- scriptfiles/changelogs/cnr/_changelogs.cfg | 1 + .../cnr/v11.50.140.txt} | 0 7 files changed, 79 insertions(+), 136 deletions(-) delete mode 100644 gamemodes/irresistible/cnr/commands/cmd_changes.pwn create mode 100644 scriptfiles/changelogs/cnr/_changelogs.cfg rename scriptfiles/{updates.txt => changelogs/cnr/v11.50.140.txt} (100%) diff --git a/gamemodes/irresistible/cnr/changelog.pwn b/gamemodes/irresistible/cnr/changelog.pwn index 0acb97a..4521e72 100644 --- a/gamemodes/irresistible/cnr/changelog.pwn +++ b/gamemodes/irresistible/cnr/changelog.pwn @@ -8,66 +8,83 @@ /* ** Includes ** */ #include < YSI\y_hooks > + #define GetServerVersion(%0) \ + ( "UNKNOWN" ) + #endinput /* ** Error Checking ** */ -#if !defined SERVER_CHANGES_FILE +#if !defined SERVER_CHANGES_DIRECTORY + + #endinput #endif +/* ** Definitions ** */ +#define CHANGELOG_INDEX_FILE ( SERVER_CHANGES_DIRECTORY # "/_changelogs.cfg" ) + /* ** Commands ** */ -CMD:changes( playerid, params[ ] ) return cmd_updates( playerid, params ); // Command by Cloudy & Sponyy -CMD:updates( playerid, params[ ] ) +// CMD:changes( playerid, params[ ] ) return cmd_updates( playerid, params ); // Command by Cloudy & Sponyy +// CMD:updates( playerid, params[ ] ) +// { +// new +// File: handle = fopen( SERVER_CHANGES_DIRECTORY # "/updates.txt", io_read ); + +// if ( ! handle ) +// return SendError( playerid, "There are no updates to show." ); + +// erase( szNormalString ); +// erase( szHugeString ); + +// while ( fread( handle, szNormalString ) ) +// { +// new +// find = strfind( szNormalString, "(+)" ); + +// // additions +// if( find != -1 ) +// { +// strins( szNormalString, "{23D96F}added{FFFFFF}\t\t", find + 3 ); +// strdel( szNormalString, find, find + 3); +// } + +// // removals +// find = strfind( szNormalString, "(-)" ); +// if( find != -1 ) +// { +// strins( szNormalString, "{D92323}removed{FFFFFF}\t", find + 3 ); +// strdel( szNormalString, find, find + 3 ); +// } + +// // fixes +// find = strfind( szNormalString, "(*)" ); +// if ( find != -1 ) +// { +// strins( szNormalString, "{D9A823}fixed{FFFFFF}\t\t", find + 3 ); +// strdel( szNormalString, find, find + 3 ); +// } + +// // fixes +// find = strfind( szNormalString, "(/)" ); +// if ( find != -1 ) +// { +// strins( szNormalString, "{c0c0c0}changed{FFFFFF}\t", find + 3 ); +// strdel( szNormalString, find, find + 3 ); +// } + +// // append +// strcat( szHugeString, szNormalString ); +// } + +// fclose( handle ); +// ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, sprintf( "{FFFFFF}Recent Updates - %s", GetServerVersion( ) ), szHugeString, "Okay", "" ); +// SendServerMessage( playerid, "You're now viewing the latest changes to the gamemode (version %s).", GetServerVersion( ) ); +// return 1; +// } + +/* ** Functions ** */ +stock GetServerVersion( ) { - new - File: handle = fopen( "updates.txt", io_read ); - - if ( ! handle ) - return SendError( playerid, "There are no updates to show." ); - - erase( szNormalString ); - erase( szHugeString ); - - while ( fread( handle, szNormalString ) ) - { - new - find = strfind( szNormalString, "(+)" ); - - // additions - if( find != -1 ) - { - strins( szNormalString, "{23D96F}added{FFFFFF}\t\t", find + 3 ); - strdel( szNormalString, find, find + 3); - } - - // removals - find = strfind( szNormalString, "(-)" ); - if( find != -1 ) - { - strins( szNormalString, "{D92323}removed{FFFFFF}\t", find + 3 ); - strdel( szNormalString, find, find + 3 ); - } - - // fixes - find = strfind( szNormalString, "(*)" ); - if ( find != -1 ) - { - strins( szNormalString, "{D9A823}fixed{FFFFFF}\t\t", find + 3 ); - strdel( szNormalString, find, find + 3 ); - } - - // fixes - find = strfind( szNormalString, "(/)" ); - if ( find != -1 ) - { - strins( szNormalString, "{c0c0c0}changed{FFFFFF}\t", find + 3 ); - strdel( szNormalString, find, find + 3 ); - } - - // append - strcat( szHugeString, szNormalString ); - } - - fclose( handle ); - ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, "{FFFFFF}Recent Updates - " #FILE_BUILD, szHugeString, "Okay", "" ); - SendServerMessage( playerid, "You're now viewing the latest changes to the gamemode (version "#FILE_BUILD")." ); - return 1; + static + version[ 32 ]; + printf( "Version: %s", version ); + return version; } \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn index 3bc5501..bc36451 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_six.pwn @@ -320,7 +320,7 @@ CMD:svrstats( playerid, params[ ] ) return SendError( playerid, ADMIN_COMMAND_REJECT ); if ( strmatch( params, "version" ) ) - return SendServerMessage( playerid, "Current version is "COL_GREY"%s", FILE_BUILD ), 1; + return SendServerMessage( playerid, "Current version is "COL_GREY"%s", GetServerVersion( ) ), 1; if ( strmatch( params, "ticks" ) ) return SendServerMessage( playerid, "Current tick rate of server is: %d", GetServerTickRate( ) ), 1; diff --git a/gamemodes/irresistible/cnr/commands/cmd_changes.pwn b/gamemodes/irresistible/cnr/commands/cmd_changes.pwn deleted file mode 100644 index 0acb97a..0000000 --- a/gamemodes/irresistible/cnr/commands/cmd_changes.pwn +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Irresistible Gaming (c) 2018 - * Developed by Cloudy, Lorenc - * Module: cnr\commands\cmd_changes.pwn - * Purpose: /changes to show all changes by a player - */ - -/* ** Includes ** */ -#include < YSI\y_hooks > - -/* ** Error Checking ** */ -#if !defined SERVER_CHANGES_FILE - #endinput -#endif - -/* ** Commands ** */ -CMD:changes( playerid, params[ ] ) return cmd_updates( playerid, params ); // Command by Cloudy & Sponyy -CMD:updates( playerid, params[ ] ) -{ - new - File: handle = fopen( "updates.txt", io_read ); - - if ( ! handle ) - return SendError( playerid, "There are no updates to show." ); - - erase( szNormalString ); - erase( szHugeString ); - - while ( fread( handle, szNormalString ) ) - { - new - find = strfind( szNormalString, "(+)" ); - - // additions - if( find != -1 ) - { - strins( szNormalString, "{23D96F}added{FFFFFF}\t\t", find + 3 ); - strdel( szNormalString, find, find + 3); - } - - // removals - find = strfind( szNormalString, "(-)" ); - if( find != -1 ) - { - strins( szNormalString, "{D92323}removed{FFFFFF}\t", find + 3 ); - strdel( szNormalString, find, find + 3 ); - } - - // fixes - find = strfind( szNormalString, "(*)" ); - if ( find != -1 ) - { - strins( szNormalString, "{D9A823}fixed{FFFFFF}\t\t", find + 3 ); - strdel( szNormalString, find, find + 3 ); - } - - // fixes - find = strfind( szNormalString, "(/)" ); - if ( find != -1 ) - { - strins( szNormalString, "{c0c0c0}changed{FFFFFF}\t", find + 3 ); - strdel( szNormalString, find, find + 3 ); - } - - // append - strcat( szHugeString, szNormalString ); - } - - fclose( handle ); - ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, "{FFFFFF}Recent Updates - " #FILE_BUILD, szHugeString, "Okay", "" ); - SendServerMessage( playerid, "You're now viewing the latest changes to the gamemode (version "#FILE_BUILD")." ); - return 1; -} \ No newline at end of file diff --git a/gamemodes/irresistible/config/server.pwn b/gamemodes/irresistible/config/server.pwn index b4d1987..911b1f6 100644 --- a/gamemodes/irresistible/config/server.pwn +++ b/gamemodes/irresistible/config/server.pwn @@ -9,8 +9,6 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define FILE_BUILD "v11.45.130" - #define SERVER_NAME "San Fierro Cops And Robbers (0.3.7)" #define SERVER_MODE_TEXT "Cops And Robbers / DM / Gangs" #define SERVER_MAP "San Fierro" @@ -23,7 +21,7 @@ #define SERVER_RULES_URL "files.sfcnr.com/en_rules.txt" // used for /rules (cnr\features\server_rules.pwn) #define SERVER_TWITTER_FEED_URL "files.sfcnr.com/cnr_twitter.php" // used for /twitter (cnr\commands\cmd_twitter.pwn) #define SERVER_HELP_API_URL "sfcnr.com/api/player/help" // used for /help (cnr\commands\cmd_help.pwn) -#define SERVER_CHANGES_FILE "updates.txt" // used for /changes (cnr\commands\cmd_changes.pwn) +#define SERVER_CHANGES_DIRECTORY "changelogs/cnr" // used for /changes (cnr\changelog.pwn) #define SERVER_PLS_DONATE_MP3 "http://files.sfcnr.com/game_sounds/pls_donate.mp3" // used for advertising vip (cnr\features\vip\coin_market.pwn) #define SERVER_MIGRATIONS_FOLDER "./gamemodes/irresistible/config/migrations/cnr/" // used for migrations checking (config\migrations\_migrations.pwn) diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 2e2c0bf..2043622 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -148,7 +148,7 @@ public OnGameModeInit() rl_ServerUpdate = SetTimer( "OnServerUpdateTimer", 960, true ); rl_ZoneUpdate = SetTimer( "OnServerSecondTick", 980, true ); - printf( "[SF-CNR] SF-CnR has been successfully initialized. (Build: "#FILE_BUILD" | Time: %d | Tickcount: %d)", ( g_ServerUptime = gettime( ) ), GetTickCount( ) ); + printf( "[SF-CNR] SF-CnR has been successfully initialized. (Build: %s | Time: %d | Tickcount: %d)", GetServerVersion( ), ( g_ServerUptime = gettime( ) ), GetTickCount( ) ); return 1; } @@ -265,7 +265,7 @@ public OnServerUpdateTimer( ) { // AFK Jail if ( p_WantedLevel[ playerid ] >= 6 && p_InHouse[ playerid ] == -1 && !IsPlayerAdminOnDuty( playerid ) && !IsPlayerInEntrance( playerid, g_VIPLounge[ CITY_SF ] ) && !IsPlayerInEntrance( playerid, g_VIPLounge[ CITY_LV ] ) && !IsPlayerInEntrance( playerid, g_VIPLounge[ CITY_LS ] ) && !IsPlayerTied( playerid ) && !IsPlayerKidnapped( playerid ) && !IsPlayerCuffed( playerid ) && !IsPlayerTazed( playerid ) && IsPlayerSpawned( playerid ) ) { // && !IsPlayerDetained( playerid ) - + if ( !AwardNearestLEO( playerid, 1 ) ) { JailPlayer( playerid, 60, 1 ); @@ -431,7 +431,7 @@ public OnPlayerConnect( playerid ) jailDoors( playerid, false, false ); SendClientMessage( playerid, 0xa9c4e4ff, "{FF0000}[WARNING]{a9c4e4} The concept in this server and GTA in general may be considered explicit material." ); - SendClientMessage( playerid, 0xa9c4e4ff, "{FF0000}[INFO]{a9c4e4} The server is currently operating on version " # FILE_BUILD "." ); + SendClientMessageFormatted( playerid, 0xa9c4e4ff, "{FF0000}[INFO]{a9c4e4} The server is currently operating on version %s.", GetServerVersion( ) ); if ( IsValidServerVariable( "connectsong" ) ) { diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg new file mode 100644 index 0000000..f741be1 --- /dev/null +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -0,0 +1 @@ +v11.50.140 \ No newline at end of file diff --git a/scriptfiles/updates.txt b/scriptfiles/changelogs/cnr/v11.50.140.txt similarity index 100% rename from scriptfiles/updates.txt rename to scriptfiles/changelogs/cnr/v11.50.140.txt From a62aae90c40f6763cf2d67307721817eae7435cb Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 3 Feb 2019 21:12:41 +1100 Subject: [PATCH 4/5] show changelogs in _changelogs.cfg file --- gamemodes/irresistible/cnr/changelog.pwn | 178 ++++++++++++++------- scriptfiles/changelogs/cnr/_changelogs.cfg | 1 + scriptfiles/changelogs/cnr/v11.50.142.txt | 2 + 3 files changed, 127 insertions(+), 54 deletions(-) create mode 100644 scriptfiles/changelogs/cnr/v11.50.142.txt diff --git a/gamemodes/irresistible/cnr/changelog.pwn b/gamemodes/irresistible/cnr/changelog.pwn index 4521e72..766e988 100644 --- a/gamemodes/irresistible/cnr/changelog.pwn +++ b/gamemodes/irresistible/cnr/changelog.pwn @@ -8,83 +8,153 @@ /* ** Includes ** */ #include < YSI\y_hooks > - #define GetServerVersion(%0) \ - ( "UNKNOWN" ) - #endinput /* ** Error Checking ** */ #if !defined SERVER_CHANGES_DIRECTORY - - + #define GetServerVersion(%0) ( "UNKNOWN" ) #endinput #endif /* ** Definitions ** */ #define CHANGELOG_INDEX_FILE ( SERVER_CHANGES_DIRECTORY # "/_changelogs.cfg" ) +#define DIALOG_CHANGELOGS ( 8372 ) /* ** Commands ** */ -// CMD:changes( playerid, params[ ] ) return cmd_updates( playerid, params ); // Command by Cloudy & Sponyy -// CMD:updates( playerid, params[ ] ) -// { -// new -// File: handle = fopen( SERVER_CHANGES_DIRECTORY # "/updates.txt", io_read ); +CMD:changes( playerid, params[ ] ) return cmd_updates( playerid, params ); +CMD:updates( playerid, params[ ] ) +{ + new + File: handle = fopen( CHANGELOG_INDEX_FILE, io_read ); -// if ( ! handle ) -// return SendError( playerid, "There are no updates to show." ); + if ( ! handle ) + return SendError( playerid, "There are no updates to show." ); -// erase( szNormalString ); -// erase( szHugeString ); + new + changelogs = 0; -// while ( fread( handle, szNormalString ) ) -// { -// new -// find = strfind( szNormalString, "(+)" ); + szHugeString = ""COL_WHITE"Version\t \n"; -// // additions -// if( find != -1 ) -// { -// strins( szNormalString, "{23D96F}added{FFFFFF}\t\t", find + 3 ); -// strdel( szNormalString, find, find + 3); -// } + // read each line in the changelog index file + while ( fread( handle, szNormalString ) ) + { + // remove white spaces + strreplace( szNormalString, "\n", "" ), trimString( szNormalString ); -// // removals -// find = strfind( szNormalString, "(-)" ); -// if( find != -1 ) -// { -// strins( szNormalString, "{D92323}removed{FFFFFF}\t", find + 3 ); -// strdel( szNormalString, find, find + 3 ); -// } + // format string + format( szHugeString, sizeof( szHugeString ), "%s%s\t%s\n", szHugeString, szNormalString, ! changelogs ? ( COL_GREEN # "CURRENT" ) : ( " " ) ); + changelogs ++; + } -// // fixes -// find = strfind( szNormalString, "(*)" ); -// if ( find != -1 ) -// { -// strins( szNormalString, "{D9A823}fixed{FFFFFF}\t\t", find + 3 ); -// strdel( szNormalString, find, find + 3 ); -// } + // list all changelogs + ShowPlayerDialog( playerid, DIALOG_CHANGELOGS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Changelogs", szHugeString, "Select", "Close" ); + return 1; +} -// // fixes -// find = strfind( szNormalString, "(/)" ); -// if ( find != -1 ) -// { -// strins( szNormalString, "{c0c0c0}changed{FFFFFF}\t", find + 3 ); -// strdel( szNormalString, find, find + 3 ); -// } +/* ** Hooks ** */ +hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) +{ + if ( dialogid == DIALOG_CHANGELOGS && response ) + { + new File: handle = fopen( CHANGELOG_INDEX_FILE, io_read ); -// // append -// strcat( szHugeString, szNormalString ); -// } + if ( ! handle ) + return SendError( playerid, "There are no updates to show." ); -// fclose( handle ); -// ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, sprintf( "{FFFFFF}Recent Updates - %s", GetServerVersion( ) ), szHugeString, "Okay", "" ); -// SendServerMessage( playerid, "You're now viewing the latest changes to the gamemode (version %s).", GetServerVersion( ) ); -// return 1; -// } + new version[ 32 ], x = 0; + + while ( fread( handle, version ) ) + { + if ( x == listitem ) + { + // remove white spaces + strreplace( version, "\n", "" ), trimString( version ); + + // open the single changelog + new File: changelog_handle = fopen( sprintf( SERVER_CHANGES_DIRECTORY # "/%s.txt", version ), io_read ); + + if ( ! changelog_handle ) + return SendError( playerid, "There are no updates to show for this version." ); + + erase( szNormalString ); + erase( szHugeString ); + + while ( fread( changelog_handle, szNormalString ) ) + { + new + find = strfind( szNormalString, "(+)" ); + + // additions + if( find != -1 ) + { + strins( szNormalString, "{23D96F}added{FFFFFF}\t\t", find + 3 ); + strdel( szNormalString, find, find + 3); + } + + // removals + find = strfind( szNormalString, "(-)" ); + if( find != -1 ) + { + strins( szNormalString, "{D92323}removed{FFFFFF}\t", find + 3 ); + strdel( szNormalString, find, find + 3 ); + } + + // fixes + find = strfind( szNormalString, "(*)" ); + if ( find != -1 ) + { + strins( szNormalString, "{D9A823}fixed{FFFFFF}\t\t", find + 3 ); + strdel( szNormalString, find, find + 3 ); + } + + // fixes + find = strfind( szNormalString, "(/)" ); + if ( find != -1 ) + { + strins( szNormalString, "{c0c0c0}changed{FFFFFF}\t", find + 3 ); + strdel( szNormalString, find, find + 3 ); + } + + // append + strcat( szHugeString, szNormalString ); + } + + fclose( changelog_handle ); + + ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, sprintf( "{FFFFFF}Recent Updates - %s", version ), szHugeString, "Okay", "" ); + SendServerMessage( playerid, "You're now viewing the changes to the gamemode (version %s).", version ); + } + x ++; + } + + fclose( handle ); + } + return 1; +} /* ** Functions ** */ stock GetServerVersion( ) { static version[ 32 ]; - printf( "Version: %s", version ); + + if ( version[ 0 ] == '\0' ) + { + new + File: handle = fopen( CHANGELOG_INDEX_FILE, io_read ); + + if ( handle ) + { + // read the first line of the index file + fread( handle, version ); + + // remove white spaces + strreplace( version, "\n", "" ), trimString( version ); + } + else + { + version = "UNKNOWN"; + } + + fclose( handle ); + } return version; } \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index f741be1..08274aa 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -1 +1,2 @@ +v11.50.142 v11.50.140 \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.50.142.txt b/scriptfiles/changelogs/cnr/v11.50.142.txt new file mode 100644 index 0000000..c0d5623 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.50.142.txt @@ -0,0 +1,2 @@ +(+) You can now use /GPS to find the closest ATM or vehicle with /gps [ATM/VEHICLE]. +(+) /changes will show a list of changelogs from hereon out. \ No newline at end of file From 29abdab4b85e33a675cb10f7bd98627182bbada5 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sun, 3 Feb 2019 21:14:35 +1100 Subject: [PATCH 5/5] dump gitignore line --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index aacca12..5d637ed 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ pawno/* # filterscripts filterscripts/* !filterscripts/objects.pwn -!filterscri # plugins plugins/*