AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] Simple CSGO Ranks (https://forums.alliedmods.net/showthread.php?t=264191)

Puppetmaster 06-11-2015 06:39

[CS:GO] Simple CSGO Ranks
 
13 Attachment(s)
SimpleCSGORanks is being coded as an alternative to paid mods such as gameme.
The aim of the SimpleCSGORanks project is to create a simple plugin to track players skill in a simple way.

GitHub: https://github.com/ArclightHub/Simple-CSGO-Ranks
Website Basic Demo: https://gamingzoneservers.com/demo.php
Website Full Demo: https://gamingzoneservers.com/

Coming soon:
Server Status:
https://gamingzoneservers.com/playerApp.php

Demo Servers

By Default:

Everytime a player gets a kill their rank increases by 5.
When a player is killed their rank decreases by 6.
When a player assists a kill their rank increases by 2.
When a player is much lower rank than the player they killed the numbers are 10 and 11.
When a player defuses the bomb their rank increases by 5.

A player is considered recent if they have either killed a player or have themselves been killed by another player.
Their recent activity variable is updated at the end of the round and time-stamped. Team kills are not tracked.
A player can check their rank by saying !rank
A player can check the top 10/25 players by saying !top, !top10 or !top25

Setup:

Copy all the zipped files into your sourcemod server directory.
The plugin download link contains all of the sourcemod plugin files.
The plugin works with MySQL, as such you will need to have one set up.
The zip file contains a copy of databases.cfg that works with this mod.
You will also NEED to set up the databases by either importing the one from github or setting it up as per the readme on the github readme page.

It is also recommended that you increase the buffer pool if you have over 20000 players.
innodb_buffer_pool_size=384M

There are five basic console variables:
  • sm_simplecsgoranks_mode
    • Sets the mode. (0) is rounds mode. (1) is immediate mode. Immediate mode is useful for deathmatch type games.
  • sm_simplecsgoranks_ffa
    • Enables free for all mode.
  • sm_simplecsgoranks_kill_points
    • The number of points gained per kill
  • sm_simplecsgoranks_higher_rank_additional
    • Additional points gained when killing a higher ranked player.
  • sm_simplecsgoranks_higher_rank_gap
    • Difference between players ranks needed to consider one to be a higher ranked player.
Additionally there are five advanced console variables:
  • sm_simplecsgoranks_database
    • Allows changing of the database used from databases.cfg
  • sm_simplecsgoranks_cleaning
    • (0)Nothing. (1) Cleans the database. (2) Clears players who have no kills for more than two months.
  • sm_simplecsgoranks_useSlowCache
    • Limit the rate at which the cache updates its data.
  • sm_simplecsgoranks_useMaxThreads
    • Allows more threads than usual. Might be useful for servers with a large number of players.
  • sm_simplecsgoranks_debug
    • Enable or disable advanced error messages. (0 or 1)

The "Get Plugin" version does NOT have colored text, only the one in the zip file does.
The "Get Plugin" version is version 0.2.3.
For complete gathering of statistics for your website you will want to use the WebsitePlugins in addition to the base plugin.

Linux users may need this package: apt-get install lib32z1

my11 06-12-2015 16:59

Re: [CS:GO] Simple CSGO Ranks
 
how can i see my rank in game?

Puppetmaster 06-12-2015 21:27

Re: [CS:GO] Simple CSGO Ranks
 
Currently ranks are only printed out in game if you use the !rank command or at the end of a round in which you get a kill or are yourself killed. This was added in version 0.1.5
Alternatively a file like this one can be used for your motd: http://gamingzone.ddns.net/ranksIngame.php

Puppetmaster 06-14-2015 19:49

Re: [CS:GO] Simple CSGO Ranks
 
I am going to start accepting minor feature requests. At some point a "Complex CSGO Ranks" plugin may also be made.

I would also love to get feedback from others.
If you find a bug please document it in a repeatable way with details that will allow us to replicate it.

OnlyRipper 06-22-2015 05:13

Re: [CS:GO] Simple CSGO Ranks
 
I have a problem.I've installed this plugin on a test test.After i've finished all my work on test i've opened it on dedicated.
The problem is that it doesn't reset top,it doesn't count anymore kills/deaths etc....it just tell me the stats recorded on test server...that's all what should i do since i already reinstalled plugin and no diference.

Puppetmaster 06-22-2015 18:34

Re: [CS:GO] Simple CSGO Ranks
 
Quote:

Originally Posted by OnlyRipper (Post 2310539)
I have a problem.I've installed this plugin on a test test.After i've finished all my work on test i've opened it on dedicated.
The problem is that it doesn't reset top,it doesn't count anymore kills/deaths etc....it just tell me the stats recorded on test server...that's all what should i do since i already reinstalled plugin and no diference.

Depending on where the databases.cfg is set to point it will display the same stats. You need to change the 'default' mysql server to the one that you use on dedicated.
You also need to make sure that the username you have set has the correct access granted @ localhost, 127.0.0.1 or whatever ip you are using.

OnlyRipper 06-23-2015 01:42

Re: [CS:GO] Simple CSGO Ranks
 
Ok.I'll try.Thanks for response

Puppetmaster 07-22-2015 06:25

Re: [CS:GO] Simple CSGO Ranks
 
For those on linux if you are having issues on linux try this command:
sm plugins reload simplecsgoranks

If you see this:

Adding database tables
L 07/22/2015 - 09:59:03: [SM] Native "SQL_FastQuery" reported: Invalid database Handle 0 (error: 4)
L 07/22/2015 - 09:59:03: [SM] Displaying call stack trace for plugin "simplecsgoranks.smx":
L 07/22/2015 - 09:59:03: [SM] [0] Line 314, simplecsgoranks.sp::newDB()
L 07/22/2015 - 09:59:03: [SM] [1] Line 455, simplecsgoranks.sp::OnPluginStart()
[SM] Plugin simplecsgoranks.smx reloaded successfully.

You need probably need to run this in the command line: "apt-get install lib32z1"

Puppetmaster 08-08-2015 00:44

Re: [CS:GO] Simple CSGO Ranks
 
The following php task can be used to merge multiple rank databases. This example code comes from 4 of my 8 test servers which run Dust2. It requires a new database steamGlobal of the same structure as a temporary MySQL storage buffer. For an initial migration you will probably want to use $mode = 1; so that players ranks are not overwritten by low ranks from a more recent match.
It can then be run as either a cronjob or watch to execute periodically to sync all your servers if you want this function.

PHP Code:

<?php
$servername 
"localhost";
$username "root";
$password ""
$dbname "steamGlobal";

// Create connection
$conn = new mysqli($servername$username$password$dbname);
// Check connection
if ($conn->connect_error) {
    die(
"Connection failed: " $conn->connect_error);
}
else
{

//copy ranks
$sql "INSERT IGNORE INTO steamGlobal.steam
SELECT * FROM steam.steam"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steamGlobal.steam
SELECT * FROM steam2.steam"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steamGlobal.steam
SELECT * FROM steam5.steam"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steamGlobal.steam
SELECT * FROM steam6.steam"
;
$result $conn->query($sql);

//copy names
$sql "INSERT IGNORE INTO steamGlobal.steamname
SELECT * FROM steam.steamname"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steamGlobal.steamname
SELECT * FROM steam2.steamname"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steamGlobal.steamname
SELECT * FROM steam5.steamname"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steamGlobal.steamname
SELECT * FROM steam6.steamname"
;
$result $conn->query($sql);

//update steamglobal with the latest
$mode 0//0 is copy by age, 1 is copy by highest rank
if($mode == 0){
    
$sql "UPDATE steamGlobal.steam, steam.steam
    SET steamGlobal.steam.rank = steam.steam.rank, steamGlobal.steam.age = steam.steam.age
    WHERE steamGlobal.steam.steamId = steam.steam.steamId AND CAST(steam.steam.age as DECIMAL) > CAST(steamGlobal.steam.age as DECIMAL)"
;
    
$result $conn->query($sql);
    
    
$sql "UPDATE steamGlobal.steam, steam2.steam
    SET steamGlobal.steam.rank = steam2.steam.rank, steamGlobal.steam.age = steam2.steam.age
    WHERE steamGlobal.steam.steamId = steam2.steam.steamId AND CAST(steam2.steam.age as DECIMAL) > CAST(steamGlobal.steam.age as DECIMAL)"
;
    
$result $conn->query($sql);
    
    
$sql "UPDATE steamGlobal.steam, steam5.steam
    SET steamGlobal.steam.rank = steam5.steam.rank, steamGlobal.steam.age = steam5.steam.age
    WHERE steamGlobal.steam.steamId = steam5.steam.steamId AND CAST(steam5.steam.age as DECIMAL) > CAST(steamGlobal.steam.age as DECIMAL)"
;
    
$result $conn->query($sql);
    
    
$sql "UPDATE steamGlobal.steam, steam6.steam
    SET steamGlobal.steam.rank = steam6.steam.rank, steamGlobal.steam.age = steam6.steam.age
    WHERE steamGlobal.steam.steamId = steam6.steam.steamId AND CAST(steam6.steam.age as DECIMAL) > CAST(steamGlobal.steam.age as DECIMAL)"
;
    
$result $conn->query($sql);
}
else{
    
$sql "UPDATE steamGlobal.steam, steam.steam
    SET steamGlobal.steam.rank = steam.steam.rank, steamGlobal.steam.age = steam.steam.age
    WHERE steamGlobal.steam.steamId = steam.steam.steamId AND CAST(steam.steam.rank as DECIMAL) > CAST(steamGlobal.steam.rank as DECIMAL)"
;
    
$result $conn->query($sql);
    
    
$sql "UPDATE steamGlobal.steam, steam2.steam
    SET steamGlobal.steam.rank = steam2.steam.rank, steamGlobal.steam.age = steam2.steam.age
    WHERE steamGlobal.steam.steamId = steam2.steam.steamId AND CAST(steam2.steam.rank as DECIMAL) > CAST(steamGlobal.steam.rank as DECIMAL)"
;
    
$result $conn->query($sql);

    
$sql "UPDATE steamGlobal.steam, steam5.steam
    SET steamGlobal.steam.rank = steam5.steam.rank, steamGlobal.steam.age = steam5.steam.age
    WHERE steamGlobal.steam.steamId = steam5.steam.steamId AND CAST(steam5.steam.rank as DECIMAL) > CAST(steamGlobal.steam.rank as DECIMAL)"
;
    
$result $conn->query($sql);

    
$sql "UPDATE steamGlobal.steam, steam6.steam
    SET steamGlobal.steam.rank = steam6.steam.rank, steamGlobal.steam.age = steam6.steam.age
    WHERE steamGlobal.steam.steamId = steam6.steam.steamId AND CAST(steam6.steam.rank as DECIMAL) > CAST(steamGlobal.steam.rank as DECIMAL)"
;
    
$result $conn->query($sql);
}


//insert ranks from global
$sql "INSERT IGNORE INTO steam.steam
SELECT * FROM steamGlobal.steam"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steam2.steam
SELECT * FROM steamGlobal.steam"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steam5.steam
SELECT * FROM steamGlobal.steam"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steam6.steam
SELECT * FROM steamGlobal.steam"
;
$result $conn->query($sql);


//insert names from global
$sql "INSERT IGNORE INTO steam.steamname
SELECT * FROM steamGlobal.steamname"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steam2.steamname
SELECT * FROM steamGlobal.steamname"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steam5.steamname
SELECT * FROM steamGlobal.steamname"
;
$result $conn->query($sql);

$sql "INSERT IGNORE INTO steam6.steamname
SELECT * FROM steamGlobal.steamname"
;
$result $conn->query($sql);

//copy from global

$sql "UPDATE steamGlobal.steam, steam.steam
SET steam.steam.rank = steamGlobal.steam.rank, steam.steam.age = steamGlobal.steam.age
WHERE steamGlobal.steam.steamId = steam.steam.steamId"
;
$result $conn->query($sql);

$sql "UPDATE steamGlobal.steam, steam2.steam
SET steam2.steam.rank = steamGlobal.steam.rank, steam2.steam.age = steamGlobal.steam.age
WHERE steamGlobal.steam.steamId = steam2.steam.steamId"
;
$result $conn->query($sql);

$sql "UPDATE steamGlobal.steam, steam5.steam
SET steam5.steam.rank = steamGlobal.steam.rank, steam5.steam.age = steamGlobal.steam.age
WHERE steamGlobal.steam.steamId = steam5.steam.steamId"
;
$result $conn->query($sql);

$sql "UPDATE steamGlobal.steam, steam6.steam
SET steam6.steam.rank = steamGlobal.steam.rank, steam6.steam.age = steamGlobal.steam.age
WHERE steamGlobal.steam.steamId = steam6.steam.steamId"
;
$result $conn->query($sql);

//copy names from global

$sql "UPDATE steamGlobal.steamname, steam.steamname
SET steam.steamname.name = steamGlobal.steamname.name
WHERE steamGlobal.steamname.steamId = steam.steamname.steamId"
;
$result $conn->query($sql);

$sql "UPDATE steamGlobal.steamname, steam2.steamname
SET steam2.steamname.name = steamGlobal.steamname.name
WHERE steamGlobal.steamname.steamId = steam2.steamname.steamId"
;
$result $conn->query($sql);

$sql "UPDATE steamGlobal.steamname, steam5.steamname
SET steam5.steamname.name = steamGlobal.steamname.name
WHERE steamGlobal.steamname.steamId = steam5.steamname.steamId"
;
$result $conn->query($sql);


$sql "UPDATE steamGlobal.steamname, steam6.steamname
SET steam6.steamname.name = steamGlobal.steamname.name
WHERE steamGlobal.steamname.steamId = steam6.steamname.steamId"
;
$result $conn->query($sql);


$conn->close();
}
?>


JawsABK 08-12-2015 13:27

Re: [CS:GO] Simple CSGO Ranks
 
Quote:

Originally Posted by Puppetmaster (Post 2323050)
For those on linux if you are having issues on linux try this command:
sm plugins reload simplecsgoranks

If you see this:

Adding database tables
L 07/22/2015 - 09:59:03: [SM] Native "SQL_FastQuery" reported: Invalid database Handle 0 (error: 4)
L 07/22/2015 - 09:59:03: [SM] Displaying call stack trace for plugin "simplecsgoranks.smx":
L 07/22/2015 - 09:59:03: [SM] [0] Line 314, simplecsgoranks.sp::newDB()
L 07/22/2015 - 09:59:03: [SM] [1] Line 455, simplecsgoranks.sp::OnPluginStart()
[SM] Plugin simplecsgoranks.smx reloaded successfully.

You need probably need to run this in the command line: "apt-get install lib32z1"

And if im a windows user? :shock:


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

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