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

Anti Team Flash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 12-29-2016 , 04:39   Anti Team Flash
Reply With Quote #1

Hello,

I had searched many plugins in this regard, which should stop team flash, but none works fine, so, anyone there out to please help and make simple Anti Team Flash Plugin?
Alber9091 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 12-29-2016 , 06:25   Re: Anti Team Flash
Reply With Quote #2

Search again because there's one written by ConnorMcLeod that works. It's in the request forum.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
JOMENVEST
Member
Join Date: Dec 2016
Location: Sweden
Old 12-29-2016 , 06:37   Re: Anti Team Flash
Reply With Quote #3

This? https://forums.alliedmods.net/showthread.php?t=274226
__________________
JOMENVEST is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-29-2016 , 07:10   Re: Anti Team Flash
Reply With Quote #4

Quote:
Originally Posted by JOMENVEST View Post
How can you not see that that is for CS:GO? Literally every second word in there is "csgo".
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 12-29-2016 , 09:33   Re: Anti Team Flash
Reply With Quote #5

Quote:
Originally Posted by wickedd View Post
Search again because there's one written by ConnorMcLeod that works. It's in the request forum.
I got it, Thanks Wickedd

Well, I haven't checked it yet but here is the link, if anyone needs it in future ..!!

https://forums.alliedmods.net/showpo...1&postcount=11

And if you want Team Flash Bang to follow ff, like in mix, uncomment the following line and recompile it ..!!
Quote:
// #define FOLLOW_FRIENDLYFIRE
To
Quote:
#define FOLLOW_FRIENDLYFIRE
Will also soon, let you know, how it works .!!

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

new const VERSION[] = "1.1.2"

// #define FOLLOW_FRIENDLYFIRE

const MAX_ENTSARRAYS_SIZE 64

new g_bitGonnaExplode[MAX_ENTSARRAYS_SIZE]
#define SetGrenadeExplode(%1)        g_bitGonnaExplode[%1>>5] |=  1<<(%1 & 31)
#define ClearGrenadeExplode(%1)    g_bitGonnaExplode[%1>>5] &= ~( 1 << (%1 & 31) )
#define WillGrenadeExplode(%1)    g_bitGonnaExplode[%1>>5] &   1<<(%1 & 31)

#if defined FOLLOW_FRIENDLYFIRE
    
const XTRA_OFS_PLAYER 5
    
const m_iTeam 114
    
#define cs_get_user_team_index(%1)    get_pdata_int(%1, m_iTeam, XTRA_OFS_PLAYER)
    
new mp_friendlyfire
    
new g_iCurrentFlasher
    
new g_iCurrentTeam
#endif

new Float:g_flCurrentGameTimeg_iCurrentFlashBang

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

public plugin_init()
{
    
register_plugin("Anti Flashbang Bug"VERSION"Numb / ConnorMcLeod")
    
    
RegisterHam(Ham_Think"grenade""Ham__CGrenade_Think__Pre")
    
    
register_forward(FM_FindEntityInSphere"Fm__FindEntityInSphere__Pre")

#if defined FOLLOW_FRIENDLYFIRE
    
mp_friendlyfire get_cvar_pointer("mp_friendlyfire")
#endif

    
g_iMaxPlayers get_maxplayers()
}

public 
Ham__CGrenade_Think__PreiEnt )
{
    static 
Float:flGameTimeFloat:flDmgTime

    flGameTime 
get_gametime()
    
pev(iEntpev_dmgtimeflDmgTime)

#if defined FOLLOW_FRIENDLYFIRE
    
static iOwner
    
if(    flDmgTime <= flGameTime
    
&&    get_pdata_int(iEnt114) == // has a bit when is HE or SMOKE
    
&&    !(get_pdata_int(iEnt96) & (1<<8)) // has this bit when is c4
    
&&    IsPlayer( (iOwner pev(iEntpev_owner)) )    ) // if no owner grenade gonna be removed from world
#else
    
if(    flDmgTime <= flGameTime
    
&&    get_pdata_int(iEnt114) == // has a bit when is HE or SMOKE
    
&&    !(get_pdata_int(iEnt96) & (1<<8)) // has this bit when is c4
    
&&    IsPlayerpev(iEntpev_owner) )    )
#endif
    
{
        if( ~
WillGrenadeExplode(iEnt) ) // grenade gonna explode on next think
        
{
            
SetGrenadeExplodeiEnt )
        }
        else
        {
            
ClearGrenadeExplodeiEnt )
            
g_flCurrentGameTime flGameTime
            g_iCurrentFlashBang 
iEnt

        
#if defined FOLLOW_FRIENDLYFIRE
            
g_iCurrentFlasher iOwner
            g_iCurrentTeam 
cs_get_user_team_index(iOwner)
        
#endif
        
}
    }
}

public 
Fm__FindEntityInSphere__Pre(iStartEntFloat:fVecOrigin[3], Float:flRadius)
{
    const 
Float:FLASHBANG_SEARCH_RADIUS 1500.0
    
if(    flRadius == FLASHBANG_SEARCH_RADIUS
    
&&    get_gametime() == g_flCurrentGameTime    )
    {
        new 
id iStartEntFloat:fVecPlayerEyeOrigin[3], Float:flFraction

        
while( IsPlayer( (id=engfunc(EngFunc_FindEntityInSphereidfVecOriginflRadius)) ) )
        {
            if( 
is_user_alive(id) )
            {
                
pev(idpev_originfVecPlayerEyeOrigin)
                
fVecPlayerEyeOrigin[2] += ((pev(idpev_flags) & FL_DUCKING) ? 12.0 18.0)

                
engfunc(EngFunc_TraceLinefVecOriginfVecPlayerEyeOriginDONT_IGNORE_MONSTERSg_iCurrentFlashBang0)

                
get_tr2(0TR_flFractionflFraction)

                if( 
flFraction 1.0 && get_tr2(0TR_pHit) == id )
                {
                    
engfunc(EngFunc_TraceLinefVecPlayerEyeOriginfVecOriginDONT_IGNORE_MONSTERSid0)
                    
get_tr2(0TR_flFractionflFraction)
                
#if defined FOLLOW_FRIENDLYFIRE
                    
if(    flFraction == 1.0
                    
&&    (    get_pcvar_num(mp_friendlyfire)
                        ||    
id == g_iCurrentFlasher
                        
||    cs_get_user_team_index(id) != g_iCurrentTeam    )    )
                
#else
                    
if( flFraction == 1.0 )
                
#endif
                    
{
                        
forward_return(FMV_CELLid)
                        return 
FMRES_SUPERCEDE
                    
}
                }
            }
        }
        
forward_return(FMV_CELL0)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED


Last edited by Alber9091; 12-29-2016 at 09:39.
Alber9091 is offline
JOMENVEST
Member
Join Date: Dec 2016
Location: Sweden
Old 12-29-2016 , 10:42   Re: Anti Team Flash
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
How can you not see that that is for CS:GO? Literally every second word in there is "csgo".
Oops, my bad he he he
__________________
JOMENVEST is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 12-29-2016 , 12:06   Re: Anti Team Flash
Reply With Quote #7

ConnorMcLeod's plugin that you found is a remake of that plugin:
https://forums.alliedmods.net/showthread.php?t=70735

It fixes a bug on flashbang. But as I read on that post, Valve already have fixed it. So isn't necessary to have it
https://forums.alliedmods.net/showpo...3&postcount=44

Now, that plugin is only useful for block teammates flashbangs. That was not the purpose of the plugin, so we have unnecessary code.

We need a plugin with the purpose of block flash by teammates.

Searching, I have found this plugin (I added g_iOwner)
Plugin works, but has a bug which it makes invisible to enemies. I don't know why, probably the problem is "get_msg_arg_int(7)" ?
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <engine> 
#include <fakemeta> 
#include <hamsandwich> 

#define VERSION "0.0.1" 

new CsTeams:g_iTeamFlashg_iOwner

public plugin_init() 

    
register_plugin("No Team Flash"VERSION"ConnorMcLeod"

    
register_message(get_user_msgid("ScreenFade"), "Message_ScreenFade"

    
RegisterHam(Ham_Think"grenade""Grenade_Think"


public 
Message_ScreenFade(iMsgIdMSG_DESTid

    if (    
get_msg_arg_int(4) != 255 || get_msg_arg_int(5) != 255 || get_msg_arg_int(6) != 255 || get_msg_arg_int(7) < 200    )
        return 
PLUGIN_CONTINUE
    
    
if (    !is_user_alive(id) || g_iOwner != id && cs_get_user_team(id) != g_iTeamFlash    
        return 
PLUGIN_CONTINUE
    
    
return PLUGIN_HANDLED 


public 
Grenade_ThinkiEnt 

    static 
Float:flGameTime 
    flGameTime 
get_gametime() 
    if(    
entity_get_float(iEntEV_FL_dmgtime) <= flGameTime 
    
&&    get_pdata_int(iEnt114) == 
    
&&    !(get_pdata_int(iEnt96) & (1<<8))    ) 
    { 
        static 
iCount 
        
if( ++iCount == 
        { 
            static 
iOwner iOwner entity_get_edict(iEntEV_ENT_owner
            if( 
is_user_connected(iOwner) ) 
            { 
                
g_iOwner iOwner 
                g_iTeamFlash 
cs_get_user_team(iOwner
            } 
            else 
            { 
                
g_iOwner 
                g_iTeamFlash 
CS_TEAM_UNASSIGNED 
            

        } 
        else 
        { 
            
g_iOwner 
            g_iTeamFlash 
CS_TEAM_UNASSIGNED 
            
if( iCount == 
            { 
                
iCount 
            

        } 
    } 


Last edited by baneado; 12-29-2016 at 12:19.
baneado 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 19:55.


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