Raised This Month: $ Target: $400
 0% 

Head Shot Only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-12-2009 , 06:41   Re: Head Shot Only
Reply With Quote #1

Quote:
Originally Posted by ConnorMcLeod View Post
try
Quote:
Originally Posted by ConnorMcLeod View Post
it's logic
Pretty short answers

And back to the plugin:
Code:
if(get_tr2(traceresult, TR_iHitgroup) != HIT_HEAD || get_pcvar_num(ison))
So, what that means?
if(the guy didn't hit to head OR the cvar is 1)
SnoW is offline
Send a message via MSN to SnoW
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2009 , 12:16   Re: Head Shot Only
Reply With Quote #2

right so even if i changed it to
if(get_tr2(traceresult, TR_iHitgrou) != HIT_HEAD)
{
ham_SUPERCEDE
}

would block shots that are not head shots
but it just blocks all shots.
regaurdless of the || cvar or && cvar.
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-12-2009 , 12:22   Re: Head Shot Only
Reply With Quote #3

Can you seriously not understand the logic?

You want headshots to be the only hitbox, and only work like that when the cvar is on.
So if the shot is not a headshot and the cvar is on, block the shot.

|| means or
&& means and

Good luck.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2009 , 13:10   Re: Head Shot Only
Reply With Quote #4

So basically having it say || was blocking shots because not only was it not a hs. that cvar was on so it blcoks all shots?
Doc-Holiday is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-12-2009 , 13:21   Re: Head Shot Only
Reply With Quote #5

Quote:
Originally Posted by NcB_Sav View Post
So basically having it say || was blocking shots because not only was it not a hs. that cvar was on so it blcoks all shots?
I have no idea what are you saying. I should say Exolent's logic words but I leave them for now, here:
1. If cvar is not on(plugin is not on) -> we don't want to block any shots.
2. Only if the shot isn't head -> we want to block it.
So the cvar must be on and the shot can't be head, where do we get? :::
Code:
if(get_tr2(traceresult, TR_iHitgroup) != HIT_HEAD && get_pcvar_num(ison))
SnoW is offline
Send a message via MSN to SnoW
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2009 , 13:31   Re: Head Shot Only
Reply With Quote #6

Thats what i was saying with that. Saying since its or that when the cvar is on it blocks all shots
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new g_maxplayersison
public plugin_init()
{
    
register_plugin("No Headshot""1.0""NcB_Sav")
    
RegisterHam(Ham_TraceAttack"player""ham_traceattack_player")
    
ison register_cvar("hs_only""1")
    
g_maxplayers get_maxplayers()
}
public 
ham_traceattack_player(iVictimiAttackerFloat:damageFloat:direction[3], traceresultdamagebits)
{
    if(
get_tr2(traceresultTR_iHitgroup) != HIT_HEAD && get_pcvar_num(ison))
    {
        return 
HAM_SUPERCEDE //Should block body shots
    
}
    return 
HAM_IGNORED

But it dosent block anything.
Doc-Holiday 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