Raised This Month: $ Target: $400
 0% 

Only Headshot Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Monkis
Member
Join Date: Nov 2007
Location: Lithuania
Old 12-08-2007 , 06:37   Only Headshot Mod
Reply With Quote #1

Where i can find only Hs mode except aim_practice, becose is bad working?
Monkis is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-08-2007 , 06:52   Re: Only Headshot Mod
Reply With Quote #2

Here
Code:
#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "Only Hs"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
#define HITGROUP_HEAD (1 << 1)
 
new pcvar;
 
public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_forward(FM_TraceLine, "Fwd_TraceLine");
 
 pcvar = register_cvar("amx_onlyhs", "0");
}
 
public Fwd_TraceLine(Float:StartPos[3],Float:EndPos[3], SkipMonsters, id, Trace)
{
 if(!is_user_connected(id) || !is_user_alive(id))
  return FMRES_IGNORED;
 
 if(!get_pcvar_num(pcvar))
  return FMRES_IGNORED;
 
 new Hited = get_tr2(Trace, TR_pHit);
 new HitGroup = (1 << get_tr2(Trace, TR_iHitgroup));
 
 if(!is_user_alive(Hited))
  return FMRES_IGNORED;
 
 if(!(HitGroup & HITGROUP_HEAD))
 {
  set_tr2(Trace, TR_flFraction, 1.0);
  return FMRES_SUPERCEDE;
 }
 return FMRES_IGNORED;
}
Cvar:
amx_onlyhs 1/0
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-08-2007 , 07:21   Re: Only Headshot Mod
Reply With Quote #3

I use this one (should be more efficient than Alka's):

amx_hs_mode 0|1


@Alka
I think you have to "post register" the forward.
Attached Files
File Type: txt hs_only.txt (134 Bytes, 2695 views)
File Type: sma Get Plugin or Get Source (hs_mode.sma - 5596 views - 2.7 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-08-2007 at 12:35.
ConnorMcLeod is offline
Monkis
Member
Join Date: Nov 2007
Location: Lithuania
Old 12-08-2007 , 07:24   Re: Only Headshot Mod
Reply With Quote #4

connorr : Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.76-300 Compiler.Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team/home/groups/alliedmodders/forums/files/1/8/9/4/6/21995.attach(54) : error 017: undefined symbol "charsmax"1 Error.Could not locate output file /home/groups/amxmodx/public_html/compiled3/21995.amx (compile failed
Monkis is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-08-2007 , 07:25   Re: Only Headshot Mod
Reply With Quote #5

Fixed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-08-2007 , 07:56   Re: Only Headshot Mod
Reply With Quote #6

lol, just because you have ML and a concmd instead of a cvar, is more efficient ?! HA HA HA =) please...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-08-2007 , 08:29   Re: Only Headshot Mod
Reply With Quote #7

Nope, because forward is not registered when mode is inactive.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Monkis
Member
Join Date: Nov 2007
Location: Lithuania
Old 12-08-2007 , 11:13   Re: Only Headshot Mod
Reply With Quote #8

connor can you do that [HS Only] Only head shots can hit players !! message dont show every round becose im using csdm mod
Monkis is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-08-2007 , 12:35   Re: Only Headshot Mod
Reply With Quote #9

Quote:
Originally Posted by Monkis View Post
becose im using csdm mod
lol, i see...
Updated, set amx_hs_display 0
__________________
- 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 16:31.


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