Plugin team no flash
#1
Buenas noches !
Estoy buscando algun plugin que no permita flash entre teams..
Actualmente tenia este pero de un dia para el otro empezo a fallar.. cada vez que un compañero flashea a otro lo laguea..
Cabe destacar que no se modificó para nada el plugin..
El server cuenta con Reunion y ReGame
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <cstrike>

new pCvar_flash_teampCvar_flash_specpCvar_flash_random_colors;

new 
CsTeams:g_TeamFlash

new g_iOwner

public 
plugin_init() {
    
register_plugin("No Team Flash""v1.0""Gonza.-*");
    
    
register_cvar("HidenSeek""1");
    
    
pCvar_flash_team                register_cvar("bg_flash_team""0")
    
pCvar_flash_spec                register_cvar("bg_flash_spec""0")
    
pCvar_flash_random_colors        register_cvar("bg_flash_random_colors""0")
    
    
RegisterHam(Ham_Think"grenade""Grenade_Think")
    
register_message(get_user_msgid("ScreenFade"), "messageScreenFade")
}

public 
messageScreenFade(msgiddestid)
{    
    if (
get_msg_arg_int(4) == 255 && get_msg_arg_int(5) == 255 && get_msg_arg_int(6) == 255 && g_iOwner != id)
    {
        if (!
get_pcvar_num(pCvar_flash_spec) && is_user_connected(id) && cs_get_user_team(id) == CS_TEAM_SPECTATOR) return PLUGIN_HANDLED
        
        
if (get_pcvar_num(pCvar_flash_team))
        {
            if (
get_pcvar_num(pCvar_flash_random_colors))
            {
                
set_msg_arg_int(4ARG_BYTErandom(255))
                
set_msg_arg_int(5ARG_BYTErandom(255))
                
set_msg_arg_int(6ARG_BYTErandom(255))
            }
            return 
PLUGIN_CONTINUE
        
}
        
        else if (!
get_pcvar_num(pCvar_flash_team) && is_user_connected(id) &&  cs_get_user_team(id) == g_TeamFlash) return PLUGIN_HANDLED
        
        
else if (get_pcvar_num(pCvar_flash_random_colors))
        {
            
set_msg_arg_int(4ARG_BYTErandom(255))
            
set_msg_arg_int(5ARG_BYTErandom(255))
            
set_msg_arg_int(6ARG_BYTErandom(255))
        }
    }
    
    return 
PLUGIN_CONTINUE
}

public 
Grenade_Think(ent)
{
    if (
get_pcvar_num(pCvar_flash_team)) return HAM_IGNORED
    
    
static Float:flGameTime
    flGameTime 
get_gametime()
    
    if (
entity_get_float(entEV_FL_dmgtime) <= flGameTime && get_pdata_int(ent114) == && !(get_pdata_int(ent96) & (1<<8)))
    {
        static 
iCount
        
if (++iCount == 2)
        {
            static 
iOwner iOwner entity_get_edict(entEV_ENT_owner)
            
            
g_iOwner iOwner;
            
            if (
is_user_connected(iOwner)) g_TeamFlash cs_get_user_team(iOwner)
            
            else 
g_TeamFlash CS_TEAM_UNASSIGNED
        
}
        
        else
        {
            
g_TeamFlash CS_TEAM_UNASSIGNED
            
            
if (iCount == 3iCount 0
        
}
    }
    return 
HAM_IGNORED

Responder
#2
Código PHP:
/* AMX Mod X Plugin

* (c) Copyright 2008, ConnorMcLeod 
* This file is provided as is (no warranties). 

*/ 

#include <amxmodx>
#include <fakemeta>

#define PEV_PDATA_SAFE    2

#define MAX_PLAYERS    32
#define OFFSET_TEAM    114

#define W_FLASH_MODEL_STRLEN        22
#define FLASH_XPLODE_SOUND_STRLEN    23

new g_iMaxClients
new bool:g_bHasJustBeenFlashed[MAX_PLAYERS+1]
new 
g_msgidScreenFade

public plugin_init()
{
    register_plugin("No Team Flash""1.0.0""ConnorMcLeod")

    register_event("ScreenFade""Event_ScreenFade""be""1>0""2>0""3=0","4=255""5=255""6=255""7=200""7=255")
    register_forward(FM_SetModel"Forward_SetModel")
    register_forward(FM_EmitSound"Forward_EmitSound")
}

public 
plugin_cfg()
{
    g_iMaxClients global_get(glb_maxClients)
    g_msgidScreenFade get_user_msgid("ScreenFade")
}
                            
public Forward_SetModel(iEntity, const szModel[])
{
    if(strlen(szModel) != W_FLASH_MODEL_STRLEN)
    {
        return FMRES_IGNORED
    
}

    if(szModel[7] != 'w' || szModel[9] != 'f' || szModel[14] != 'b')
    {
        return FMRES_IGNORED
    
}

    if(!pev_valid(iEntity))
    {
        return FMRES_IGNORED
    
}

    static Float:fVelocity[3]
    pev(iEntitypev_velocityfVelocity)
    if(!fVelocity[0] && !fVelocity[1] && !fVelocity[2])
    {
        return FMRES_IGNORED
    
}

    set_pev(iEntitypev_iuser4pev(iEntitypev_owner) )
    return FMRES_HANDLED
}
                            
public Forward_EmitSound(iEntityiChannel, const szSample[])
{
    if(szSample[0] != 'w' || szSample[8] != 'f' || szSample[9] != 'l')
    {
        return FMRES_IGNORED
    
}

    if(!pev_valid(iEntity))
    {
        return FMRES_IGNORED
    
}

    static iFlasher
    iFlasher 
pev(iEntitypev_iuser4)
    if( pev_valid(iFlasher) != PEV_PDATA_SAFE )
    {
        return FMRES_IGNORED
    
}
    static idiTeam
    iTeam 
get_pdata_int(iFlasherOFFSET_TEAM)

    for(id=1id<=g_iMaxClientsid++)
    {
        if(!g_bHasJustBeenFlashed[id])
        {
            continue
        }

        g_bHasJustBeenFlashed[id] = false

        
if( pev_valid(id) != PEV_PDATA_SAFE )
        {
            continue
        }

        if(id != iFlasher && get_pdata_int(idOFFSET_TEAM) == iTeam)
        {
            reset_screen(id)
        }
    }

    return FMRES_HANDLED
}

public 
Event_ScreenFade(id)
{
    g_bHasJustBeenFlashed[id] = true
}

public 
client_putinserver(id)
{
    g_bHasJustBeenFlashed[id] = false
}

reset_screen(id)
{
    emessage_begin(MSG_ONEg_msgidScreenFade_id)
    ewrite_short(4)
    ewrite_short(0)
    ewrite_short(0)
    ewrite_byte(0)
    ewrite_byte(0)
    ewrite_byte(0)
    ewrite_byte(0)
    emessage_end()
}
  
(13/05/2017, 02:11 PM)DiCHANHO escribió: off: pobre este ya quedo traumado con lo del autor y robo de plugins
(26/07/2020, 08:32 PM)Hinami escribió: & si soy un gordo cagon, virgen, con posters de anime en todas partes
✅✅Aportes✅✅
Datear Automáticamente CincoYA
Efecto Trueno y Rayo

Responder
#3
(28/06/2022, 04:38 PM)Nacalau escribió:
Código PHP:
/* AMX Mod X Plugin

* (c) Copyright 2008, ConnorMcLeod 
* This file is provided as is (no warranties). 

*/ 

#include <amxmodx>
#include <fakemeta>

#define PEV_PDATA_SAFE    2

#define MAX_PLAYERS    32
#define OFFSET_TEAM    114

#define W_FLASH_MODEL_STRLEN        22
#define FLASH_XPLODE_SOUND_STRLEN    23

new g_iMaxClients
new bool:g_bHasJustBeenFlashed[MAX_PLAYERS+1]
new 
g_msgidScreenFade

public plugin_init()
{
    register_plugin("No Team Flash""1.0.0""ConnorMcLeod")

    register_event("ScreenFade""Event_ScreenFade""be""1>0""2>0""3=0","4=255""5=255""6=255""7=200""7=255")
    register_forward(FM_SetModel"Forward_SetModel")
    register_forward(FM_EmitSound"Forward_EmitSound")
}

public 
plugin_cfg()
{
    g_iMaxClients global_get(glb_maxClients)
    g_msgidScreenFade get_user_msgid("ScreenFade")
}
                            
public Forward_SetModel(iEntity, const szModel[])
{
    if(strlen(szModel) != W_FLASH_MODEL_STRLEN)
    {
        return FMRES_IGNORED
    
}

    if(szModel[7] != 'w' || szModel[9] != 'f' || szModel[14] != 'b')
    {
        return FMRES_IGNORED
    
}

    if(!pev_valid(iEntity))
    {
        return FMRES_IGNORED
    
}

    static Float:fVelocity[3]
    pev(iEntitypev_velocityfVelocity)
    if(!fVelocity[0] && !fVelocity[1] && !fVelocity[2])
    {
        return FMRES_IGNORED
    
}

    set_pev(iEntitypev_iuser4pev(iEntitypev_owner) )
    return FMRES_HANDLED
}
                            
public Forward_EmitSound(iEntityiChannel, const szSample[])
{
    if(szSample[0] != 'w' || szSample[8] != 'f' || szSample[9] != 'l')
    {
        return FMRES_IGNORED
    
}

    if(!pev_valid(iEntity))
    {
        return FMRES_IGNORED
    
}

    static iFlasher
    iFlasher 
pev(iEntitypev_iuser4)
    if( pev_valid(iFlasher) != PEV_PDATA_SAFE )
    {
        return FMRES_IGNORED
    
}
    static idiTeam
    iTeam 
get_pdata_int(iFlasherOFFSET_TEAM)

    for(id=1id<=g_iMaxClientsid++)
    {
        if(!g_bHasJustBeenFlashed[id])
        {
            continue
        }

        g_bHasJustBeenFlashed[id] = false

        
if( pev_valid(id) != PEV_PDATA_SAFE )
        {
            continue
        }

        if(id != iFlasher && get_pdata_int(idOFFSET_TEAM) == iTeam)
        {
            reset_screen(id)
        }
    }

    return FMRES_HANDLED
}

public 
Event_ScreenFade(id)
{
    g_bHasJustBeenFlashed[id] = true
}

public 
client_putinserver(id)
{
    g_bHasJustBeenFlashed[id] = false
}

reset_screen(id)
{
    emessage_begin(MSG_ONEg_msgidScreenFade_id)
    ewrite_short(4)
    ewrite_short(0)
    ewrite_short(0)
    ewrite_byte(0)
    ewrite_byte(0)
    ewrite_byte(0)
    ewrite_byte(0)
    emessage_end()
}
  

Me presenta el mismo problema.. le tiro una fb a un compañero y lo lagueo
Responder
#4
Código PHP:
#include <amxmodx>
#include <reapi>

#pragma semicolon 1

public plugin_init()
{
     
register_plugin"No Team Flash""1.0.0""zekro" );

     
RegisterHookChain(RG_PlayerBlind"@func_PlayerBlind", .post false);
}

@
func_PlayerBlind(const iVictim, const iInflictor, const iAttacker, const Float:flFadeTime, const Float:flFadeHold, const iAlphaFloat:flColor[3])
{
 if (
iVictim != iAttacker && get_member(iVictimm_iTeam) == get_member(iAttackerm_iTeam))
 return 
HC_SUPERCEDE;

 return 
HC_CONTINUE;

Responder
#5
(02/07/2022, 12:07 PM)Niper.-. escribió:
Código PHP:
#include <amxmodx>
#include <reapi>

#pragma semicolon 1

public plugin_init()
{
    register_plugin"No Team Flash""1.0.0""zekro" );

    RegisterHookChain(RG_PlayerBlind"@func_PlayerBlind", .post false);
}

@
func_PlayerBlind(const iVictim, const iInflictor, const iAttacker, const Float:flFadeTime, const Float:flFadeHold, const iAlphaFloat:flColor[3])
{
 if (
iVictim != iAttacker && get_member(iVictimm_iTeam) == get_member(iAttackerm_iTeam))
 return 
HC_SUPERCEDE;

 return 
HC_CONTINUE;


Esta testeado ?
Lo puse en mi server y los jugadores de un mismo equipo de flashean entre ellos
Responder
#6
(04/07/2022, 10:00 PM)Gstrigl escribió: Esta testeado ?
Lo puse en mi server y los jugadores de un mismo equipo de flashean entre ellos

Código PHP:
#include <amxmodx>
#include <reapi>

#pragma semicolon 1

public stock const PluginName[] = "No Team Flash";
public 
stock const PluginVersion[] = "1.0.0";
public 
stock const PluginAuthor[] = "Chema";
public 
stock const PluginDescription[] = "You will not be blinded by the flashbangs of your teammates";

public 
plugin_init()
{
    register_plugin(
        .plugin_name PluginName,
        .version PluginVersion,
        .author PluginAuthor
    
);
    
    RegisterHookChain
(RG_PlayerBlind"@func_PlayerBlind", .post false);
}

@
func_PlayerBlind(const iVictim, const iInflictor, const iAttacker, const Float:flFadeTime, const Float:flFadeHold, const iAlphaFloat:flColor[3])
{
    if (iVictim != iAttacker && get_member(iVictimm_iTeam) == get_member(iAttackerm_iTeam))
        return HC_SUPERCEDE;

    return HC_CONTINUE;


Testeado, trabajando a la perfecion.
Responder
#7
(04/07/2022, 10:36 PM)Null2020 escribió:
Código PHP:
#include <amxmodx>
#include <reapi>

#pragma semicolon 1

public stock const PluginName[] = "No Team Flash";
public 
stock const PluginVersion[] = "1.0.0";
public 
stock const PluginAuthor[] = "Chema";
public 
stock const PluginDescription[] = "You will not be blinded by the flashbangs of your teammates";

public 
plugin_init()
{
    register_plugin(
        .plugin_name PluginName,
        .version PluginVersion,
        .author PluginAuthor
    
);
    
    RegisterHookChain
(RG_PlayerBlind"@func_PlayerBlind", .post false);
}

@
func_PlayerBlind(const iVictim, const iInflictor, const iAttacker, const Float:flFadeTime, const Float:flFadeHold, const iAlphaFloat:flColor[3])
{
    if (iVictim != iAttacker && get_member(iVictimm_iTeam) == get_member(iAttackerm_iTeam))
        return HC_SUPERCEDE;

    return HC_CONTINUE;


Testeado, trabajando a la perfecion.

Alv en años que tengo codeando por primera vez en mi vida veo esto xD

Código PHP:
public stock const PluginName[] = "No Team Flash";
public 
stock const PluginVersion[] = "1.0.0";
public 
stock const PluginAuthor[] = "Chema";
public 
stock const PluginDescription[] = "You will not be blinded by the flashbangs of your teammates"

Aparte es lo mismo que el de arriba con diferente autor xd
Responder
#8
(06/07/2022, 01:28 AM)Alejandro escribió:
Código PHP:
public stock const PluginName[] = "No Team Flash";
public 
stock const PluginVersion[] = "1.0.0";
public 
stock const PluginAuthor[] = "Chema";
public 
stock const PluginDescription[] = "You will not be blinded by the flashbangs of your teammates"

Aparte es lo mismo que el de arriba con diferente autor xd

nadie
absolutamente nadie

niper: * le voy a borrar los static al autor porque se ve feo, ahh que autor decia? bueno me pongo yo *
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#9
(06/07/2022, 11:20 AM)Hinami escribió: nadie
absolutamente nadie

niper: * le voy a borrar los static al autor porque se ve feo, ahh que autor decia? bueno me pongo yo *

Solo te dejo esto... https://amxmodx-es.com/Thread-Plugin-TEA...#pid216316
Salu2
Responder
#10
Gente.. probe varios sma que me dejaron y no logro que alguno funcione..
A que se puede deber el problema que se generó con respecto al plugin que venia utilizando sin problemas, sin hacerle cambio al mismo o al server en general empezo con estos temas...
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)