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(PLUGIN, VERSION, "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(id, Float:flBlindTime, Float:flFlashDuration, Float:flFlashHoldTime, iFlashAlpha)
{
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(es, e, iEnt, id, hostflags, player, pSet)
{
if( player && id != iEnt && get_orig_retval() && is_user_alive(id) )
{
static iFlash, iPercent
iFlash = get_user_flashed(id, iPercent)
if( iPercent )
{
set_es(es, ES_RenderMode, kRenderTransAlpha)
set_es(es, ES_RenderAmt, 255 - (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
}
__________________