AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Psychostats 3 in-game stats (threaded SQLx) (https://forums.alliedmods.net/showthread.php?t=61665)

GeroiN 10-06-2007 18:56

Psychostats 3 in-game stats (threaded SQLx)
 
3 Attachment(s)
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.

Lee 10-06-2007 22:17

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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.

hoboman 10-06-2007 23:08

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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

BigBaller 10-07-2007 04:32

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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!

GeroiN 10-07-2007 05:46

Re: Psychostats 3 in-game stats (threaded SQLx)
 
Quote:

Originally Posted by Lee (Post 539504)
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 (Post 539516)
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 (Post 539566)
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.

hoboman 10-07-2007 13:42

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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


BigBaller 10-07-2007 13:44

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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.

Lee 10-07-2007 16:30

Re: Psychostats 3 in-game stats (threaded SQLx)
 
Quote:

Originally Posted by GeroiN (Post 539578)
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.

bmann_420 10-09-2007 03:11

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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 :D

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

BigBaller 10-09-2007 12:52

Re: Psychostats 3 in-game stats (threaded SQLx)
 
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 :)


All times are GMT -4. The time now is 17:50.

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