Raised This Month: $12 Target: $400
 3% 

Psychostats 3 in-game stats (threaded SQLx)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Hawk552 (427)
GeroiN
New Member
Join Date: Oct 2007
Location: Kaliningrad
Old 10-06-2007 , 18:56   Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #1

Hello all+)

The main idea of this plugin is to display in-game statistical data from Psychostats ver.3 using SQLx (threaded).
There are at least four plugins at alliedmods which work with PS(1.x,2.x,3.x) in someway. None of them have worked for me as needed.
So.. here comes the new plugin...

Requirements
AMX Mod X 1.76d is highly recommended.
Psychostats v. 3.0.6b

Setup
Edit configuration and add this to your sql.cfg
Code:
amx_sql_pshost "127.0.0.1" // the sqldb ip
amx_sql_psuser "psychostats" // psycho sql user
amx_sql_pspass "hidden" // db password
amx_sql_psdb "ps3" // Psycho DB name
amx_sql_psprefix "ps_" // used tableprefix in psychostats db
Usage
Only /rank and /top15 commands are implemented.

If you use STATSX plugin you must comment out these lines in statsx.sma:
Code:
register_clcmd("say /rank", "cmdRank", 0, "- display your rank (chat)")
register_clcmd("say /top15", "cmdTop15", 0, "- display top 15 players (M
OTD)")
register_clcmd("say_team /rank", "cmdRank", 0, "- display your rank (cha
t)")
register_clcmd("say_team /top15", "cmdTop15", 0, "- display top 15 playe
rs (MOTD)")
Then recompile it.
I have no idea (help me?) of how to avoid this except changing commands to /psrank and /pstop15 or something else.

Plugin automatically detects Psychostats setting "uniqueid". i.e how your players are identified in the log files.

I've used some code and general ideas from these plugins:
Psychostats/HLStats Rank by Fyre
Psychostats Interface Plugin by Jason Morriss and JTP10181
SQLx Test Plugin by dvander
Thank you guys!

P.S This is my first AMXMODX plugin.
Attached Files
File Type: sma Get Plugin or Get Source (ps3stats.sma - 5016 views - 8.3 KB)
File Type: zip ps3stats.zip (15.2 KB, 3771 views)
File Type: txt ps3stats.txt (269 Bytes, 2690 views)
GeroiN is offline
Old 10-06-2007, 21:45
hoboman
This message has been deleted by hoboman.
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 10-06-2007 , 22:17   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #2

You should perhaps inform users that if they place this plugin above statsx.amxx in plugins.ini, they won't have to edit any existing plugins. This approach prevents the user from having to alter stock plugins after one or more updates.
Lee is offline
hoboman
Senior Member
Join Date: Jul 2007
Old 10-06-2007 , 23:08   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #3

it would be cool to have some sort of /search or /topclan functions like in the other plug in....except using the mysql db not the inet+motd
__________________
hoboman is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 10-07-2007 , 04:32   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #4

Any screenshots?

That would be cool.
I'm currently using this plugin
http://forums.alliedmods.net/showthread.php?t=51156

But if this plugin is what I think it is, showing print messages instead of freaking MOTD HTML then it so should be approved because that reminds me of PyschoViewer for Source.

EDIT

That what it is exactly! Very good job man. I'm sure if you could work in a search feature and other things listed in the plugin I posted but this for now is exactly what is needed!
__________________


Last edited by BigBaller; 10-07-2007 at 04:40.
BigBaller is offline
GeroiN
New Member
Join Date: Oct 2007
Location: Kaliningrad
Old 10-07-2007 , 05:46   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #5

Quote:
Originally Posted by Lee View Post
You should perhaps inform users that if they place this plugin above statsx.amxx in plugins.ini, they won't have to edit any existing plugins. This approach prevents the user from having to alter stock plugins after one or more updates.
I've tried to make the plugin mostly identical to statsx behavior.
So then player "say /rank", the game show chat message to others and then client_print his rank to the player.
If statsx plugin is enabled too, the player will get two different rank messages (from psychostats & from csstats). If "say /rank" command was disabled in your statsx plugin, the player will get rank message from PS and "Server has disabled that option" message from statsx.
I see the only proper way to do this without recompiling statsx. Command functions must
Code:
return PLUGIN_HANDLED
except
Code:
return PLUGIN_CONTINUE
But then "say /rank" will not appear as a chat message visible for other players. If there is the way to make "say" message visible...

Quote:
Originally Posted by hoboman View Post
it would be cool to have some sort of /search or /topclan functions like in the other plug in....except using the mysql db not the inet+motd
Quote:
Originally Posted by BigBaller View Post
That what it is exactly! Very good job man. I'm sure if you could work in a search feature and other things listed in the plugin I posted but this for now is exactly what is needed!
I'll try to implement that and may be some other commands too in time.
GeroiN is offline
hoboman
Senior Member
Join Date: Jul 2007
Old 10-07-2007 , 13:42   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #6

this needs to be unapproved cause it doesn't work anymore: http://forums.alliedmods.net/showthread.php?t=24012

this need to be unapproved cause it lags too much because every time you use it, it needs to connect to the inet and show the stats through the browser: http://forums.alliedmods.net/showthread.php?t=51156

the one thing that i don't like about this plug in is that it spams the server logs with this crap:
Code:
L 10/07/2007 - 00:49:23: [ps3stats.amxx]  --> Resolved query 0 3 0, took 1.406378 seconds
L 10/07/2007 - 00:50:17: [ps3stats.amxx]  --> Resolved query 1 1 15, took 0.430271 seconds
L 10/07/2007 - 00:50:37: [ps3stats.amxx]  --> Resolved query 2 1 3, took 0.554855 seconds
L 10/07/2007 - 00:50:48: [ps3stats.amxx]  --> Resolved query 3 1 15, took 0.640724 seconds
L 10/07/2007 - 00:50:50: [ps3stats.amxx]  --> Resolved query 4 1 5, took 0.555290 seconds
L 10/07/2007 - 00:50:53: [ps3stats.amxx]  --> Resolved query 5 1 3, took 0.515678 seconds
L 10/07/2007 - 00:57:23: [ps3stats.amxx]  --> Resolved query 6 1 15, took 0.866241 seconds
L 10/07/2007 - 01:01:13: [ps3stats.amxx]  --> Resolved query 7 1 15, took 0.385009 seconds
L 10/07/2007 - 01:01:28: [ps3stats.amxx]  --> Resolved query 8 1 5, took 0.816284 seconds
L 10/07/2007 - 01:01:32: [ps3stats.amxx]  --> Resolved query 9 1 3, took 0.626953 seconds
__________________
hoboman is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 10-07-2007 , 13:44   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #7

Im sure he could add a cvar to have it log optionally. That would problaby get a good idea, as the logs do offer good troubleshooting information.

as for the second plugin you said should be unapproved. I dont think so, as it still works, may be a little laggy but it all depends on clients computer then, cause I load fairly quickly.
__________________

BigBaller is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 10-07-2007 , 16:30   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #8

Quote:
Originally Posted by GeroiN View Post
I see the only proper way to do this without recompiling statsx. Command functions must
Code:
return PLUGIN_HANDLED
except
Code:
return PLUGIN_CONTINUE
But then "say /rank" will not appear as a chat message visible for other players. If there is the way to make "say" message visible...
You could send the SayText message yourself and then return PLUGIN_HANDLED. You can look at AdminListen if you need an example of how to do this.
Lee is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 10-09-2007 , 03:11   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #9

I have not tested this yet, but seriously I was getting pissed that those other ones did not work for crap. Some barely worked, some did not at all. Although the lagg issue, that sux. If you want to add a cvar to the logs, would that not be a whole lot of cvar checking and possibly slow things down even more? Im going to test it tho, I just hope it doesnt lagg incredibly since one of our servers is not hosted, but a home pc lol

It would also be nice to implement csstats with psychostats, well be separate and use diff commands? like /psrank. Because some people just came on and it will take ages to get anywhere with psychostats on teh server, but with regular stats, they can accomplish something... I dunno
__________________

Last edited by bmann_420; 10-09-2007 at 03:23.
bmann_420 is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 10-09-2007 , 12:52   Re: Psychostats 3 in-game stats (threaded SQLx)
Reply With Quote #10

bmann

Your problaby right on adding another cvar, I noticed he does include a PSDEBUG define, with a few additions you can simply recompile the plugin with the if statements so they dont log anymore
__________________

BigBaller is offline
Reply


Thread Tools
Display Modes

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 12:25.


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