AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Don't get flashed when not looking at the flashbang (https://forums.alliedmods.net/showthread.php?t=308221)

sekac 06-11-2018 07:45

Don't get flashed when not looking at the flashbang
 
Normally even if you are looking away from a flashbang it will still fully blind you.

Napoleon_be 06-12-2018 18:45

Re: Don't get flashed when not looking at the flashbang
 
it never fully blinds you when you look away from it. It may be blinding your whole screen, but not as long as it normally would when looking at it.

sekac 06-13-2018 07:35

Re: Don't get flashed when not looking at the flashbang
 
Quote:

Originally Posted by Napoleon_be (Post 2596621)
it never fully blinds you when you look away from it. It may be blinding your whole screen, but not as long as it normally would when looking at it.

Well that's what I meant. If it's a short flash make it look more transparent.

maqi 06-14-2018 22:32

Re: Don't get flashed when not looking at the flashbang
 
Try this:

PHP Code:

#include <amxmodx>
#include <amxmisc>

#include <engine>
#include <fakemeta>
#include <fakemeta_util>

#pragma semicolon 1

new const    plugin[]        =    "Advanced Flash",
        
version[]        =    "2.1a",
        
author[]        =    "maqi";
        
#define MAX_PLAYERS 32

new     g_Msg_ScreenFade;

new     
g_iLastGrenade;

public 
plugin_init( )
{
    
register_pluginpluginversionauthor );
    
    
register_forwardFM_SetModel"Fw_SetModel" );
    
    
register_event"ScreenFade","Event_Flash","be","1>0","2>0","3=0","4=255","5=255","6=255","7>199" );
        
    
g_Msg_ScreenFade get_user_msgid"ScreenFade" );
}


public 
Fw_SetModeliEnt, const sModel[] )
{
    if( !
pev_valid(iEnt) )
        return 
FMRES_IGNORED;
        
    if( !
equal(sModel"models/w_flashbang.mdl" ) )
        return 
FMRES_IGNORED;
    
    
g_iLastGrenade iEnt;

    return 
FMRES_IGNORED;
}
 
public 
Event_FlashiIndex )
{
    if( !
pev_valid(g_iLastGrenade) ) 
        return;
    
    new 
Float:fOrigins[3]; pevg_iLastGrenadepev_originfOrigins );
        
    if( 
is_in_viewconeiIndexfOrigins) && fm_is_ent_visibleiIndexg_iLastGrenade ) ) 
        return;
    
    
message_beginMSG_ONEg_Msg_ScreenFade_iIndex );
    
write_short(0);
    
write_short(0);
    
write_short(1<<2);
    
write_byte(0);
    
write_byte(0);
    
write_byte(0);
    
write_byte(0);
    
message_end();        



sekac 06-15-2018 09:04

Re: Don't get flashed when not looking at the flashbang
 
Well right now if you don't look directly at the flash, you don't get blinded at all. I want it the more you look away from it, the shorter and more transparent the flash will be.

maqi 06-15-2018 11:07

Re: Don't get flashed when not looking at the flashbang
 
Quote:

Don't get flashed when not looking at the flashbang
Its like that because thats what you said, please be more descriptive in the future... :nono:

Anyway, as far as im concerned, I won't be doing that, especially because that's exactly how it works in cs, like others said above.

The one thing I can make you, is that when you don't look at the flash, you get blinded for a specific duration/holdtime/color/alpha but always the same, cause my code above can be used for that. Cheers.

sekac 06-15-2018 11:20

Re: Don't get flashed when not looking at the flashbang
 
Can you reduce how much you get flashed when you are not looking at the flashbang, not completely remove it?

maqi 06-15-2018 11:36

Re: Don't get flashed when not looking at the flashbang
 
As I said above, I can BUT, it will always be the same amount of flash when not looking, it won't depend on how far you turned.

sekac 06-15-2018 12:09

Re: Don't get flashed when not looking at the flashbang
 
Quote:

Originally Posted by maqi (Post 2597111)
As I said above, I can BUT, it will always be the same amount of flash when not looking, it won't depend on how far you turned.

That's what I requested.

maqi 06-15-2018 12:27

Re: Don't get flashed when not looking at the flashbang
 
Here you go, this will make the exact same effect as the normal flash, but when not looking at it, it will be more transparent.

You can use the cvar flash_alpha to change the transparency yourself 0-255 ( 0 being full transparent and 255 being not transparent at all )

PHP Code:

#include <amxmodx>
#include <amxmisc>

#include <engine>
#include <fakemeta>
#include <fakemeta_util>

#pragma semicolon 1

new const    plugin[]        =    "Advanced Flash",
        
version[]        =    "2.1a",
        
author[]        =    "maqi";
        
#define MAX_PLAYERS 32

new     g_Msg_ScreenFade,
    
g_iLastGrenade,
    
g_Cvar_Alpha;

public 
plugin_init( )
{
    
register_pluginpluginversionauthor );
    
    
register_forwardFM_SetModel"Fw_SetModel" );
    
    
register_event"ScreenFade","Event_Flash","be","1>0","2>0","3=0","4=255","5=255","6=255","7>199" );
        
    
g_Msg_ScreenFade get_user_msgid"ScreenFade" );
}

public 
plugin_precache( )
{
    
g_Cvar_Alpha register_cvar"flash_alpha""199" );
}

public 
Fw_SetModeliEnt, const sModel[] )
{
    if( !
pev_valid(iEnt) )
        return 
FMRES_IGNORED;
        
    if( !
equal(sModel"models/w_flashbang.mdl" ) )
        return 
FMRES_IGNORED;
    
    
g_iLastGrenade iEnt;

    return 
FMRES_IGNORED;
}
 
 public 
Event_FlashiIndex )
{
    if( !
pev_valid(g_iLastGrenade) ) 
        return;
    
    new 
Float:fOrigins[3]; pevg_iLastGrenadepev_originfOrigins );
        
    if( 
is_in_viewconeiIndexfOrigins) && fm_is_ent_visibleiIndexg_iLastGrenade ) ) 
        return;
    
    
message_beginMSG_ONEg_Msg_ScreenFade_iIndex );
    
write_short(read_data(1));
    
write_short(read_data(2));
    
write_short(read_data(3));
    
write_byte(255);
    
write_byte(255);
    
write_byte(255);
    
write_byte(get_pcvar_num(g_Cvar_Alpha));
    
message_end();        




All times are GMT -4. The time now is 00:27.

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