Raised This Month: $ Target: $400
 0% 

Double/Triple Kill with the same bullet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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 #2

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 #3

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 #4

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 #5

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
sparkey
Senior Member
Join Date: May 2010
Old 08-06-2011 , 01:07   Re: Double/Triple Kill with the same bullet
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
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.
That sounds like a wonderful and easy solution!

What function or event is called when a player shoots a bullet?

Thanks for your answer!
sparkey is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2011 , 03:42   Re: Double/Triple Kill with the same bullet
Reply With Quote #7

Quote:
Originally Posted by sparkey View Post
That sounds like a wonderful and easy solution!

What function or event is called when a player shoots a bullet?

Thanks for your answer!
Look in Code Snippets/Tutorials for hooking gun fire events.


Quote:
Originally Posted by avril-lavigne View Post
you can check weapon
in event curWeapon
new weapon = get_user_weapon(id)
case CSW_DEAGLE : client_cmd(id,"say oops I have deagle")


some thing like that , also check buttons && IN_ATTACK
No.
You can do the same thing just a little different logic.
Code:
playerKilled = false
playerKillCounter = 0

- When player shoots
    if playerKilled = false
        playerKillCounter = 0
    else
        playerKilled = false

- When player kills
    playerKillCounter = playerKillCounter + 1
    playerKilled = true
    if playerKillCounter > 1
        print playerKillCounter
Easy.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 08-06-2011 at 03:46.
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 #8

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 #9

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
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-06-2011 , 14:27   Re: Double/Triple Kill with the same bullet
Reply With Quote #10

Look at VEN tutorial "how to catch shot events" or something like that.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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