Raised This Month: $32 Target: $400
 8% 

[NMRiH] WinRate (v1.0.6 03/31/2018 )


Post New Thread Reply   
 
Thread Tools Display Modes
Author
yomox9
Member
Join Date: Jan 2014
Location: jp
Plugin ID:
6021
Plugin Version:
1.0.6
Plugin Category:
Statistical
Plugin Game:
No More Room in Hell
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Show Winning rate (Winning percentage)
    Old 02-14-2018 , 21:11   [NMRiH] WinRate (v1.0.6 03/31/2018 )
    Reply With Quote #1

    Description:
    WinRate plugin records the count of plays, the count of winning, and the winning average for each player, each map in MySQL for
    NMRiH. By entering a command in the chat field, the plyer can view the recorded information.

    Made by Dayonn_dayonn http://steamcommunity.com/profiles/76561198355987637/
    Uploaded by yomox9 http://steamcommunity.com/id/yomox9/

    My english is poor. So please simple sentence.

    Chat command:
    !winrate or !wr
    Enter it in the chat field.

    Example:



    Installation:

    1.
    Install the database software "MySQL" to the server where you want to store the database.
    MySQL Community Server (GPL) of MySQL Community Edition (GPL).That is freeware.


    2.
    Open /configs/NMRiH_WinRate.cfg and change that setting.


    3.
    Copy these files.
    NMRiH_WinRate.cfg --> addons/sourcemod/configs/
    NMRiH_WinRate.phrases.txt --> addons/sourcemod/translations/
    NMRiH_WinRate.smx --> addons/sourcemod/plugins/
    NMRiH_WinRate.sp --> addons/sourcemod/scripting/

    4.
    Open addons/sourcemod/configs/databases.cfg and add the settings.
    As an example, if "Database_keyvalues" of NMRiH_WinRate.cfg is "nmrih_winrate", it becomes as follows.

    Code:
    	//--------------------------------------------
    		"nmrih_winrate"
    		{
    			"driver"		"mysql"
    			"host"			"localhost"
    			"database"		"nmrih_winrate_data"
    			"user"			"root"
    			"pass"			"root"
    		}
    	//--------------------------------------------
    "nmrih_winrate" -- The key value of "Database_keyvalues".
    "driver" -- Set this to "mysql".
    "host" -- If the server executing NMRiH and the server where the database is located are the same, set this to
    "localhost". If it is different, enter the URL or IP address of the server where the database is
    located.
    "database" -- The database name. As with table names, there are restrictions on characters.
    "user" -- Your Mysql user name.
    "pass" -- Your Mysql password.

    Even if the key values ​​of "Database_keyvalues" and "database" are made the same, there is no problem.

    5.
    Create a database with MySQL Command Line Client.
    As an example, if "database" is "nmrih_winrate_data" in databases.cfg, it becomes as follows.

    Code:
    	//---------------------------------------
    		create database nmrih_winrate_data;
    	//---------------------------------------
    6.
    Load this plugin at NMRiH.

    Code:
    	//---------------------------------
    		sm plugins load NMRiH_WinRate
    	//---------------------------------
    Uninstallation:

    1.
    Delete these files.
    addons/sourcemod/configs/NMRiH_WinRate.cfg
    addons/sourcemod/translations/NMRiH_WinRate.phrases.txt
    addons/sourcemod/plugins/NMRiH_WinRate.smx
    addons/sourcemod/scripting/NMRiH_WinRate.sp


    2.
    Delete the database with MySQL Command Line Client.
    As an example, if "database" is "nmrih_winrate_data" in databases.cfg, it becomes as follows.

    //---------------------------------------
    drop database nmrih_winrate_data;
    //---------------------------------------


    3.
    If you need, uninstall the database software "MySQL".

    Changelog:
    02/15/2018 v1.0.5 Initial release
    03/31/2018 v1.0.6
    • (Fix) Overall change of Explanatory text.(Except for .sp files.)
    • (Fix) Change the file name to follow other plugins.
    • (Fix) Supported the game interruption by rtv, mapchooser, and console command (changelevel, changelevel_next).
    Attached Files
    File Type: zip NMRiH_WinRate_v1.0.6.ZIP (122.1 KB, 234 views)

    Last edited by yomox9; 03-30-2018 at 20:32. Reason: fix installation
    yomox9 is offline
    alansdit12
    AlliedModders Donor
    Join Date: Nov 2015
    Location: Indonesia
    Old 02-16-2018 , 05:35   Re: [NMRiH]Winrate (v1.0.5 02/15/2018 )
    Reply With Quote #2

    Nice plugin.
    By the way, can you add more info about how this plugin works?
    alansdit12 is offline
    Dayonn_dayonn
    Member
    Join Date: Feb 2018
    Location: japan
    Old 02-16-2018 , 09:08   Re: [NMRiH]Winrate (v1.0.5 02/15/2018 )
    Reply With Quote #3

    Quote:
    Originally Posted by alansdit12 View Post
    Nice plugin.
    By the way, can you add more info about how this plugin works?
    This plugin counts the number of plays and wins on each map of your server's players.
    Players can check the victory probability for each map.

    By doing this, the player can know the map difficulty for player-self.
    This plugin does not rank players, this plugin ranks the maps only.

    Currently, this plugin is installed in JP yomox9 servers. Please connect to yomox9 server and enter "!wr" in the chat field.

    This plugin is not complete yet.
    If the map is changed by a method other than victory / failure / call vote, this plugin will judge that online players failed current map.
    (If the map is changed with call vote, this plugin will judge that alive players does not play current games, and dead players failed current games.)
    If rtv plugin is installed on your server, I can not recommend installing this plugin yet. Also, I can not recommend changing maps with server commands when this plugin installed.
    Dayonn_dayonn is offline
    Lunreth
    BANNED
    Join Date: Dec 2019
    Location: Argentina, Buenos Aires
    Old 04-02-2020 , 20:42   Re: [NMRiH] WinRate (v1.0.6 03/31/2018 )
    Reply With Quote #4

    Some people will experience an error "Couldn't find this server name in NMRiH_WinRate.cfg" even though the hostname matches with WinRate CFG so for those who want to fix this just change this function "Load_config()" and paste the following code:

    Code:
    public void Load_config()
    {
    	hConfig = new KeyValues("WinRate_Config");	// CloseHandle() or delete でクローズしないといけない
    
    	char sConfig_Path[PLATFORM_MAX_PATH];
    	BuildPath(Path_SM, sConfig_Path, sizeof(sConfig_Path), "configs/NMRiH_WinRate.cfg");
    														// configファイルのsourcemodフォルダからの相対パスを指定
    	if (!hConfig.ImportFromFile(sConfig_Path)) 
    	{
    		SetFailState("[Win Rate]: Couldn't load 'NMRiH_WinRate.cfg' from ...addons/sourcemod/configs/");
    	}
    	/*
    	hConfig.JumpToKey("Server_List",false);
    	char sServer_Name[128];
    	char sConfig_Name[128];
    	GetConVarString(FindConVar("hostname"), sServer_Name, sizeof(sServer_Name));
    	if (!hConfig.JumpToKey(sServer_Name,false)) 
    	{		// サーバー名を探して下の階層へ移動
    		PrintToServer("[Win Rate]: This server name is '%s'",sServer_Name);
    		if(!hConfig.GotoFirstSubKey(false)) 
    		{
    			PrintToServer("[Win Rate]: Nothing KeyValue.");
    		}
    		else
    		{
    			hConfig.GetSectionName(sConfig_Name, sizeof(sConfig_Name));
    			PrintToServer("[Win Rate]: Section of KeyValues -- '%s'",sConfig_Name);
    			while (hConfig.GotoNextKey(false)) {
    				hConfig.GetSectionName(sConfig_Name, sizeof(sConfig_Name));
    				PrintToServer("[Win Rate]: Section of KeyValues -- '%s'",sConfig_Name);
    			}
    			hConfig.GoBack();		
    		}
    		SetFailState("[Win Rate]: Couldn't find this server name in 'NMRiH_WinRate.cfg'. Please edit it.");
    	}
    	*/
    	/*
    	hConfig.GetString("Database_keyvalues",sDB_KeyValues,sizeof(sDB_KeyValues),"not found");		// 文字列を取得
    	if (StrEqual(sDB_KeyValues, "not found")) {
    		SetFailState("[Win Rate]: Couldn't read 'Database_keyvalues' in 'NMRiH_WinRate.cfg'. Please edit it.");
    	}
    	*/
    	sDB_KeyValues = "nmrih_winrate";
    	/*
    	hConfig.GetString("Rate_table",sTable,sizeof(sTable),"not found");
    	if (StrEqual(sTable, "not found")) {
    		SetFailState("[Win Rate]: Couldn't read 'Rate_table' in 'NMRiH_WinRate.cfg'. Please edit it.");
    	}
    	*/
    	sTable = "player_map_rate";
    
    	hConfig.GoBack();
    	hConfig.GoBack();		// ツリーのトップに戻す
    }
    Recompile and this way you will force the plugin to work using "nmrih_winrate" keyvalue of database.cfg

    Enjoy!

    Last edited by Lunreth; 04-02-2020 at 20:44. Reason: Plugin hotfix for common issue
    Lunreth is offline
    zeThijs
    New Member
    Join Date: Jul 2022
    Location: The Netherlands
    Old 11-14-2023 , 10:45   Re: [NMRiH] WinRate (v1.0.6 03/31/2018 )
    Reply With Quote #5

    Here's a fix for the above that doesnt just comment out functionality, instead late loads. Also adds support for 9 players
    Attached Files
    File Type: sp Get Plugin or Get Source (NMRiH_WinRate.sp - 39 views - 44.8 KB)

    Last edited by zeThijs; 11-14-2023 at 10:49. Reason: edit attachment
    zeThijs is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 22:43.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode