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

Headshot from any position(hitbox)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EroaRe
Junior Member
Join Date: Mar 2009
Old 07-09-2010 , 04:00   Headshot from any position(hitbox)
Reply With Quote #1

deleted.

Last edited by EroaRe; 02-11-2013 at 03:12.
EroaRe is offline
Old 07-09-2010, 05:08
unnyquee
This message has been deleted by unnyquee. Reason: w/e
EroaRe
Junior Member
Join Date: Mar 2009
Old 07-09-2010 , 08:04   Re: Headshot from any position(hitbox)
Reply With Quote #2

deleted

Last edited by EroaRe; 02-11-2013 at 03:12.
EroaRe is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 07-09-2010 , 09:44   Re: Headshot from any position(hitbox)
Reply With Quote #3

* Note: not tested! I'll wait for your feedback!

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >

#pragma semicolon 1

#define is_player(%1)       ( 1 <= %1 <= g_iMaxPlayers )

#define CMD_ACCESS ADMIN_KICK

new g_cStatus;
new 
g_iMaxPlayers;

new 
bool:g_bHSOnly33 ] = false;


public 
plugin_init( )
{
      
register_plugin"Redirect damage to the head""1.00""unny;" );
      
      
g_cStatus register_cvar"rd_status""1" );
      
      
RegisterHamHam_TraceAttack"player""Fwd_Ham_TraceAttack_Pre");
      
      
register_clcmd"amx_hsonly""ClientCommand_HsOnly"CMD_ACCESS"< part of nickname > < 0 / 1 > - disable / enable redirecting damage to the head" );
      
      
g_iMaxPlayers get_maxplayers( );
}

public 
client_authorizediClient )
      
g_bHSOnlyiClient ] = false;

public 
client_disconnectiClient )
      
g_bHSOnlyiClient ] = false;

public 
Fwd_Ham_TraceAttack_PreiVictimiAttackerFloat:flDamageFloat:flDirection], hTraceiDamageBits )
{
      if( !
get_pcvar_numg_cStatus ) || !is_playeriAttacker ) || ( get_user_weaponiAttacker ) != CSW_KNIFE ) )
            return 
HAM_IGNORED;
      
      if( 
g_bHSOnlyiAttacker ] )
      {
            
set_tr2hTraceTR_iHitgroupHIT_HEAD );
      
            return 
HAM_HANDLED;
      }
      
      return 
HAM_IGNORED;
}

public 
ClientCommand_HsOnlyiClientiLeveliCid )
{
      if( !
get_pcvar_numg_cStatus ) )
            return 
PLUGIN_HANDLED;
      
      new 
szTarget32 ], szState], szTargetNickname32 ];
      new 
iTarget;
      
      
read_argv1szTargetcharsmaxszTarget ) );
      
read_argv2szStatecharsmaxszState ) );
           
      
iTarget cmd_targetiClientszTarget);
      
      if( !
iTarget )
            return 
PLUGIN_HANDLED;
      
      
get_user_nameiTargetszTargetNicknamecharsmaxszTargetNickname ) );
      
      if( 
szState] == '1' )
      {
            
console_printiClient"HSOnly enabled on: %s"szTargetNickname );
      
            
g_bHSOnlyiTarget ] = true;
      }

      else
      {
            
console_printiClient"HSOnly disabled on: %s"szTargetNickname );
      
            
g_bHSOnlyiTarget ] = false;
      }
      
      return 
PLUGIN_HANDLED;

__________________

Last edited by unnyquee; 07-09-2010 at 15:52.
unnyquee is offline
EroaRe
Junior Member
Join Date: Mar 2009
Old 07-09-2010 , 11:35   Re: Headshot from any position(hitbox)
Reply With Quote #4

deleted

Last edited by EroaRe; 02-11-2013 at 03:13.
EroaRe is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 07-09-2010 , 12:23   Re: Headshot from any position(hitbox)
Reply With Quote #5

Test it now.
I've updated the code.
__________________
unnyquee is offline
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 07-09-2010 , 13:03   Re: Headshot from any position(hitbox)
Reply With Quote #6

Ohhh, this looks nice, does it work?

Im confused about your posts.

The first seems to work.

And the second isnt... tested?
__________________




Quote:
Originally Posted by wrecked_ View Post
Stop saying words before I sodomize you with a cucumber.
kanatzu is offline
Send a message via MSN to kanatzu
EroaRe
Junior Member
Join Date: Mar 2009
Old 07-09-2010 , 13:23   Re: Headshot from any position(hitbox)
Reply With Quote #7

I tested the last version and .....it seems to activate/deactivate OK , but i tested it with another admin on my server and , when i do

amx_hsonly Bamba 1 , the response is HSOnly enabled on: Bamba

BUT it's kind of strange.....it enables for the other admin too , so when i deactivate on me , it deactivates on him too, so the amx_hsonly 1/0 works like rd_status 1/0
EroaRe is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-09-2010 , 15:48   Re: Headshot from any position(hitbox)
Reply With Quote #8

Replace :

if( g_bHSOnly[ iVictim ] )

with

if( g_bHSOnly[ iAttacker ] )


Also, should be reset when a player join the serveR.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 07-09-2010 , 15:50   Re: Headshot from any position(hitbox)
Reply With Quote #9

Yup. Connor is right.
I thought that you want for a player to hit only HS, not to receive only HS ^^.
Code updated.
__________________
unnyquee is offline
EroaRe
Junior Member
Join Date: Mar 2009
Old 07-10-2010 , 09:50   Re: Headshot from any position(hitbox)
Reply With Quote #10

The final version works fine , activates/deactivates only on the one you use the command on , so it's great

Thanks a lot unnyquee & Connor for the help
EroaRe 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:46.


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