Raised This Month: $ Target: $400
 0% 

Double/Triple Kill with the same bullet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sparkey
Senior Member
Join Date: May 2010
Old 08-05-2011 , 11:51   Double/Triple Kill with the same bullet
Reply With Quote #1

How can i hook this event in a smart way? time would be one way but then it does not have to be the same bullet

Best regards
sparkey is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2011 , 13:41   Re: Double/Triple Kill with the same bullet
Reply With Quote #2

death gametime and death killer should be the same.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-05-2011 , 18:27   Re: Double/Triple Kill with the same bullet
Reply With Quote #3

Would you mind showing me and example?

Would i have to put the gametime in an array and pass it on to the next kill to compare?

Thanks for your answer.
sparkey is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-05-2011 , 18:53   Re: Double/Triple Kill with the same bullet
Reply With Quote #4

Something like this. You need to add counter yourself (for triple kills).
Code:
public EventDeathMsg( ) {     new iKiller = read_data( 1 );         if( !iKiller || iKiller == read_data( 2 ) )     {         return;     }         static iLastKiller, Float:flLastKill;         new Float:flGameTime = get_gametime( );         if( iLastKiller == iKiller && flGameTime == flLastKill )     {         // Double kill :)     }         flLastKill  = flGameTime;     iLastKiller = iKiller; }
__________________
xPaw is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-05-2011 , 18:57   Re: Double/Triple Kill with the same bullet
Reply With Quote #5

Thanks alot m8! Will try it out right away
sparkey is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-06-2011 , 00:30   Re: Double/Triple Kill with the same bullet
Reply With Quote #6

Have been troubleshooting this for a while now and just realized that the timestamp is not the same when it reaches the second death.

Code:
First Death: flGameTime 109.524772
Second Death: flGameTime 109.530891
Any ideas?
sparkey is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-06-2011 , 00:35   Re: Double/Triple Kill with the same bullet
Reply With Quote #7

Maybe cut down to a tenth of a second?

Or if you want, might be a lot less accurate, just same second?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2011 , 00:40   Re: Double/Triple Kill with the same bullet
Reply With Quote #8

Use a global variable to count player kills.
Reset this variable when a player shoots a bullet.
Increase the variable when player kills another player.
Check variable for double kill.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-06-2011 , 04:16   Re: Double/Triple Kill with the same bullet
Reply With Quote #9

Quote:
Originally Posted by sparkey View Post
Have been troubleshooting this for a while now and just realized that the timestamp is not the same when it reaches the second death.

Code:
First Death: flGameTime 109.524772
Second Death: flGameTime 109.530891
Any ideas?

You sure you logged that with a single bullet ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-06-2011 , 13:58   Re: Double/Triple Kill with the same bullet
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
You sure you logged that with a single bullet ?
Yepp

Quote:
Originally Posted by Exolent[jNr] View Post
Look in Code Snippets/Tutorials for hooking gun fire events.
I really cant find the event that you are talking about

Have been going through the list for quite some time now
http://wiki.amxmodx.org/Half-Life_1_Game_Events

And searching the forums but can not find any event that is hooking gun fire events.



Thanks for all of your time.
sparkey 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 03:26.


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