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

Solved [TF2] A better way to kill players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-22-2016 , 13:00   [TF2] A better way to kill players
Reply With Quote #1

Is there a better way to kill a player than ForcePlayerSuicide ?
The problem is that because of how tf2 works, it gives a player a kill, even though the player commited suicide, because the player got damaged.

I need to kill a player, not increase the death count and not increase the frags for a random player that dealt damage to him. Any ideas?
__________________

Last edited by luki1412; 09-23-2016 at 18:41.
luki1412 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-23-2016 , 18:53   Re: [TF2] A better way to kill
Reply With Quote #2

The problem is that TF2 is designed to give a kill credit to the last player when a player suicides or is killed by the environment. So, even if you used an alternate method like SDKHooks_TakeDamage, it's probably going to give credit to the last player to do damage.

Not sure what would happen if you damage a player twice from the environment (entity 0) though.

Side note: When using SDKHooks_TakeDamage, setting the damageType to DMG_CRUSH should kill a player even when they're ubered.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-23-2016 at 18:54.
Powerlord is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 06-24-2016 , 05:54   Re: [TF2] A better way to kill
Reply With Quote #3

Try to respawn the player (it should reset its data) and then kill him with SDKHooks_TakeDamage.
__________________
Benoist3012 is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-24-2016 , 07:11   Re: [TF2] A better way to kill
Reply With Quote #4

Quote:
Originally Posted by Powerlord View Post
The problem is that TF2 is designed to give a kill credit to the last player when a player suicides or is killed by the environment. So, even if you used an alternate method like SDKHooks_TakeDamage, it's probably going to give credit to the last player to do damage.

Not sure what would happen if you damage a player twice from the environment (entity 0) though.

Side note: When using SDKHooks_TakeDamage, setting the damageType to DMG_CRUSH should kill a player even when they're ubered.
Yes SDKHooks_TakeDamage gave credit to the last player that did damage. I set inflictor and attacker to clientid and used DMG_ACID. Dont think that damage type matters when it comes to giving credit for the kill.
__________________
luki1412 is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-24-2016 , 07:13   Re: [TF2] A better way to kill
Reply With Quote #5

Quote:
Originally Posted by Benoist3012 View Post
Try to respawn the player (it should reset its data) and then kill him with SDKHooks_TakeDamage.
Cant respawn player mid-game. Its for a mod. Besides, its not worth it. Might as well try to change the scoreboard.
__________________
luki1412 is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 06-24-2016 , 12:51   Re: [TF2] A better way to kill
Reply With Quote #6

Quote:
Originally Posted by luki1412 View Post
Cant respawn player mid-game. Its for a mod. Besides, its not worth it. Might as well try to change the scoreboard.
PHP Code:
SetEntProp(clientProp_Send"m_lifeState"2);
TF2_RespawnPlayer(client); 
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-26-2016 , 16:26   Re: [TF2] A better way to kill
Reply With Quote #7

Quote:
Originally Posted by Naydef View Post
PHP Code:
SetEntProp(clientProp_Send"m_lifeState"2);
TF2_RespawnPlayer(client); 
Im trying to avoid giving someone frags for damaging a player that committed suicide. How is this code supposed to help? I can't respawn someone in the middle of a round. I dont mean that its not possible, I mean that I cant do it.
__________________
luki1412 is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 06-26-2016 , 21:01   Re: [TF2] A better way to kill
Reply With Quote #8

Change the killer on the player_death event to 0.
thecount is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 07-05-2016 , 14:31   Re: [TF2] A better way to kill
Reply With Quote #9

Quote:
Originally Posted by thecount View Post
Change the killer on the player_death event to 0.
TF2 treats world and suicide the same way when it comes to this.
__________________
luki1412 is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 07-05-2016 , 22:17   Re: [TF2] A better way to kill
Reply With Quote #10

Quote:
Originally Posted by luki1412 View Post
TF2 treats world and suicide the same way when it comes to this.
Just subtract one from their deaths.
thecount 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 19:04.


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