Raised This Month: $ Target: $400
 0% 

What can I add to script to ignore the m3


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
smgcz
Member
Join Date: Nov 2008
Old 04-15-2009 , 15:07   Re: What can I add to script to ignore the m3
Reply With Quote #7

so is this what it would look like with bitsum if I want the plugin to ignore the m3, awp, and scout?

PHP Code:
/*    AMX Mod X script.
    
    No Headshot With Helmet plugin

    (c) Copyright 2007, Simon Logic '[email protected]'
    This file is provided AS IS (no warranties).

    Info:
        When player has a helmet he can't be killed by headshot.

    Requirements:
        * CS/CZ mod
        * AMX/X 1.7x or higher
        * CStrike module
        * Fakemeta module

    New cvars:
        * amx_superhelmet_when_armor <num> (default=0)
            set armor threshold when helmet acts as shield

    Credits:
        * Cheap_Suit for 'hitgroup 8' idea

    Changelog:
    v1.1.0 [2007-06-22]
    + added cvar 'amx_superhelmet_when_armor'
    + kevlar can act as shield (req. by Stixsmaster)
    * optimized core as XxAvalanchexX suggested (experimental)
    v1.0.0 [2007-06-14]
    * first public release
*/

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define MY_PLUGIN_NAME    "No Headshot With Helmet"
#define MY_PLUGIN_VERSION "1.2.0"
#define MY_PLUGIN_AUTHOR  "Simon Logic"

#define HIT_SHIELD 8

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

new g_iMaxPlayers
new g_cvarSHelmetThreshold

public plugin_init()
{
    
g_iMaxPlayers get_maxplayers()

    
register_plugin(MY_PLUGIN_NAMEMY_PLUGIN_VERSIONMY_PLUGIN_AUTHOR)
    
register_cvar("version_no_headshot_with_helmet"MY_PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY)

    
g_cvarSHelmetThreshold register_cvar("amx_superhelmet_when_armor""1")

    
RegisterHam(Ham_TraceAttack"player""Player_TraceAttack")
}

public 
Player_TraceAttack(idiAttackerFloat:flDamageFloat:vecDir[3], ptriDamageType)
{
    const 
WEAPONS_BITSUM = (1<<CSW_M3)|(1CSW_AWP)|(1CSW_SCOUT)
    if( 
WEAPONS_BITSUM & (1<<iWeapon) )
    if( 
IsPlayer(iAttacker) &&  WEAPONS_BS & (1<<get_user_weapon(iAttacker)) )
    {
        new 
CsArmorType:tArmoriArmor cs_get_user_armor(idtArmor)
        if(
iArmor && tArmor == CS_ARMOR_VESTHELM    && get_tr2(ptrTR_iHitgroup) == HIT_HEAD)
        {
            
set_tr2(ptrTR_iHitgroupget_pcvar_num(g_cvarSHelmetThreshold) ? HIT_SHIELD HIT_GENERIC)
            return 
HAM_HANDLED
        
}
    }
    return 
HAM_IGNORED

smgcz is offline
 



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 02:26.


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