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

[TF2]Simulating headshots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShadowMarioBR
Member
Join Date: Feb 2018
Old 06-23-2018 , 17:12   [TF2]Simulating headshots
Reply With Quote #1

How can i force a crit on headshot with an specific weapon?

Last edited by ShadowMarioBR; 06-24-2018 at 11:02.
ShadowMarioBR is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-23-2018 , 19:11   Re: Simulating headshots
Reply With Quote #2

SetEventBool(eventname, "headshot", true);
mug1wara is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-23-2018 , 19:12   Re: Simulating headshots
Reply With Quote #3

Quote:
Originally Posted by ShadowMarioBR View Post
How can i force a crit on headshot with an specific weapon?
Maybe creating an event of player_death and adding ForcePlayerSuicide if the event doesn't kill him?

Edit: oh, and player_hurt if you want the bastard to live :d
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 06-24-2018 at 09:06.
eyal282 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-23-2018 , 20:07   Re: Simulating headshots
Reply With Quote #4

Quote:
Originally Posted by mug1wara View Post
SetEventBool(eventname, "headshot", true);
I think he wants SDKHooks_TakeDamage but with traceattack for hitgroup, which is unfortunately non-existent.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-23-2018 , 22:27   Re: Simulating headshots
Reply With Quote #5

You really should specify a game.

Going from your posting history, this question is about TF2. As far as I can tell, TF2 only supports hitgroups (and thus headshots) on 3 weapon types:
  • Sniper Rifles
  • Bows
  • Revolvers

Of those, the first two support headshots without changes, although you can disable them using the "sniper no headshots" attribute (attribute 42) on the weapon. Revolvers need an attribute to do headshots: "revolver use hit locations" (attribute 51).

Both of those attributes do the same thing; they change the firing mode of the weapon to its second (1) mode so you can't just slap them on other weapons and expect them to work.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-23-2018 at 22:30.
Powerlord is offline
ShadowMarioBR
Member
Join Date: Feb 2018
Old 06-24-2018 , 11:01   Re: Simulating headshots
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
Going from your posting history, this question is about TF2..
Yes, it is. Sorry, i forgot to specify the game
ShadowMarioBR 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 12:27.


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