Thread: CSstatsX SQL
View Single Post
ralze
New Member
Join Date: Mar 2017
Old 03-20-2017 , 08:53   Re: CSstatsX SQL
Reply With Quote #45

I've been using this plugin on my CS1.6 server and it works perfectly! The only "changes" I made was that I setup a trigger that anytime a record is updated in the csstats table it writes to a new table I setup called csstats_player_names. This way I can keep track of all the alias' a player uses. If you are interested in using, here is the mysql.

Code:
BEGIN
	IF EXISTS (SELECT 1 FROM `csstats_player_names` WHERE `player_id` = NEW.`id` AND `name` = NEW.`name`)
	THEN
		UPDATE `csstats_player_names` SET
			`last_used` = NOW(),
            `times_used` = `times_used` + 1
		WHERE `player_id` = NEW.`id` AND `name` = NEW.`name`;
	ELSE
		INSERT INTO `csstats_player_names` (
			`player_id`,
			`name`,
			`last_used`,
            `times_used`
		) VALUES (
			NEW.`id`,
			NEW.`name`,
            NOW(),
            1
		);
	END IF;
END
Would this work with the Natural Selection 1 module with some tweaks? We have a group of us who still play and I would love to be able to keep stats for that as well (quick googling has no produced any good results).
ralze is offline