Raised This Month: $ Target: $400
 0% 

[REQ] cs flashbangs- all players dissapear no white screen


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2011 , 14:16   Re: [REQ] cs flashbangs- all players dissapear no white screen
Reply With Quote #4

Yes, install that hamsandwich version and try with this plugin version :
Gonna think about your request later.

PHP Code:
/*    Formatright @ 2011, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.2"
#define PLUGIN "Flash Disappear Players"
/*
const XO_PLAYER = 5
const m_flFlashedUntil = 514
const m_flFlashedAt = 515
const m_flFlashHoldTime = 516
const m_flFlashDuration = 517
const m_iFlashAlpha = 518
*/

const MAX_PLAYERS 32

const ALPHA_FULLBLINDED 255

enum mFlashDatas
{
    
Float:m_flFlashedUntil,
    
Float:m_flFlashedAt,
    
Float:m_flFlashHoldTime,
    
Float:m_flFlashDuration,
    
m_iFlashAlpha
}

new 
g_iPlayerFlashDatas[MAX_PLAYERS+1][mFlashDatas]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1)
    
register_message(get_user_msgid("ScreenFade"), "Message_ScreenFade")
    
RegisterHam(Ham_CS_Player_Blind"player""CBasePlayer_Blind_Post"1)
}

public 
Message_ScreenFade()
{
    if(    
get_msg_arg_int(4) == 255
    
&&    get_msg_arg_int(5) == 255
    
&&    get_msg_arg_int(6) == 255
    
&&    get_msg_arg_int(7) > 199    )
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
CBasePlayer_Blind_Post(idFloat:flBlindTimeFloat:flFlashDurationFloat:flFlashHoldTimeiFlashAlpha)
{
    new 
Float:flGameTime get_gametime()
    
g_iPlayerFlashDatas[id][m_flFlashedUntil] = _:(flGameTime flBlindTime)
    
g_iPlayerFlashDatas[id][m_flFlashedAt] = _:flGameTime
    g_iPlayerFlashDatas
[id][m_flFlashHoldTime] = _:flFlashHoldTime
    g_iPlayerFlashDatas
[id][m_flFlashDuration] = _:flFlashDuration
    g_iPlayerFlashDatas
[id][m_iFlashAlpha] = iFlashAlpha
}

public 
AddToFullPack_Post(eseiEntidhostflagsplayerpSet)
{
    if( 
player && id != iEnt && get_orig_retval() && is_user_alive(id) )
    {
        static 
iFlashiPercent
        iFlash 
get_user_flashed(idiPercent)
        if( 
iPercent )
        {
            
set_es(esES_RenderModekRenderTransAlpha)
            
set_es(esES_RenderAmt255 - (iFlash iPercent) / 100)
        }
    }
}

get_user_flashed(id, &iPercent=0)
{
    new 
Float:flFlashedAt g_iPlayerFlashDatas[id][m_flFlashedAt]

    if( !
flFlashedAt )
    {
        return 
0
    
}

    new 
Float:flGameTime get_gametime()
    new 
Float:flTimeLeft flGameTime flFlashedAt
    
new Float:flFlashDuration g_iPlayerFlashDatas[id][m_flFlashDuration]
    new 
Float:flFlashHoldTime g_iPlayerFlashDatas[id][m_flFlashHoldTime]
    new 
Float:flTotalTime flFlashHoldTime flFlashDuration

    
if( flTimeLeft flTotalTime )
    {
        return 
0
    
}

    new 
iFlashAlpha g_iPlayerFlashDatas[id][m_iFlashAlpha]

    if( 
iFlashAlpha == ALPHA_FULLBLINDED )
    {
        if( 
g_iPlayerFlashDatas[id][m_flFlashedUntil] - flGameTime 0.0 )
        {
            
iPercent 100
        
}
        else
        {
            
iPercent 100-floatround(((flGameTime - (flFlashedAt flFlashHoldTime))*100.0)/flFlashDuration)
        }
    }
    else
    {
        
iPercent 100-floatround(((flGameTime flFlashedAt)*100.0)/flTotalTime)
    }

    return 
iFlashAlpha

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-14-2011 at 14:17.
ConnorMcLeod is offline
 



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 00:26.


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