AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   CSstatsX SQL (https://forums.alliedmods.net/showthread.php?t=279483)

GordonFreeman (RU) 02-23-2016 11:25

CSstatsX SQL
 
1 Attachment(s)
CSstatsX SQL

Description
This plugin can replace your CSX module. You need do some changes to your statistics plugins (statsx, miscstats etc.) to make them use this plugin, see how-to below. If you can't or you dont want use MySQL, this plugin will also work with local SQLite database. New features: player played time count and ranking by skill with ELO method.

Version: 0.7.4+1 from 31.08.2018 [ GIT ]

Requirements
Installation
  • Compile this plugin.
    • For utf8 support you need compile and use it with AMXX 1.8.3.
  • Uncomment wanted SQL module in addons/amxmodx/configs/modules.ini file.
  • Set db connection details in following cvars: csstats_sql_host, csstats_sql_user, csstats_sql_pass, csstats_sql_db, csstats_sql_type.
  • Read instruction bellow to add support for your stats plugins.
  • For update from 0.4 import csstats_04_to_05.sql.
  • For update from 0.5 dev import csstats_05dev_to_05.sql.
  • For update from 0.6 import csstats_06_to_07.sql.
  • For update from 0.7 import csstats_07_to_072.sql.
    • For map stats import csstats_07_to_072_maps.sql.
    • Recompile all your plugins with new csstatsx_sql.inc.
  • For enabled player session stats you need import csstats_maps.sql. Please check table name.
    • csstats_maps_sqlite.sql for sqlite.
How to replace CSX module
  • Shutdown your server.
  • Copy dummy_csx_amxx file from archive to addons/amxmodx/modules folder on your server.
  • Rename it to csx_amxx.
  • Set csstats_sql_forwards cvar to 1.
How to add support for your plugins

Perform this instructions for ALL your stats plugins
  • Open plugin source code.
  • Add following on top:
    Code:

    native get_statsnum_sql()
    native get_user_stats_sql(index, stats[8], bodyhits[8])
    native get_stats_sql(index, stats[8], bodyhits[8], name[], len, authid[] = "", authidlen = 0)

  • Replace all get_statsnum for get_statsnum_sql.
  • Replace all get_user_stats for get_user_stats_sql.
  • Replace all get_stats for get_stats_sql.
  • Compile plugin.
Cvars
  • csstats_sql_host "localhost" - MySQL host.
  • csstats_sql_user "root" - MySQL user
  • csstats_sql_pass "" - MySQL user password
  • csstats_sql_db "amxx" - DB name
  • csstats_sql_table "csstats" - table name
  • csstats_sql_type "mysql" - database type.
    • mysql - MySQL
    • sqlite - SQLite
  • csstats_sql_create_db "1" - auto create table.
    • 0 - dont query table create
    • 1 - query table create on map load
  • csstats_sql_update "-2" - how to update player stats in db
    • -2 - on death and disconnect
    • -1 - on round end and disconnect
    • 0 - on disconnect
    • higher than 0 - every n seconds and disconnect
  • csstats_sql_forwards "0" - enable own forwards for client_death, client_damage
    • 0 - disable
    • 1 - enable, required if you want replace csx module
  • csstats_sql_rankformula "0" - how to rank player
    • 0 - kills- deaths - tk
    • 1 - kills
    • 2 - kills + hs
    • 3 - skill
    • 4 - played time.
  • csstats_sql_skillformula "0" - skill formula
  • csstats_sql_weapons "0" - enable weapon stats
    • 0 - disable
    • 1 - enable
      • This will create new table csstats_weapons in your database.
        NOTE: table will created only if you set cvar csstats_sql_create_db to 1
  • csstats_sql_maps "0" - enable player session stats
    • 0 - disable
    • 1 - enable
      • NOTE: you need to import csstats_maps.sql.
        Check install instructions.
  • csstats_sql_autoclear "0" - number of inactive days after which player's stats will be retested. (prune function)
  • csstats_sql_autoclear_day "0" - full stats reset in specified day of month.
  • csstats_sql_cachetime "-1" - cache option
    • -1 - enabled
    • 0 - disabled
    • doesn't work with csstats_sql_update -2 or 0
  • csstats_sql_assisthp "50" - minimum damage to count assist. 0 - disable this feature.
Commands

  • csstats_sql_reset - full stats reset. This command should executed in server console or via RCON.
Lags on player top 15 motd

For top15 motd non-thread queries are used, this can make your server lag while displaying motd. I added support for threaded queries for top15 from version 0.4, but to add this support for your stats plugins you need to be a somekind of scripter. Send me your stats plugins source code or use plugins with threaded support bellow.
csxmysql_amxx_statsx.zip (22.2 KiB)
AES: StatsX CStrike

CSXSQL: Onlinetime Awards


TOPx By GameTime alternative plugin for CSstatsX SQL. This plugin will give access flags for top players by online time. Compile options:
Code:

#define TOP        3                // top number
#define IGNORE_FLAGS    (ADMIN_MENU|ADMIN_LEVEL_H)    // ignore players with those flags
#define GIVE_FLAGS    ADMIN_LEVEL_H            // grant access flags

Other thanks for

Thanks to Lev from aghl.ru forum for dummy_csx module.

Download from GitHub

Kakarot47 02-23-2016 13:40

Re: CSstatsX SQL
 
kharasho :D

^SmileY 02-23-2016 17:36

Re: CSstatsX SQL
 
n1ce plugin i will try to implement skill method at pug plugin.

thanks bro

NyTe 02-24-2016 12:55

Re: CSstatsX SQL
 
Nice plugin.

Croxeye 02-24-2016 14:59

Re: CSstatsX SQL
 
Gj :)

Kowalsky 03-09-2016 04:40

Re: CSstatsX SQL
 
Great job!

I am using this on one of the server as a test version.

Just a suggestion - you could add two more natives in your next version -
1) get user played time based on id (for clcmd)
2) get played time based on rank (for top15, i would like to modify the top15 function in order to show total online time for all each player)

If you want to, I could also provide the web part for this plugin. I am coding it at the moment!

GordonFreeman (RU) 05-04-2016 04:20

Re: CSstatsX SQL
 
Updated.
  • Improved queries usage. Now its takes 3-4 queries instead of 32 during mapchange or server shutdown.
  • Updated API.
  • Added csstatsx_sql.inc file.
  • New natives: get_user_gametime, get_stats_gametime, get_user_stats_id, get_stats_id, update_stats_cache.
  • Added rank by played time feature.
  • Added example plugin for api usage.

tousif 05-04-2016 07:01

Re: CSstatsX SQL
 
Nice , :) .. the comments are in some russain change it to english .

GordonFreeman (RU) 05-09-2016 23:55

Re: CSstatsX SQL
 
1 Attachment(s)
0.7 Dev 1
- Added weapon stats.

You need set csstats_sql_weapons cvar to 1. Plugin will write players weapons stats to csstats_weapons table.

I'm planning to make complete stats plugin like HLXCE or GameME.

Also there is WEB for this plugin, but on russian only for now.

Artifact 05-13-2016 12:48

Re: CSstatsX SQL
 
crazy russians, make rocket of cs 1.6 plugin

Hamartia 05-15-2016 23:40

Re: CSstatsX SQL
 
Great job. Thank you.

GordonFreeman (RU) 05-16-2016 02:21

Re: CSstatsX SQL
 
2 Attachment(s)
v. 0.7 Dev 2
- Added player connects, team joins and team wins stats.

Update your table by importing csstats_06_to_07.sql.
API for new stats will be added soon.

Currently i'm working on map stats. I'm found how to do map stats without additional queries from plugin. Map stats will be count on mysql/sqlite side by triggers.

GordonFreeman (RU) 05-16-2016 05:57

Re: CSstatsX SQL
 
3 Attachment(s)
I did :)
Map stats by both mysql and sqlite triggers.

v. 0.7 Dev 3
- Added map stats.

You need update your csstats table again. For map stats you need import csstats_map.sql file and set csstats_sql_maps cvar to 1.
This will create csstats_maps table for map stats and apply stats triggers for csstats table.

API and enhanced statsx plugin will coming soon.

Hamartia 05-16-2016 06:05

Re: CSstatsX SQL
 
I am little confused here. Is replacing the csstatsx module necessary or its just optional ? If optional, is there any advantage of replacing the module ?

GordonFreeman (RU) 05-16-2016 06:08

Re: CSstatsX SQL
 
Quote:

Originally Posted by Hamartia (Post 2419403)
I am little confused here. Is replacing the csstatsx module necessary or its just optional ? If optional, is there any advantage of replacing the module ?

Replacing CSX module is optional. Replacement is only need if you don't know/want to edit your stats plugins for use stats from db (How to add support instruction).

Hamartia 05-16-2016 06:14

Re: CSstatsX SQL
 
Quote:

Originally Posted by GordonFreeman (RU) (Post 2419405)
Replacing CSX module is optional. Replacement is only need if you don't know/want to edit your stats plugins for use stats from db (How to add support instruction).

Oh understood. Thank you.

siriusmd99 05-25-2016 10:43

Re: CSstatsX SQL
 
Заебись блядь :)

Does it have option to edit stats like set_user_stats?

GordonFreeman (RU) 05-25-2016 13:22

Re: CSstatsX SQL
 
Quote:

Originally Posted by siriusmd99 (Post 2421920)
Does it have option to edit stats like set_user_stats?

Нет, but you can edit db table instead.
I don't saw any plugins using set_user_stats from csxe, so its looks like useless stuff kek.

siriusmd99 05-25-2016 16:40

Re: CSstatsX SQL
 
I saw such a plugin it's named csx extended made by souvikdas95, it has that option.
I experienced a really bad moment when I tried to block death count for zombies on basebuilder server because players weren't attacking humans to not loose rank. And I was needed to recompile source code of the csx module.

But it's OK, I don't think someone else would experience such a necessity to block deaths count or to change frags number.

Good Job, really easy to use.

quLeryuzz 06-17-2016 19:12

Re: CSstatsX SQL
 
I tried and it is working perfect. Really easy to use.
Thank you.
http://mrgaming.org/serveristatistikleri.php

edg 06-22-2016 10:22

Re: CSstatsX SQL
 
Hello, because the latest version does not save data ?

http://i.imgur.com/YKV75kU.png

GordonFreeman (RU) 06-22-2016 12:08

Re: CSstatsX SQL
 
Quote:

Originally Posted by edg (Post 2429634)
Hello, because the latest version does not save data ?

http://i.imgur.com/YKV75kU.png

This is for map stats.

edg 06-22-2016 13:09

Re: CSstatsX SQL
 
I have the latest version of csstatsx_sql and does not work anyway. The plugin created the table but does not save the data.

edit:

This will have something to do ?

Quote:

L 06/22/2016 - 20:09:13: [MySQL] No result set in this query!
L 06/22/2016 - 20:09:13: [AMXX] Displaying debug trace (plugin "csstatsx_sql.amxx")
L 06/22/2016 - 20:09:13: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 06/22/2016 - 20:09:13: [AMXX] [0] csstatsx_sql.sma::DB_ReadGetStats (line 2215)
L 06/22/2016 - 20:09:13: [AMXX] [1] csstatsx_sql.sma::SQL_Handler (line 2490)

GordonFreeman (RU) 06-22-2016 23:13

Re: CSstatsX SQL
 
Quote:

Originally Posted by edg (Post 2429686)
I have the latest version of csstatsx_sql and does not work anyway. The plugin created the table but does not save the data.

edit:

This will have something to do ?

Did you followed instructions in this post?
  • Import csstats_map.sql.
  • Set cvar csstats_sql_maps to 1. Write this value directly in csstatsx_sql.sma and recheck it by amx_cvar csstats_sql_maps comman.

GordonFreeman (RU) 06-23-2016 09:55

Re: CSstatsX SQL
 
2 Attachment(s)
AES: StatsX with CSstatsX SQL API



edg 06-23-2016 11:07

Re: CSstatsX SQL
 
http://i.imgur.com/jiHzEJl.png

when stores the values ​​in the database?

GordonFreeman (RU) 06-23-2016 11:16

Re: CSstatsX SQL
 
Values stores on update (not on new).
I see first_join and last_join are same, its new player right? Just make some statistic (shoot, die).
Check that map_stats trigger (Indicies) is exists on csstats table.

edg 06-23-2016 13:58

Re: CSstatsX SQL
 
Thank you very much.

Edit:

Quote:

Originally Posted by GordonFreeman (RU) (Post 2429927)

You added /me and other commands that are in the original top15 ?

GordonFreeman (RU) 06-23-2016 23:25

Re: CSstatsX SQL
 
Quote:

Originally Posted by edg (Post 2429995)
You added /me and other commands that are in the original top15 ?

For /me, /hp and hud messages you can use original StatsX. (just place it after aes statsx)

edg 06-24-2016 15:13

Re: CSstatsX SQL
 
Thank you.


amazing would add statistics to show off the page , ie , show sv name , ip, players and others.

quLeryuzz 06-25-2016 19:17

Re: CSstatsX SQL
 
2 Attachment(s)
I agree edg about server name, current players and others.. For example, I added killassist to CSstatsX for myself. Can you add killassist for the next version? Thank you.

My adding kill assist is Assists for Counter Strike 1.6 v2.1 By RuleBreaker

PHP Code:

public Ham_Killed_player(iVictimiAttackershouldgib) {
    new 
i=0
    
do {
        if(
i!=iAttacker) {
            if(
damage2[i][iVictim]>30) {
                
assist(iiVictim)
            }
        }
        
i+=1
    
} while (i<33)
    
}
public 
assist(attackervictim) {
    
damage2[attacker][victim]=0
    
//assists[attacker]+=1
    
    
player_data[attacker][PLAYER_STATS3][STATS3_ASSISTS]++
    
    
set_hudmessage(025500.790.2406.012.0)
    
show_hudmessage(attacker"+Assist")
}
public 
fwHamPlayerSpawnPost(iPlayer) {
    new 
i=0
    
do {
        
damage2[iPlayer][i]=0
        i
+=1
    
} while(i<33)
}
public 
fw_takedamage(victiminflictorattackerFloat:damagebits) {
      
damage2[attacker][victim]+=damage
}  
public 
deletedmg(id) {
    new 
i1 0
    
do {
        new 
i2=0
        
do {
            if(
damage2[i1][i2]>0) {
                
damage2[i1][i2]-=1
            
}
            
i2+=1
        
} while (i2<33)
        
i1+=1
    
} while (i1<33)
    
set_task(1.0"deletedmg")


it's working

GordonFreeman (RU) 07-09-2016 02:42

Re: CSstatsX SQL
 
Update 0.7.4 :p
  • Added weapon stats. New cvar csstats_sql_weapons.
  • Added match history stats. New cvar csstats_sql_maps.
  • Added round and connect stats.
  • Added assist stats. New cvar csstats_sql_assisthp and new forward client_assist_sql.
  • Added autoclean function. New cvar csstats_sql_autoclear.
  • Added autoreset function. New cvar csstats_sql_autoclear_day.
  • Improved cached usage. New cvar csstats_sql_cachetime.
  • Fixed bugs with get_stats and get_stats2 natives.
  • Removed is_user_connected check for get_user_stats natives.
  • Updated API.
  • New natives: get_sestats_*, get_user_stats3, get_stats3, get_stats2, get_user_stats2, get_user_firstjoin_sql, get_user_lastjoin_sql.
  • Fixed problem with cvar reading.
  • Fixed random bugs.

Hamartia 07-31-2016 14:31

Re: CSstatsX SQL
 
Hi,

I am waiting for the release to be stable so that I can start using it. Whats your opinion about the current stage, is it stable enough or more rapid releases to be expected ?

GordonFreeman (RU) 08-01-2016 11:09

Re: CSstatsX SQL
 
rapidly stable

Its should work fine if you are know how to install it xd
Currently most (90%) admins users of this plugin are faced problem that its hard to install and use.

I'm tested and retested it with hlds 6153, amxx 1.8.2 with local database (both mysql and sqlite).

Common problems:
  • rehlds with amxx 1.8.3, client_disconnected forward, fixing by googling error log.
  • may cause higher load time for top15 (OMG ITS TAKE 4-5 SECONDS TO OPEN TOP15 MOTD)
    there is cache function for this case, but its still can take same time for top15, if you are using many sql plugins with many sql queries.
  • someone report random crash with remote database on shared hosting. i tried to check this moment, but failed to reproduce it with remote mysql db with ~150 ping.
  • you can't use it if you are don't know how your server is working.
  • "I KNOW MORE THAT DEVELOPER" problem.
Plugin can work separately with your csx module. So if you want check it without interrupt csx stats you can install it and watch plugin stats in sql table.

Hamartia 08-01-2016 15:34

Re: CSstatsX SQL
 
Quote:

Originally Posted by GordonFreeman (RU) (Post 2441380)
rapidly stable

Its should work fine if you are know how to install it xd
Currently most (90%) admins users of this plugin are faced problem that its hard to install and use.

I'm tested and retested it with hlds 6153, amxx 1.8.2 with local database (both mysql and sqlite).

Common problems:
  • rehlds with amxx 1.8.3, client_disconnected forward, fixing by googling error log.
  • may cause higher load time for top15 (OMG ITS TAKE 4-5 SECONDS TO OPEN TOP15 MOTD)
    there is cache function for this case, but its still can take same time for top15, if you are using many sql plugins with many sql queries.
  • someone report random crash with remote database on shared hosting. i tried to check this moment, but failed to reproduce it with remote mysql db with ~150 ping.
  • you can't use it if you are don't know how your server is working.
  • "I KNOW MORE THAT DEVELOPER" problem.
Plugin can work separately with your csx module. So if you want check it without interrupt csx stats you can install it and watch plugin stats in sql table.

Thanks for the info. I ll try it out.

Bleeding Warrior 11-07-2016 09:47

Re: CSstatsX SQL
 
Quote:

Originally Posted by GordonFreeman (RU) (Post 2441380)
rapidly stable

Its should work fine if you are know how to install it xd
Currently most (90%) admins users of this plugin are faced problem that its hard to install and use.

I'm tested and retested it with hlds 6153, amxx 1.8.2 with local database (both mysql and sqlite).

Common problems:
  • rehlds with amxx 1.8.3, client_disconnected forward, fixing by googling error log.
  • may cause higher load time for top15 (OMG ITS TAKE 4-5 SECONDS TO OPEN TOP15 MOTD)
    there is cache function for this case, but its still can take same time for top15, if you are using many sql plugins with many sql queries.
  • someone report random crash with remote database on shared hosting. i tried to check this moment, but failed to reproduce it with remote mysql db with ~150 ping.
  • you can't use it if you are don't know how your server is working.
  • "I KNOW MORE THAT DEVELOPER" problem.
Plugin can work separately with your csx module. So if you want check it without interrupt csx stats you can install it and watch plugin stats in sql table.

Hello , I have a problem , I have set cvars properly but still my server is not picking up host IP, i tried hardcoding it but still same problem !!
Also i have added same IP in aes.cfg and sql.cfg as well , still same problem !
https://s12.************/b25mnb65p/image.jpg

D3XT3R 11-17-2016 14:32

Re: CSstatsX SQL
 
Nice Job !

spot 12-03-2016 15:29

Re: CSstatsX SQL
 
This works with CS:GO and mysql? Better then Rankme PLugin?

ACM1PT 12-03-2016 15:38

Re: CSstatsX SQL
 
Quote:

Originally Posted by spot (Post 2474889)
This works with CS:GO and mysql? Better then Rankme PLugin?

WTF man, this plugin is made for cs 1.6. You are drugged?

rautamiekka 12-04-2016 05:06

Re: CSstatsX SQL
 
Quote:

Originally Posted by ACM1PT (Post 2474893)
WTF man, this plugin is made for cs 1.6. You are drugged?

Many Server Owners can't tell night from day.


All times are GMT -4. The time now is 07:02.

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