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

Easy way to do fire counting??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-21-2005 , 02:35   Easy way to do fire counting??
Reply With Quote #1

OK, got the "tuff" stats done (ie logging bodypart and damage per bullet)... but how the heck do you do the fire counting easy, incl grenades and knife??

"weapon_fire" is not working "correct" as holding the firebutton with grenades cuases it to spam the fire the event, and "slow-knife" is not triggered...

Hooking "CBaseEntity::FireBullet" didn't work as it's not triggered by CSS-mod...

/X

PS! Probably missing something obvious
XAD is offline
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 02-21-2005 , 04:24  
Reply With Quote #2

is this for detailed stats like in psychostats ?`
__________________
Rebell is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 02-21-2005 , 12:48  
Reply With Quote #3

weapon_fire
bullet_impact
player_hurt
player_death

hope it can help you :/ lol
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-21-2005 , 14:55  
Reply With Quote #4

Quote:
Originally Posted by Cr3V3TT3
weapon_fire
bullet_impact
player_hurt
player_death

hope it can help you :/ lol
weapon_fire is the one not working correct (which I'm using at the moment)...
bullet_impact is sent when a bullet hit something, which make it hard to count "shots" with as shotguns contain multiple bullets...
player_hurt is sent when a bullet is hitting a player...
player_death is sent when a player dies...

... doesn't get second-fire-knife-stab or grenades...

/X

PS! I'm now tracking the grenade explosion as a "shot" (it's ok as you don't get any damage until it explodes)...
XAD is offline
Sekkusu
Junior Member
Join Date: Dec 2004
Old 02-21-2005 , 20:07  
Reply With Quote #5

What event logs body part hit?

Also, a generic event question: Is the event sent to the Event Handler in server plugins a pointer (can it be modified and CS:S uses the modified version) or does it just send a copy of the information?
Sekkusu is offline
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-22-2005 , 03:02  
Reply With Quote #6

Ahhh, "weapon_fire" is sort of useless when you can grenade-spam it... as it get spammed during the time someone holds a grenade and pressing the mouse-key, the plugin neads to first get the event, loop through all players to get index based on userid, loop through a weapon list using string compare to find the weapon, ... king a lof of CPU for nothing... need a better solution...


Quote:
Originally Posted by Sekkusu
What event logs body part hit?
No event..

Quote:
Originally Posted by Sekkusu
Also, a generic event question: Is the event sent to the Event Handler in server plugins a pointer (can it be modified and CS:S uses the modified version) or does it just send a copy of the information?
It's not only rude to hijack threads but also make the chance less that you get an answer as people read the thread subject to filter what they want to read and answer... please open a new one...

/X
XAD is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 02-22-2005 , 18:48  
Reply With Quote #7

i' m not very sure if i understand what do you mean but this is a js plugin i make to done a fire couting :

Don' t use it it very buggy
Code:
ScriptName	= "justatest";
ScriptTitle	= "";
ScriptDiscribe	= "";
ScriptVersion	= "0.1";
ScriptMinIVer	= "0.10";
ScriptMaxIVer	= "0.10";
ScriptAuthor	= "Cr3V3TT3";
ScriptContact	= "";

var a_Bullets = Array();

a_Bullets[0] = Array();
a_Bullets[1] = Array();
a_Bullets[2] = Array();
a_Bullets[3] = Array();
a_Bullets[4] = Array();
a_Bullets[5] = Array();
a_Bullets[6] = Array();
a_Bullets[7] = Array();
a_Bullets[8] = Array();
a_Bullets[9] = Array();
a_Bullets[10] = Array();
a_Bullets[11] = Array();

for (i=1; i<Env.PlayerMax+1; i++){
	for (j=1; j<Env.PlayerMax+1; j++)
		a_Bullets[i][j]=0;
}

function onFireGameEvent ( event ){
	var name=event.eventname
	if (!name) return;
		if (name=="player_hurt"){
			if (event.userid && event.attacker){
				attacker=Env.Player[event.attacker];
				userid=Env.Player[event.userid];
				a_Bullets[event.userid][event.attacker]++;
				print ("<"+userid.Name+"><"+event.userid+"><"+event.health+" Hp> get a bullet from <"+attacker.Name+"><"+event.attacker+">\n");
			}
		}
		if (name=="player_death"){
			if (event.userid && event.attacker){
				for (i=1; i<Env.PlayerCount; i++){
					pl=Env.Player['#'+i];
					if (pl.isValid){
						print ("  <"+userid.Name+"><"+event.userid+"> died with "+a_Bullets[event.userid][pl.ID]+" bullets of <"+attacker.Name+"><"+event.attacker+">\n");
						for (j=1; j<Env.PlayerCount+1; j++)
							a_Bullets[event.userid][j]=0;
					}
				}
			}
		}
}


It has returned :

Quote:
<-вΘт- Alfred><7><0 Hp> get a bullet from <Cr3V3TT3><2>
<-вΘт- Alfred><7> died with 1 bullets of <Cr3V3TT3><2>
<-вΘт- Alfred><7> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Alfred><7> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Alfred><7> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Alfred><7> died with 0 bullets of <Cr3V3TT3><2>
j!b0u killed -вΘт- Alfred with knife.
<-вΘт- Ulysses><4><0 Hp> get a bullet from <Cr3V3TT3><2>
<-вΘт- Ulysses><4> died with 1 bullets of <Cr3V3TT3><2>
<-вΘт- Ulysses><4> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Ulysses><4> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Ulysses><4> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Ulysses><4> died with 0 bullets of <Cr3V3TT3><2>
j!b0u killed -вΘт- Ulysses with knife.
<-вΘт- Calvin><5><80 Hp> get a bullet from <Cr3V3TT3><2>
<-вΘт- Calvin><5><65 Hp> get a bullet from <Cr3V3TT3><2>
<-вΘт- Calvin><5><50 Hp> get a bullet from <Cr3V3TT3><2>
<-вΘт- Calvin><5><0 Hp> get a bullet from <Cr3V3TT3><2>
<-вΘт- Calvin><5> died with 4 bullets of <Cr3V3TT3><2>
<-вΘт- Calvin><5> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Calvin><5> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Calvin><5> died with 0 bullets of <Cr3V3TT3><2>
<-вΘт- Calvin><5> died with 0 bullets of <Cr3V3TT3><2>
j!b0u killed -вΘт- Calvin with knife

I think the events player_hurt and player_death are a good way but maybe you don' t think so ...
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-23-2005 , 04:35  
Reply With Quote #8

Quote:
Originally Posted by Cr3V3TT3
i' m not very sure if i understand what do you mean but this is a js plugin i make to done a fire couting :
...
I think the events player_hurt and player_death are a good way but maybe you don' t think so ...
Sorry but you only count hits, not the number of "fires" (ie number of time you hit fire with a weapon or throwing grenades). Fire-count is used for accuracy calculation in both ingame stats and by PsychoStats (at least v1.9)...

/X

PS! I already have all working except for "second-knife-stab" (incl. bodyhit stats but I don't like using the "weapon_fire" event as it isn't working correct with grenades).
XAD is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 02-23-2005 , 07:20  
Reply With Quote #9

sory i haven' t understood...

For bullet normal weapon you can use bullet_impact, and for he grenades use

Quote:
hegrenade_detonate
Keys : "userid" short
I don' t know for the second fire of the knife :/
maybe you can catch +attack2 command and if the weapon if the knife it' s a second knife fire, right ?
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-23-2005 , 08:27  
Reply With Quote #10

Quote:
Originally Posted by Cr3V3TT3
For bullet normal weapon you can use bullet_impact, and for he grenades use
Yea, I thought about that one first, but it will count each "sub"-bullet in a shotgun "fire", not the number of "fires"... and it won't track knife stabs either...
I was thinking a lot about this (and also had a discussion on irc and our forum). Either the stats counts the number of bullets (for one of the shotguns it's 6) or number of "fire" of a weapon. But as a grenade can still hit a lof of players and one bullet can hit twice (fired from behind through left upperarm and in the lowerarm holding the gun), I choosed to count number of "fires" and number of hits...

Quote:
Originally Posted by Cr3V3TT3
I don' t know for the second fire of the knife :/
maybe you can catch +attack2 command and if the weapon if the knife it' s a second knife fire, right ?
Yepp, that's the one... but you can't just catch +attack2 as it will continue to stab until you release the button, which is the same problem as I have with grenades, which result in "weapon_fire" events until you switch weapon or actual throwing it (ie. you can't even track the first event as if you switch weapon while holding the +attack key the grenade is not thrown)...

/X

PS! Thanks for trying to help me and give me suggestions. I hope you don't think I'm not thankfull because I already tried most of your suggestions without finding THE solution. I wouldn't have posted the question unless I had tried everything I could think of and which is reasonable to prototype. BUT I also said I could have missed something obvious, which is why I appreciate you effort as it will confirm that I haven't (so far).
XAD 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 06:07.


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