Raised This Month: $ Target: $400
 0% 

Head Shot Only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-11-2009 , 23:34   Head Shot Only
Reply With Quote #1

To get head shots only could i do something like the following.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
 
new ison
public plugin_init() {
 
register_plugin("Head Shot Only""1.0""NcB_Sav")
 
ison register_cvar("hs_on""1")
 
RegisterHam(Ham_TraceAttack"player""ham_traceattack_player")
 
}

public 
ham_traceattack_player(iVictimiAttackerFloat:damageFloat:direction[3], traceresultdamagebits)
{
    if(
get_tr2(traceresultTR_iHitgroup) != HIT_HEAD || get_pcvar_num(ison))
    {
        
//set_tr2(traceresult, TR_iHitgroup, HIT_CHEST)
        
return HAM_HANDLED
    
}
    return 
HAM_IGNORED


Last edited by Doc-Holiday; 01-11-2009 at 23:46.
Doc-Holiday is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 01-12-2009 , 00:12   Re: Head Shot Only
Reply With Quote #2

There are other ways without the hamsandwich module.
BOYSplayCS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2009 , 00:19   Re: Head Shot Only
Reply With Quote #3

return HAM_SUPERCEDE
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2009 , 00:32   Re: Head Shot Only
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
return HAM_SUPERCEDE
Thank you was looking for that

One last question. I have friendly fire on my server. so with ff on if i shoot my team mate will it ignore a body shot and only accept a head shot.
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2009 , 00:33   Re: Head Shot Only
Reply With Quote #5

try
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2009 , 00:43   Re: Head Shot Only
Reply With Quote #6

Ok so its not allowing me to shoot at all. no damage to the person at all
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2009 , 01:19   Re: Head Shot Only
Reply With Quote #7

if(get_tr2(traceresult, TR_iHitgroup) != HIT_HEAD || get_pcvar_num(ison))

Your statement is wrong.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 01-12-2009, 01:28
Doc-Holiday
This message has been deleted by Doc-Holiday.
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2009 , 04:06   Re: Head Shot Only
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
if(get_tr2(traceresult, TR_iHitgroup) != HIT_HEAD || get_pcvar_num(ison))

Your statement is wrong.
How should it be then
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2009 , 06:24   Re: Head Shot Only
Reply With Quote #10

it's logic
__________________
- 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 01:45.


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