[Modificare plugin] no_team_flash (bug fixed) [Rezolvat]

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
UnFoRgIvEnNn
Membru, skill +1
Membru, skill +1
Posts: 148
Joined: 08 Apr 2014, 16:06
Detinator Steam: Da
Detinator server CS: Da
Location: Targu-Jiu
Contact:

16 Oct 2019, 18:01

Salut,
Cu siguranta am cautat deja alte plugin-uri no_team_flash, insa doar acesta functioneaza corect pentru ceea ce am nevoie. De aceea rog o simpla modificare a acestuia deoarece eu nu am reusit.
Doresc sa se faca o modificare astfel incat sa iti iei propriul flash deoarece asa cum este acum, nu iei!
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#pragma tabsize 0
	new const VERSION[] = "1.1.1"
	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)
	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 Float:g_flCurrentGameTime, g_iCurrentFlasher, g_iCurrentFlashBang
	new mp_friendlyfire
	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")
	    mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")
	    g_iMaxPlayers = get_maxplayers()
}
	public Ham__CGrenade_Think__Pre( iEnt )
{
    static Float:flGameTime, Float:flDmgTime, iOwner
    flGameTime = get_gametime()
    pev(iEnt, pev_dmgtime, flDmgTime)
    if(    flDmgTime <= flGameTime
    &&    get_pdata_int(iEnt, 114) == 0 // has a bit when is HE or SMOKE
    &&    !(get_pdata_int(iEnt, 96) & (1<<8)) // has this bit when is c4
    &&    IsPlayer( (iOwner = pev(iEnt, pev_owner)) )    ) // if no owner grenade gonna be removed from world
    {
        if( ~WillGrenadeExplode(iEnt) ) // grenade gonna explode on next think
        {
            SetGrenadeExplode( iEnt )
        }
        else
        {
            ClearGrenadeExplode( iEnt )
            g_flCurrentGameTime = flGameTime
            g_iCurrentFlasher = iOwner
            g_iCurrentFlashBang = iEnt
        }
    }
}
	public Fm__FindEntityInSphere__Pre(iStartEnt, Float:fVecOrigin[3], Float:flRadius)
{
    const Float:FLASHBANG_SEARCH_RADIUS = 1500.0
    if(    flRadius == FLASHBANG_SEARCH_RADIUS
    &&    get_gametime() == g_flCurrentGameTime    )
    {
        new id = iStartEnt, Float:fVecPlayerEyeOrigin[3], Float:flFraction, friendlyfire = get_pcvar_num(mp_friendlyfire)
	        while( IsPlayer( (id=engfunc(EngFunc_FindEntityInSphere, id, fVecOrigin, flRadius)) ) )
        {
            if( is_user_alive(id) )
            {
                pev(id, pev_origin, fVecPlayerEyeOrigin)
                fVecPlayerEyeOrigin[2] += ((pev(id, pev_flags) & FL_DUCKING) ? 12.0 : 18.0)
	                engfunc(EngFunc_TraceLine, fVecOrigin, fVecPlayerEyeOrigin, DONT_IGNORE_MONSTERS, g_iCurrentFlashBang, 0)
	                get_tr2(0, TR_flFraction, flFraction)
	                if( flFraction < 1.0 && get_tr2(0, TR_pHit) == id )
                {
                    engfunc(EngFunc_TraceLine, fVecPlayerEyeOrigin, fVecOrigin, DONT_IGNORE_MONSTERS, id, 0)
                    get_tr2(0, TR_flFraction, flFraction)
                    if(    flFraction == 1.0
                    &&    (    friendlyfire
                //        ||    id == g_iCurrentFlasher
                        ||    cs_get_user_team_index(id) != cs_get_user_team_index(g_iCurrentFlasher)    ) )
                    {
                        forward_return(FMV_CELL, id)
                        return FMRES_SUPERCEDE
                    }
                }
            }
        }
        forward_return(FMV_CELL, 0)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
} 
Multumesc!
Sunt om cu tine, fii om cu mine !
Zonek
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2955
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 454 times
Contact:

16 Oct 2019, 19:23

| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#pragma tabsize 0
	new const VERSION[] = "1.1.1"
	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)
	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 Float:g_flCurrentGameTime, g_iCurrentFlasher, g_iCurrentFlashBang
	new mp_friendlyfire
	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")
	    mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")
	    g_iMaxPlayers = get_maxplayers()
}
	public Ham__CGrenade_Think__Pre( iEnt )
{
    static Float:flGameTime, Float:flDmgTime, iOwner
    flGameTime = get_gametime()
    pev(iEnt, pev_dmgtime, flDmgTime)
    if(    flDmgTime <= flGameTime
    &&    get_pdata_int(iEnt, 114) == 0 // has a bit when is HE or SMOKE
    &&    !(get_pdata_int(iEnt, 96) & (1<<8)) // has this bit when is c4
    &&    IsPlayer( (iOwner = pev(iEnt, pev_owner)) )    ) // if no owner grenade gonna be removed from world
    {
        if( ~WillGrenadeExplode(iEnt) ) // grenade gonna explode on next think
        {
            SetGrenadeExplode( iEnt )
        }
        else
        {
            ClearGrenadeExplode( iEnt )
            g_flCurrentGameTime = flGameTime
            g_iCurrentFlasher = iOwner
            g_iCurrentFlashBang = iEnt
        }
    }
}
	public Fm__FindEntityInSphere__Pre(iStartEnt, Float:fVecOrigin[3], Float:flRadius)
{
    const Float:FLASHBANG_SEARCH_RADIUS = 1500.0
    if(    flRadius == FLASHBANG_SEARCH_RADIUS
    &&    get_gametime() == g_flCurrentGameTime    )
    {
        new id = iStartEnt, Float:fVecPlayerEyeOrigin[3], Float:flFraction, friendlyfire = get_pcvar_num(mp_friendlyfire)
	        while( IsPlayer( (id=engfunc(EngFunc_FindEntityInSphere, id, fVecOrigin, flRadius)) ) )
        {
            if( is_user_alive(id) )
            {
                pev(id, pev_origin, fVecPlayerEyeOrigin)
                fVecPlayerEyeOrigin[2] += ((pev(id, pev_flags) & FL_DUCKING) ? 12.0 : 18.0)
	                engfunc(EngFunc_TraceLine, fVecOrigin, fVecPlayerEyeOrigin, DONT_IGNORE_MONSTERS, g_iCurrentFlashBang, 0)
	                get_tr2(0, TR_flFraction, flFraction)
	                if( flFraction < 1.0 && get_tr2(0, TR_pHit) == id )
                {
                    engfunc(EngFunc_TraceLine, fVecPlayerEyeOrigin, fVecOrigin, DONT_IGNORE_MONSTERS, id, 0)
                    get_tr2(0, TR_flFraction, flFraction)
                    if(    flFraction == 1.0
                    &&    (    friendlyfire
                        ||    id == g_iCurrentFlasher
                        ||    cs_get_user_team_index(id) != cs_get_user_team_index(g_iCurrentFlasher)    ) )
                    {
                        forward_return(FMV_CELL, id)
                        return FMRES_SUPERCEDE
                    }
                }
            }
        }
        forward_return(FMV_CELL, 0)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz!
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine.
HOST CS1.6
User avatar
UnFoRgIvEnNn
Membru, skill +1
Membru, skill +1
Posts: 148
Joined: 08 Apr 2014, 16:06
Detinator Steam: Da
Detinator server CS: Da
Location: Targu-Jiu
Contact:

17 Oct 2019, 20:03

L E V I N wrote:
16 Oct 2019, 19:23
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#pragma tabsize 0
	new const VERSION[] = "1.1.1"
	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)
	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 Float:g_flCurrentGameTime, g_iCurrentFlasher, g_iCurrentFlashBang
	new mp_friendlyfire
	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")
	    mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")
	    g_iMaxPlayers = get_maxplayers()
}
	public Ham__CGrenade_Think__Pre( iEnt )
{
    static Float:flGameTime, Float:flDmgTime, iOwner
    flGameTime = get_gametime()
    pev(iEnt, pev_dmgtime, flDmgTime)
    if(    flDmgTime <= flGameTime
    &&    get_pdata_int(iEnt, 114) == 0 // has a bit when is HE or SMOKE
    &&    !(get_pdata_int(iEnt, 96) & (1<<8)) // has this bit when is c4
    &&    IsPlayer( (iOwner = pev(iEnt, pev_owner)) )    ) // if no owner grenade gonna be removed from world
    {
        if( ~WillGrenadeExplode(iEnt) ) // grenade gonna explode on next think
        {
            SetGrenadeExplode( iEnt )
        }
        else
        {
            ClearGrenadeExplode( iEnt )
            g_flCurrentGameTime = flGameTime
            g_iCurrentFlasher = iOwner
            g_iCurrentFlashBang = iEnt
        }
    }
}
	public Fm__FindEntityInSphere__Pre(iStartEnt, Float:fVecOrigin[3], Float:flRadius)
{
    const Float:FLASHBANG_SEARCH_RADIUS = 1500.0
    if(    flRadius == FLASHBANG_SEARCH_RADIUS
    &&    get_gametime() == g_flCurrentGameTime    )
    {
        new id = iStartEnt, Float:fVecPlayerEyeOrigin[3], Float:flFraction, friendlyfire = get_pcvar_num(mp_friendlyfire)
	        while( IsPlayer( (id=engfunc(EngFunc_FindEntityInSphere, id, fVecOrigin, flRadius)) ) )
        {
            if( is_user_alive(id) )
            {
                pev(id, pev_origin, fVecPlayerEyeOrigin)
                fVecPlayerEyeOrigin[2] += ((pev(id, pev_flags) & FL_DUCKING) ? 12.0 : 18.0)
	                engfunc(EngFunc_TraceLine, fVecOrigin, fVecPlayerEyeOrigin, DONT_IGNORE_MONSTERS, g_iCurrentFlashBang, 0)
	                get_tr2(0, TR_flFraction, flFraction)
	                if( flFraction < 1.0 && get_tr2(0, TR_pHit) == id )
                {
                    engfunc(EngFunc_TraceLine, fVecPlayerEyeOrigin, fVecOrigin, DONT_IGNORE_MONSTERS, id, 0)
                    get_tr2(0, TR_flFraction, flFraction)
                    if(    flFraction == 1.0
                    &&    (    friendlyfire
                        ||    id == g_iCurrentFlasher
                        ||    cs_get_user_team_index(id) != cs_get_user_team_index(g_iCurrentFlasher)    ) )
                    {
                        forward_return(FMV_CELL, id)
                        return FMRES_SUPERCEDE
                    }
                }
            }
        }
        forward_return(FMV_CELL, 0)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}
Functioneaza asa cum am cerut. Multumesc mult, se poate da TC!
Sunt om cu tine, fii om cu mine !
User avatar
WHOAMI?
Super moderator
Super moderator
Posts: 828
Joined: 17 Dec 2013, 19:51
Detinator Steam: Da
Detinator server CS: SURF.USP.RO
Reputatie: Super Moderator
Fost Membru Club eXtreamCS (o luna)
Location: New Orleans
Has thanked: 10 times
Been thanked: 5 times

26 Oct 2019, 17:54

UnFoRgIvEnNn wrote:
17 Oct 2019, 20:03
L E V I N wrote:
16 Oct 2019, 19:23
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#pragma tabsize 0
	new const VERSION[] = "1.1.1"
	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)
	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 Float:g_flCurrentGameTime, g_iCurrentFlasher, g_iCurrentFlashBang
	new mp_friendlyfire
	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")
	    mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")
	    g_iMaxPlayers = get_maxplayers()
}
	public Ham__CGrenade_Think__Pre( iEnt )
{
    static Float:flGameTime, Float:flDmgTime, iOwner
    flGameTime = get_gametime()
    pev(iEnt, pev_dmgtime, flDmgTime)
    if(    flDmgTime <= flGameTime
    &&    get_pdata_int(iEnt, 114) == 0 // has a bit when is HE or SMOKE
    &&    !(get_pdata_int(iEnt, 96) & (1<<8)) // has this bit when is c4
    &&    IsPlayer( (iOwner = pev(iEnt, pev_owner)) )    ) // if no owner grenade gonna be removed from world
    {
        if( ~WillGrenadeExplode(iEnt) ) // grenade gonna explode on next think
        {
            SetGrenadeExplode( iEnt )
        }
        else
        {
            ClearGrenadeExplode( iEnt )
            g_flCurrentGameTime = flGameTime
            g_iCurrentFlasher = iOwner
            g_iCurrentFlashBang = iEnt
        }
    }
}
	public Fm__FindEntityInSphere__Pre(iStartEnt, Float:fVecOrigin[3], Float:flRadius)
{
    const Float:FLASHBANG_SEARCH_RADIUS = 1500.0
    if(    flRadius == FLASHBANG_SEARCH_RADIUS
    &&    get_gametime() == g_flCurrentGameTime    )
    {
        new id = iStartEnt, Float:fVecPlayerEyeOrigin[3], Float:flFraction, friendlyfire = get_pcvar_num(mp_friendlyfire)
	        while( IsPlayer( (id=engfunc(EngFunc_FindEntityInSphere, id, fVecOrigin, flRadius)) ) )
        {
            if( is_user_alive(id) )
            {
                pev(id, pev_origin, fVecPlayerEyeOrigin)
                fVecPlayerEyeOrigin[2] += ((pev(id, pev_flags) & FL_DUCKING) ? 12.0 : 18.0)
	                engfunc(EngFunc_TraceLine, fVecOrigin, fVecPlayerEyeOrigin, DONT_IGNORE_MONSTERS, g_iCurrentFlashBang, 0)
	                get_tr2(0, TR_flFraction, flFraction)
	                if( flFraction < 1.0 && get_tr2(0, TR_pHit) == id )
                {
                    engfunc(EngFunc_TraceLine, fVecPlayerEyeOrigin, fVecOrigin, DONT_IGNORE_MONSTERS, id, 0)
                    get_tr2(0, TR_flFraction, flFraction)
                    if(    flFraction == 1.0
                    &&    (    friendlyfire
                        ||    id == g_iCurrentFlasher
                        ||    cs_get_user_team_index(id) != cs_get_user_team_index(g_iCurrentFlasher)    ) )
                    {
                        forward_return(FMV_CELL, id)
                        return FMRES_SUPERCEDE
                    }
                }
            }
        }
        forward_return(FMV_CELL, 0)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}
Functioneaza asa cum am cerut. Multumesc mult, se poate da TC!
Marcat ca Rezolvat
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests