Raised This Month: $ Target: $400
 0% 

Team flash enable/disable by command.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
killergirl
Senior Member
Join Date: Jul 2010
Old 10-09-2010 , 05:45   Team flash enable/disable by command.
Reply With Quote #1

I've checked all anti team flash plugins and the best and works all the time is:
https://forums.alliedmods.net/showthread.php?t=70735 (antiflashbug) by MPNumB.

Can anyone make a command for players to enable/disable, beacause not anybody wants to play with "anti team flash".

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

#define PLUGIN_NAME "Anti Flashbang Bug"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Numb"

new Float:old_gametime;
new 
mp_friendlyfire;
new 
owner;

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
    
RegisterHam(Ham_Think"grenade""Ham_FEThink_grenade"0);
    
    
register_forward(FM_FindEntityInSphere"fm_FEFindEntityInSphere"0);
    
    
mp_friendlyfire get_cvar_pointer("mp_friendlyfire");
}

public 
Ham_FEThink_grenade(ent)
{
    static 
model[32];
    
pev(entpev_modelmodel31);
    if( 
equal(model"models/w_flashbang.mdl") )
    {
        if( (
owner=pev(entpev_owner))<)
            
owner 0;
        
        
old_gametime get_gametime();
    }
    else
    {
        
owner 0;
        
old_gametime 0.0;
    }
}

public 
fm_FEFindEntityInSphere(startFloat:origin[3], Float:radius)
{
    if( 
radius!=1500.0 || old_gametime!=get_gametime() )
        return 
FMRES_IGNORED;
    
    static 
hittraceFloat:user_origin[3], Float:absmax[3], Float:fractionffowner_team;
    
hit start;
    
ff clamp(get_pcvar_num(mp_friendlyfire), 01);
    if( 
owner )
        
owner_team get_user_team(owner);
    else
        
owner_team = -1;
    
    
// run the same check to see what its result will be
    
while( (hit=engfunc(EngFunc_FindEntityInSpherehitoriginradius))>)
    {
        
// hit a non- or dead-player
        
if( !is_user_alive(hit) )
        {
            
forward_return(FMV_CELLhit);
            return 
FMRES_SUPERCEDE;
        }
        
        
// aim for the body eyes
        
pev(hitpev_originuser_origin);
        
pev(hitpev_absmaxabsmax);
        
user_origin[2] = (absmax[2]-20.0);
        
engfunc(EngFunc_TraceLineoriginuser_originDONT_IGNORE_MONSTERS0trace);
        
        
// hit player eyes, grenade ok
        
if( get_tr2(traceTR_pHit)==hit )
        {
            
// start backup check (de_dust2 B bug - outmap bug)
            
engfunc(EngFunc_TraceLineuser_originoriginDONT_IGNORE_MONSTERShittrace);
            
            
// hit player eyes with backup check
            
get_tr2(traceTR_flFractionfraction);
            if( 
fraction==1.0 )
            {
                if( 
ff || owner==hit || owner_team!=get_user_team(hit) )
                {
                    
forward_return(FMV_CELLhit);
                    return 
FMRES_SUPERCEDE;
                }
            }
        }
    }
    
    
// grenade could not hit anyones eyes, cancel the check
    
forward_return(FMV_CELL, -1);
    return 
FMRES_SUPERCEDE;

killergirl is offline
 


Thread Tools
Display Modes

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 10:23.


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