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

Insurgency 2014 support


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jballou
Member
Join Date: Jul 2013
Old 01-13-2015 , 08:55   Insurgency 2014 support
Reply With Quote #1

Hi everyone,
I have a few tools to help add Insurgency support to your HLStatsX instances. This works well with my ins_logger plugin, and I have an HLStatsX SM plugin that supports colors and formats messages properly. I'm pretty new to HLStatsX and Sourcemod in general, so I'd appreciate any feedback and help with keeping this up to date and stable.
Database script generator: This generates a non-destructive SQL script that with either add or update all objects needed, pulled from my instance at http://stats.jballou.com . I have other processes on my side that detect when Insurgency is updated, extract the game data files, and create the objects in the database when they're added. This includes the game definition itself, weapons, maps and heatmap data, teams, ribbons/awards, and everything else. There are options at the top to select non-standard mod names and database prefix if you hate being standardized.
HLStatsX Fork: Based on upstream HLStatsX, adds Insurgency as a new game and sets colors and formats properly, adds an EventsRounds table to track Insurgency specific data, heatmaps are fixed, and it's linked to my automatically updated game data repo to keep map and weapon images up to date.
Web images: There is a tool in my HLStatsX deployment that uses my Insurgency data repo to generate images for the Web UI using the in-game data and images. It applies a label to the weapon icons by default.
jballou is offline
slampemil
Junior Member
Join Date: Dec 2014
Old 01-13-2015 , 16:47   Re: Insurgency 2014 support
Reply With Quote #2

I may be retarded, but I can't get it to work. My database is correct, and the plugin is listed in Insurgency, but no data comes to the database. Do I need the deamon started for it? Because when i try to use 'perl hlstats.pl. I get this error;
Quote:
The getpwuid function is unimplemented at hlstats.pl line 1833
I use windows 12 server.
Oh. Only error on the server is this;
Quote:
L 01/13/2015 - 21:490: [SM] Plugin encountered error 15: Array index is out of bounds
L 01/13/2015 - 21:490: [SM] Displaying call stack trace for plugin "superlogs-ins.smx":
I use brutus_ins_logger.smx, and ins_logger.smx too..
Well. Any help in some direction would be nice. Thanks in advance!

Emil
__________________
slampemil is offline
jballou
Member
Join Date: Jul 2013
Old 01-20-2015 , 14:21   Re: Insurgency 2014 support
Reply With Quote #3

I think we already resolved this, but the getpwuid issue was from Windows Perl, and if you use my ins_logger.smx plugin you MUST remove superlogs-ins.smx and brutus_ins_logger.smx.
jballou is offline
ijam_j
Member
Join Date: Mar 2007
Old 11-24-2015 , 07:39   Re: Insurgency 2014 support
Reply With Quote #4

Quote:
Originally Posted by jballou View Post
I think we already resolved this, but the getpwuid issue was from Windows Perl, and if you use my ins_logger.smx plugin you MUST remove superlogs-ins.smx and brutus_ins_logger.smx.
i might have the same error. here are the logs of srcds. im on windows 7. where can i find ins_logger.smx?

Quote:
Weapon spawning in solid!
Weapon spawning in solid!
L 11/24/2015 - 129:57: World triggered "killlocation" (attacker_position "705
86 176") (victim_position "471 -153 176")
L 11/24/2015 - 129:57: "[NZ]wildernesshunter<89><STEAM_1:0:88054454><#Tea m_Sec
urity>" killed "BOT Dean<201><BOT><#Team_Insurgent>" with "m590<8>" at (471.4770
20, -152.783478, 176.031250)
Weapon spawning in solid!
Weapon spawning in solid!
L 11/24/2015 - 129:59: [SM] Plugin encountered error 15: Array index is out of
bounds
L 11/24/2015 - 129:59: [SM] Displaying call stack trace for plugin "superlogs-
ins.smx":
L 11/24/2015 - 129:59: [SM] [0] Line 207, superlogs-ins.sp::Event_PlayerHur
t()
L 11/24/2015 - 129:59: World triggered "killlocation" (attacker_position "719
288 176") (victim_position "501 -220 176")
L 11/24/2015 - 129:59: "[KR]AnSwer<145><STEAM_1:1:100894649><#Team_Securi ty>"
killed "BOT Brian<187><BOT><#Team_Insurgent>" with "m16a4<1>" at (501.187408, -2
19.697861, 176.031250)
Weapon spawning in solid!
Weapon spawning in solid!
this is the source of superlogs-ins.sp

Code:
public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
	//  "userid"		"short"		// user ID on server
	//  "attacker"		"short"		// CLIENT INDEX! on server of the attacker
	//  "dmg_health"		"short"		// lost health points
	//  "hitgroup"		"short"			// Hit groups
	//  "weapon"		"string"		// Weapon name, like WEAPON_AK47

	new attacker  = GetEventInt(event, "attacker");
	new victim = GetEventInt(event, "userid");

	if (attacker > 0 && attacker != victim)
	{
		// ... wtf insurgency... userid is userid and attacker is client index?
		//attacker = GetClientOfUserId(attacker);
		
		new hitgroup  = GetEventInt(event, "hitgroup");
		if (hitgroup < 8)
		{
			hitgroup += LOG_HIT_OFFSET;
		}
		
		if (g_logwstats)
		{
			decl String:weapon[MAX_WEAPON_LEN+PREFIX_LEN];
			GetEventString(event, "weapon", weapon, sizeof(weapon));

			new weapon_index = get_weapon_index(weapon[PREFIX_LEN]);

			if (weapon_index > -1)  {
				g_weapon_stats[attacker][weapon_index][LOG_HIT_HITS]++; //line 207 is here
				g_weapon_stats[attacker][weapon_index][LOG_HIT_DAMAGE]  += GetEventInt(event, "dmg_health");
				g_weapon_stats[attacker][weapon_index][hitgroup]++;
				
				if (hitgroup == (HITGROUP_HEAD+LOG_HIT_OFFSET))
				{
					g_weapon_stats[attacker][weapon_index][LOG_HIT_HEADSHOTS]++;
				}
				g_client_last_weapon[attacker] = weapon_index;
				g_client_last_weaponstring[attacker] = weapon;
			}
		}
		
		if (g_logheadshots && hitgroup == (HITGROUP_HEAD+LOG_HIT_OFFSET))
		{
			LogPlayerEvent(attacker, "triggered", "headshot");
		}
	}
}

Last edited by ijam_j; 11-24-2015 at 07:47.
ijam_j is offline
ijam_j
Member
Join Date: Mar 2007
Old 11-24-2015 , 07:56   Re: Insurgency 2014 support
Reply With Quote #5

found ins_logger.smx here https://forums.alliedmods.net/showthread.php?t=253201

will try and report back.
ijam_j is offline
Reply



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 17:20.


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