Double kill with a grenade
Hello.
I'd like to know how to detect when two players are killed by 1 grenade. I'm not sure if deathmsg defines the killer properly when it's done by grenade, so: 1. Is the killer in DeathMsg index of player who actually killed someone with grenade? If so, is the grenade's string "hegren", as it is for all other weapons? 2. How do I detect if it was a double kill? For the second point, I think the gametime for both the kills should be the same, but I'm not sure. |
Re: Double kill with a grenade
Yes, killer is the player index and it's "hegren"... you could've just tested by debugging deathmsg :)
And yeah, game time + killer check should be ok, but they don't have to match exacly, you can allow at least 1 second for error because a player can't throw grenades faster than 1 second AFAIK. |
Re: Double kill with a grenade
In DeathMsg if(equali(weapon, "hegren")) works not.
Edit: The weapon name is actually "grenade" |
Re: Double kill with a grenade
See, it took you 5 minutes to test it out (the additional minute to edit your post :P)
|
Re: Double kill with a grenade
There may be a better way but this works. It will notify via client_print if more than 1 kill is made with the same grenade.
PHP Code:
|
Re: Double kill with a grenade
I prefer this method:
Code:
The only difference with my method is that you can't properly check for more than 1 kill number without using tasks and more stuff. But with bugsy's code, it's easy to check for more than 1 kill number. (By more than 1 kill number, I mean checking for 2 or 3 kills) |
Re: Double kill with a grenade
Is it the same with other weapons?
|
Re: Double kill with a grenade
Quote:
|
Re: Double kill with a grenade
Could you show me how can it be made with the other weapons.
|
Re: Double kill with a grenade
deleted.
|
| All times are GMT -4. The time now is 03:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.