PDA

View Full Version : CS:S Litle Rank System


graczu
08-26-2007, 16:24
Simple Counter Strike Source Player's Ranking
(How it Work's: TOP10 and RANK is DEATHS/KILLS/PLAY_TIME ASC)

Features:

- /rank
- /top10
- /headhunters

/rank :: Simple showing player Rank, and stats Kills, Deaths, Headshot's, Sucside's
/top10 :: Showing Player's TOP with LIMIT 10 based ON Kills/Deaths DESC
/headhunters :: Showing TOP Player's Headshoter's and Played Time

There is an option that you can set stats delete of nonactive Player's (If stats older than X days, they are deleted)

How To:

Add to your: database.cfg (addons/sourcemod/configs)

"cssrank"
{
"driver" "default"
"host" "127.0.0.1"
"database" "database_name"
"user" "database_user"
"pass" "PASSWORD"
//"timeout" "0"
"port" "3306"
}

In your database you need run a query:

CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(32) NOT NULL default '',
`nick` varchar(128) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
`last_active` int(12) NOT NULL default '0',
`played_time` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Changelog:
Updates (last: 12.03.2009 (DD.MM.YYYY))
* SQL Fixes
* Query Fixes
* Display Changes
Updates (last: 1228581207):
* New: OLD STATS deleting
* Update TABLE on UTF8 and Setting NAMES to UTF8 on DatabaseConnect
* Changes in Database Connect
* New: Added "/headhunters"
* New: played_time, we will creat most active players TOP
* New: last_active ON this we will base is this player stats not to old.. (we dont want have BIG MySQL DataBase)
in future, maybe i will creat archive table, that there we will be have those player's, and they will be come back from archive when they will connect.
* Anti Flood Protection (new userFlood[64];)
* New announce message on: onClientPutInServer(client)
* WWW sie Cvar ("sm_lrcss_www",)
* PHP site nick protection:
[ ReplaceString(name, sizeof(name), "'", "");
ReplaceString(name, sizeof(name), "<", "");
ReplaceString(name, sizeof(name), "\"", "");
]
* Changed SQL_Query on SQL_TQuery Functions, Helper: - dalto
* Added Debug Mode for MySQL Queries: new DEBUG = 0;
* Added: new String:steamIdSave[64][255]; for Player Disconnect useage in: SQL_TQuery
* Added: if(hndl == INVALID_HANDLE) function check in all: SQL_TQuery


Thanks for people that help me:
- dalto (http://forums.alliedmods.net/member.php?u=29575) (SQL BUG)

Fredd
08-26-2007, 18:50
Very Cool ;]

Rebell
08-27-2007, 00:45
Please add a SQLite version !

cya

RaideR
10-07-2007, 21:35
I did everything like said.
1. Copied css_rank_en.smx to \cstrike\addons\sourcemod\plugins\
2. Added the following to \cstrike\addons\sourcemod\configs\databases.c fg
CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(255) NOT NULL default '',
`nick` varchar(255) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`));

But it doesn't works, console says:
[SM] Native SQL Query reported: Invalid database handled 0 Error 4
[SM] Debug mode is not enabled for

Then I switched on the debug mode and it said:
[SM] Could not toggle debug mode on plugin css_rank_en.smx
[SM] Plugin returned error: Plugin is not runnable

HELP Please!!!

graczu
11-09-2007, 09:12
I did everything like said.
1. Copied css_rank_en.smx to \cstrike\addons\sourcemod\plugins\
2. Added the following to \cstrike\addons\sourcemod\configs\databases.c fg
CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(255) NOT NULL default '',
`nick` varchar(255) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`));

But it doesn't works, console says:
[SM] Native SQL Query reported: Invalid database handled 0 Error 4
[SM] Debug mode is not enabled for

Then I switched on the debug mode and it said:
[SM] Could not toggle debug mode on plugin css_rank_en.smx
[SM] Plugin returned error: Plugin is not runnable

HELP Please!!!

^^

You need have a MySQL Database
Configure your MySQL base in your "configs/databases.cfg" (Addres, login, password, databasename)

"default"
{
"driver" "mysql"
"host" "localhost"
"database" "sourcemod"
"user" "myaccount"
"pass" "mypassword"
}


example like sql admins:
http://wiki.alliedmods.net/SQL_Admins_%28SourceMod%29

Execute the sql code:

CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(255) NOT NULL default '',
`nick` varchar(255) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`));


In your database, and then you will be able to use this plugin.
(From phpmyadmin or shell)

Good luck Gordon :)

http://en.wikipedia.org/wiki/MySQL

RaideR
11-25-2007, 06:30
Ok, did like you said, but now when type top10 there only one person who is the 1st. The same is on the site. What I did wrong?

sphinx
11-25-2007, 23:00
can we have a top10 list with yellow player's name and without rank number before K/D? see attachment.

RaideR
11-26-2007, 18:35
Please someone help me with the problem in my post 6

sphinx
11-26-2007, 23:58
Please someone help me with the problem in my post 6

did you modified the plugin? give it a try to the version attached to my #7 post.

RaideR
11-27-2007, 02:03
did you modified the plugin? give it a try to the version attached to my #8 post.

No nothing was modified. OK, I will try today

zhelev81
12-02-2007, 19:19
well everything is workin' but the top 10 :((

MoggieX
12-16-2007, 09:56
Works well, but needs some work on the old English ;-)

Matt

MoggieX
12-17-2007, 07:59
There appears to be an issue with it not printing the ranks to the ingame chat, hence my errors log is filled with these:


L 12/17/2007 - 12:47:57: [SM] Native "PrintToChat" reported: Client 26 is not in game
L 12/17/2007 - 12:47:57: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:47:57: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:49:53: [SM] Native "PrintToChat" reported: Client 2 is not in game
L 12/17/2007 - 12:49:53: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:49:53: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:50:20: [SM] Native "PrintToChat" reported: Client 15 is not in game
L 12/17/2007 - 12:50:20: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:50:20: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:50:44: [SM] Native "PrintToChat" reported: Client 18 is not in game
L 12/17/2007 - 12:50:44: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:50:44: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:51:52: [SM] Native "PrintToChat" reported: Client 2 is not in game
L 12/17/2007 - 12:51:52: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:51:52: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:52:26: [SM] Native "PrintToChat" reported: Client 26 is not in game
L 12/17/2007 - 12:52:26: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:52:26: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:53:26: [SM] Native "PrintToChat" reported: Client 28 is not in game
L 12/17/2007 - 12:53:26: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:53:26: [SM] [0] Line 137, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()
L 12/17/2007 - 12:56:35: [SM] Native "PrintToChat" reported: Client 5 is not in game
L 12/17/2007 - 12:56:35: [SM] Displaying call stack trace for plugin "css_rank_en.smx":
L 12/17/2007 - 12:56:35: [SM] [0] Line 140, /home/groups/alliedmodders/forums/files/1/0/2/1/7/19579.attach::publicMSGrank()


Matt

iha81
01-13-2008, 07:01
I'm getting this error when I try to access my ranks page:

Warning: mysql_connect() [function.mysql-connect (http://www.gulfgamers.net/ranks/function.mysql-connect)]: Access denied for user 'gulfgame_rank'@'localhost' (using password: YES) in /home/gulfgame/public_html/ranks/cfg_file.php on line 8
Cant connect: Access denied for user 'gulfgame_rank'@'localhost' (using password: YES)

The username and password for the DB are correct since the db is being used and players are being ranked.

Jezternz
05-09-2008, 21:58
wow. that last question.. i dont know why you would get that. Anyway.

I have some rreally strange error.
Basicly, wen people join my server, it add's them to the database and thats all swell, but as soon as on shot is fired and as soon as it hits a person (or bot), whether it kills them or not. The server crashs.
The rank and top10 functions work fine. They display the stats.
but as soon as a shot is fired this happens:
http://img265.**************/img265/1796/errorno0.jpg

Any help would be hugely appreciated. Am I missing a file or something? Is this version of the stats no longer working?

Jezternz
05-09-2008, 22:21
Okay well i just went and remmed/commented out the source code that triggered on player damage.
(//HookEvent("player_hurt", EventPlayerHurt);)
That fixes the problem, however, The same problem occur on death.
Any ideas?

halfsquelch
05-12-2008, 03:00
ok first question is... do I need to have a web site to upload the php files to and if i need those files but dont need the site how do i set them up

and second question is... I have no idea what my databases.cfg file should look like, this is what it is atm please let me know what is wrong

"Databases"
{
"driver_default" "mysql"

"default"
{
"driver" "mysql"
"host" "localhost"
"database" "sourcemod"
"user" "root"
"pass" ""
//"timeout" "0"
//"port" "0"
}

"storage-local"
{
"driver" "sqlite"
"database" "sourcemod-local"
}
}
CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(255) NOT NULL default '',
`nick` varchar(255) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`));

ichbin007
06-16-2008, 14:13
Hello Iam new and I want use this Plugin every thing runs perfekt but i will make the plugin so that the player can view her Rank every Round and not only at the begining.

I thing that is possiblie but I cant make it my own work.

I hope anyone can Help me Thannks in advanced

Sorry for my bad English.

ichbin007

ichbin007
06-17-2008, 10:07
No one who can help me ?

martin.developer
11-16-2008, 07:54
Hello, this plugin is good, but on my server ranks write in DB only if client disconnect.
Anybody help me, what can I do to write ranks on round end ?
Many thanks :)

waiflih
11-21-2008, 16:44
Hello, this plugin is good, but on my server ranks write in DB only if client disconnect.
Anybody help me, what can I do to write ranks on round end ?
Many thanks :)


On Evry player disconnect statistics are saving in Database.
(for me it's good, becouse players dont saying /rank, /rank on evry round they play :P)



read first!!

and, graczu, if you're still active, can you add the option to save the rank by name and not by steamid?

graczu
12-04-2008, 22:25
Offf, i will try on some free time update this plugin. Im now sick so i dont need go to job, so i have some free time, and my server players will be happy if they will have stats on the server.

I will try to add some options like time after that stat of nonactive player is deleting, etc..

graczu
12-06-2008, 11:36
Updated

Edit: ops sorry for post spam :(, dont see that my post was last :(

foohey
12-20-2008, 15:15
hi, I have just modified for display rank at all player
it displays like: <nick> stats: 0 kills | 3 death | ...



public SQLGetMyRank(Handle:owner, Handle:hndl, const String:error[], any:client){
if(hndl == INVALID_HANDLE)
{
LogError(error);
PrintToServer("Last Connect SQL Error: %s", error);
return;
}

decl String:name[64];
decl RAkills;
decl RAdeaths;
decl RAheadshots;
decl RAsucsides;
decl RAnkNum;

if(SQL_FetchRow(hndl))
{
SQL_FetchString(hndl, 0, name, sizeof(name));
RAkills=SQL_FetchInt(hndl,1);
RAdeaths=SQL_FetchInt(hndl,2);
RAheadshots=SQL_FetchInt(hndl,3);
RAsucsides=SQL_FetchInt(hndl,4);
RAnkNum=RAkills/RAdeaths;
decl String:buffer[512];
Format(buffer, sizeof(buffer), "SELECT rank_id FROM css_rank WHERE (kills/deaths) >= '%i'", RAnkNum);
if(DEBUG == 1){
PrintToServer("DEBUG: SQLGetMyRank (%s)", buffer);
}
SQL_TQuery(db, SQLShowRank, buffer, client);
PrintToChatAll("%c%s's stats: Tués: %i | Morts: %i | Headshots: %i | Suicides: %i", GREEN, name, RAkills, RAdeaths, RAheadshots, RAsucsides);
} else {
PrintToChat(client, "%cYour rank is not avlilable!", GREEN);
}
}


but in SQLShowRank, I can not change for display like:
<nick> is ranked 20/160

Im french, sorry for my bad english :)
Thanks in advance.

Faks
02-28-2009, 11:07
work like charm i think we must make it better and i next versions add more functions to be more advanced :mrgreen: but author 8)

graczu
03-12-2009, 07:19
hi, I have just modified for display rank at all player
it displays like: <nick> stats: 0 kills | 3 death | ...



public SQLGetMyRank(Handle:owner, Handle:hndl, const String:error[], any:client){
if(hndl == INVALID_HANDLE)
{
LogError(error);
PrintToServer("Last Connect SQL Error: %s", error);
return;
}

decl String:name[64];
decl RAkills;
decl RAdeaths;
decl RAheadshots;
decl RAsucsides;
decl RAnkNum;

if(SQL_FetchRow(hndl))
{
SQL_FetchString(hndl, 0, name, sizeof(name));
RAkills=SQL_FetchInt(hndl,1);
RAdeaths=SQL_FetchInt(hndl,2);
RAheadshots=SQL_FetchInt(hndl,3);
RAsucsides=SQL_FetchInt(hndl,4);
RAnkNum=RAkills/RAdeaths;
decl String:buffer[512];
Format(buffer, sizeof(buffer), "SELECT rank_id FROM css_rank WHERE (kills/deaths) >= '%i'", RAnkNum);
if(DEBUG == 1){
PrintToServer("DEBUG: SQLGetMyRank (%s)", buffer);
}
SQL_TQuery(db, SQLShowRank, buffer, client);
PrintToChatAll("%c%s's stats: Tués: %i | Morts: %i | Headshots: %i | Suicides: %i", GREEN, name, RAkills, RAdeaths, RAheadshots, RAsucsides);
} else {
PrintToChat(client, "%cYour rank is not avlilable!", GREEN);
}
}


but in SQLShowRank, I can not change for display like:
<nick> is ranked 20/160

Im french, sorry for my bad english :)
Thanks in advance.

If somone have long nick it's display bad.

Update, Some litle Fixes in SQL and SQL Queries, Litle Change in Display TOP 10.

k2k1n9
03-20-2009, 19:35
Hi,

I have some problems because i don't know how the databases.cfg have to look like.

I tried something lik that:


"Databases"
{
"driver_default" "mysql"

"default"
{
"driver" "default"
"host" "localhost"
"database" "sourcemod"
"user" "root"
"pass" ""
//"timeout" "0"
//"port" "0"
}

"storage-local"
{
"driver" "sqlite"
"database" "sourcemod-local"
}
"cssrank"
{
"driver" "default"
"host" "127.0.0.1"
"database" "axerank"
"user" "root"
"pass" "hallo"
//"timeout" "0"
"port" "3306"
}
}
CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(32) NOT NULL default '',
`nick` varchar(128) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
`last_active` int(12) NOT NULL default '0',
`played_time` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Is this the way it works or is something wrong with it.

Other Questions:
*Must the port be forwarded in my firewall?
*When is the information I typed in for the "user" and "password" line needed and how?
*What's the difference between a selfmade username and "root" as username?

Please help me..

k2k1n9

Zuben
05-06-2009, 13:10
Hello , I have problem when I write /rank I see this :


Rank System is now not avilable

Help please , Thank you

MrCapion
05-30-2009, 09:19
Hello , I have problem when I write /rank I see this :


Rank System is now not avilable

Help please , Thank you


yir.. thats all I get too ???

genzo
06-16-2009, 10:04
Good job!

How trample kills bots in statistic? What need doing?

Sorry my English.

zepper
11-25-2009, 21:23
it is possible to show the table on middle of screen when i type /top10 or /headhynters, because now its mixing with other plugin tables.
TNX

D12mon
01-23-2010, 07:04
Please, can someone tell me, where i must add that TABLES?
iam still getting error "Rank is not available".. thanks..

Diablo3
04-04-2010, 18:37
where is php site script ?

paco12
06-30-2010, 02:28
so im new can one of you help me understand how to run a query?

tejeskifly
08-12-2010, 16:33
can you make sqlite compatibilite version?

LolderPunkt
09-07-2010, 11:58
Some BUGs:
If i type /rank there stand:

431 Kills | 40 Deaths | 453 Haedshots
Ranked 0.

If i type /top10 there stand that i rank 1?!?! hwo can i make 22 headshots more than kills? why im rank 0. ??!?!
can you add KDratio?

BUT!!!!! THE PLUGIN WORKS FINE!!! ITS A GOOD PLUGIN THX TO CODER!!
sry 4 my english

SteamKiller
09-22-2010, 15:48
so im new can one of you help me understand how to run a query?

Use PHPMYADMIN interface, it's very easy to use ;)
Ask your host provider if they have it.

SteamKiller
09-22-2010, 15:56
graczu, can You add TOP20, TOP30 etc multipage option?
Players who have not entered the top 10 may all want to know what they're there :wink:

MrCapion
02-27-2011, 09:15
this is outrageous to be allowed to get through *S*
In cs_rank.sp you can find this:

MySQL Query:
CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(32) NOT NULL default '',
`nick` varchar(128) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
`last_active` int(12) NOT NULL default '0',
`played_time` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
database.cfg
"cssrank"
{
"driver" "default"
"host" "127.0.0.1"
"database" "database_name"
"user" "database_user"
"pass" "PASSWORD"
//"timeout" "0"
"port" "3306"
}

and further down:
SQL_TConnect(LoadMySQLBase, "cssrank");
....
after several retrys and serverrestarts I finally found this error-message:
Failed to connect: Could not find database conf "cssrank"


SO!.. What is it?..

whats the databasename? ( free for us to decide or fixed in the css_rank stuff?)
whats the tablename? ( css_rank or cssrank )

leykon121
06-26-2012, 17:17
how to creat Database ?

Bittersweet
08-19-2012, 10:20
Every single plugin that I've downloaded from this that uses MySQL, seems to assume that the user knows MySQL.

I don't either. I had to go through this same thing when I installed Sourcebans. The documentation is an example only, you can't really just copy & paste or type it in exactly as it shows. For example, databasename and tablename are things you decide. I don't see any mention in this thread of how to CREATE a database in this thread. The real bad news is that MySQL will let you type all of that stuff in, and only inform you that it doesn't know what you are talking about until after the last line.

I know how frustrating this can be. I can't really teach anyone, since I really don't know MySQL myself, but here is a link to a pretty easy to understand guide on how to download, install, create and work with databases. The link is for 5.5 because that is what I'm using, but there are more links on the left that have other versions.

http://dev.mysql.com/doc/refman/5.5/en/preface.html

Good luck with it.

blaser11981
08-25-2012, 21:05
I have Modified this plugin a bit to work well with CS:GO. Things I have done.

MySQL
///////////////////////
Added assists to css_rank Table.


//////////////////////////
css_rank.smx
Added Assists to Rank display
Added Assists to Top10 display
Modified Rank Calculation to include Assists as part of the equation.
Modified Rank to start at 1 instead of 0.
Modified Rank Query To add ifNull() Clause.
Modified Commands:
/rank -> rank
/top10 -> top10
/headhunter -> headhunter


CREATE TABLE IF NOT EXISTS `css_rank` (
`rank_id` int(64) NOT NULL AUTO_INCREMENT,
`steamId` varchar(32) NOT NULL DEFAULT '',
`nick` varchar(128) NOT NULL DEFAULT '',
`kills` int(12) NOT NULL DEFAULT '0',
`deaths` int(12) NOT NULL DEFAULT '0',
`assists` int(12) NOT NULL DEFAULT '0',
`headshots` int(12) NOT NULL DEFAULT '0',
`sucsides` int(12) NOT NULL DEFAULT '0',
`last_active` int(12) NOT NULL DEFAULT '0',
`played_time` int(12) NOT NULL DEFAULT '0',
PRIMARY KEY (`rank_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

Der Moppel
10-11-2012, 15:01
Great Rank... easy and simple, just started to use it on our Server, could you (or someone else) just add one small Thing.

It Shows your Rank, but not from how many Players :

For Example : Rank 1 of 12203 Players, that would be nice to have!

Calibras
10-18-2012, 11:15
Update the plugin, to use ip adress and steam id, it will be great for web stats modding.

Lepraaah
07-22-2013, 12:25
Frags: 0 | Deaths: 58 | Headshots: 0 | Sucsides: 4

"Sucsides" , should that be Suicides?:D

Lepraaah
07-22-2013, 15:26
Hello , I have problem when I write /rank I see this :


Rank System is now not avilable

Help please , Thank you

That simply means its not linked to the database correctly

In the databases.cfg, you only add the following lines, with the values of your database :

"cssrank"
{
"driver" "default"
"host" "127.0.0.1"
"database" "database_name"
"user" "database_user"
"pass" "PASSWORD"
//"timeout" "0"
"port" "3306"
}


Once you have done that you enter the database itself, and you execute the following query to it :
( If you enter the database through phpmyadmin, simply click on the "SQL" tab , enter the following code, and click on 'done' or something

CREATE TABLE `css_rank`(
`rank_id` int(64) NOT NULL auto_increment,
`steamId` varchar(32) NOT NULL default '',
`nick` varchar(128) NOT NULL default '',
`kills` int(12) NOT NULL default '0',
`deaths` int(12) NOT NULL default '0',
`headshots` int(12) NOT NULL default '0',
`sucsides` int(12) NOT NULL default '0',
`last_active` int(12) NOT NULL default '0',
`played_time` int(12) NOT NULL default '0',
PRIMARY KEY (`rank_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Happymess
08-25-2014, 10:47
How do it FFA?

chycken
10-20-2014, 14:38
My CS:GO Server errors with this plugin:
L 10/20/2014 - 18:24:57: SourceMod error session started
L 10/20/2014 - 18:24:57: Info (map "de_nuke") (file "errors_20141020.log")
L 10/20/2014 - 18:24:57: [SM] Native "GetClientName" reported: Client 30 is not connected
L 10/20/2014 - 18:24:57: [SM] Displaying call stack trace for plugin "rankplugin.smx":
L 10/20/2014 - 18:24:57: [SM] [0] Line 353, /home/groups/sourcemod/upload_tmp/phppL9RnY.sp::SQLUserLoad()
L 10/20/2014 - 18:50:48: Error log file session closed

Please update bug

chycken
10-20-2014, 14:40
I have Modified this plugin a bit to work well with CS:GO. Things I have done.

MySQL
///////////////////////
Added assists to css_rank Table.


//////////////////////////
css_rank.smx
Added Assists to Rank display
Added Assists to Top10 display
Modified Rank Calculation to include Assists as part of the equation.
Modified Rank to start at 1 instead of 0.
Modified Rank Query To add ifNull() Clause.
Modified Commands:
/rank -> rank
/top10 -> top10
/headhunter -> headhunter


CREATE TABLE IF NOT EXISTS `css_rank` (
`rank_id` int(64) NOT NULL AUTO_INCREMENT,
`steamId` varchar(32) NOT NULL DEFAULT '',
`nick` varchar(128) NOT NULL DEFAULT '',
`kills` int(12) NOT NULL DEFAULT '0',
`deaths` int(12) NOT NULL DEFAULT '0',
`assists` int(12) NOT NULL DEFAULT '0',
`headshots` int(12) NOT NULL DEFAULT '0',
`sucsides` int(12) NOT NULL DEFAULT '0',
`last_active` int(12) NOT NULL DEFAULT '0',
`played_time` int(12) NOT NULL DEFAULT '0',
PRIMARY KEY (`rank_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

My CSGO server bugs with this plugin.PLEASE UPDATE..

L 10/20/2014 - 18:24:57: SourceMod error session started
L 10/20/2014 - 18:24:57: Info (map "de_nuke") (file "errors_20141020.log")
L 10/20/2014 - 18:24:57: [SM] Native "GetClientName" reported: Client 30 is not connected
L 10/20/2014 - 18:24:57: [SM] Displaying call stack trace for plugin "rankplugin.smx":
L 10/20/2014 - 18:24:57: [SM] [0] Line 353, /home/groups/sourcemod/upload_tmp/phppL9RnY.sp::SQLUserLoad()
L 10/20/2014 - 18:50:48: Error log file session closed

qiuhaian
04-09-2015, 23:44
My CSGO server bugs with this plugin.PLEASE UPDATE..

L 10/20/2014 - 18:24:57: SourceMod error session started
L 10/20/2014 - 18:24:57: Info (map "de_nuke") (file "errors_20141020.log")
L 10/20/2014 - 18:24:57: [SM] Native "GetClientName" reported: Client 30 is not connected
L 10/20/2014 - 18:24:57: [SM] Displaying call stack trace for plugin "rankplugin.smx":
L 10/20/2014 - 18:24:57: [SM] [0] Line 353, /home/groups/sourcemod/upload_tmp/phppL9RnY.sp::SQLUserLoad()
L 10/20/2014 - 18:50:48: Error log file session closed


public SQLUserLoad(Handle:owner, Handle:hndl, const String:error[], any:client){
if (!IsClientInGame(client)) return;

if(SQL_FetchRow(hndl))
{
decl String:name[MAX_LINE_WIDTH];
GetClientName( client, name, sizeof(name) );

ReplaceString(name, sizeof(name), "'", "");
ReplaceString(name, sizeof(name), "<", "");
ReplaceString(name, sizeof(name), "\"", "");

decl String:buffer[512];
Format(buffer, sizeof(buffer), "UPDATE 1f SET nick = '%s', last_active = '%i' WHERE steamId = '%s'", name, GetTime(), steamIdSave[client])
if(DEBUG == 1){
PrintToServer("DEBUG: SQLUserLoad (%s)", buffer);
}
SQL_TQuery(db, SQLErrorCheckCallback, buffer);

userInit[client] = 1;
} else {

decl String:name[MAX_LINE_WIDTH];
decl String:buffer[200];

GetClientName( client, name, sizeof(name) );

ReplaceString(name, sizeof(name), "'", "");
ReplaceString(name, sizeof(name), "<", "");
ReplaceString(name, sizeof(name), "\"", "");

Format(buffer, sizeof(buffer), "INSERT INTO 1f (steamId, nick, last_active) VALUES('%s','%s', '%i')", steamIdSave[client], name, GetTime())
if(DEBUG == 1){
PrintToServer("DEBUG: SQLUserLoad (%s)", buffer);
}
SQL_TQuery(db, SQLErrorCheckCallback, buffer);

userInit[client] = 1;
}
}

qiuhaian
04-10-2015, 02:17
My CS:GO Server errors with this plugin:
L 10/20/2014 - 18:24:57: SourceMod error session started
L 10/20/2014 - 18:24:57: Info (map "de_nuke") (file "errors_20141020.log")
L 10/20/2014 - 18:24:57: [SM] Native "GetClientName" reported: Client 30 is not connected
L 10/20/2014 - 18:24:57: [SM] Displaying call stack trace for plugin "rankplugin.smx":
L 10/20/2014 - 18:24:57: [SM] [0] Line 353, /home/groups/sourcemod/upload_tmp/phppL9RnY.sp::SQLUserLoad()
L 10/20/2014 - 18:50:48: Error log file session closed

Please update bug

use this version:
144009

GamingUnited
05-13-2015, 17:11
Hi, is the plugin working in cs:s?

bethunej
09-06-2015, 07:17
use this version:
144009

hi,, may i have your csgocolors.inc
thx

能给我你的csgocolors.inc吗
我的颜色显示的不全

TommyTheHeist
12-20-2019, 17:27
in the game it says for me that "Rank system is now not available"