Raised This Month: $ Target: $400
 0% 

Screen Fade


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-19-2011 , 12:28   Re: Screen Fade
Reply With Quote #9

You have to compile locally with this include : http://forums.alliedmods.net/showthread.php?t=87623

PHP Code:
/*    Formatright © 2010, 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 <hamsandwich>
#include <cstrike>
#include <screenfade_util.inc>

#define VERSION "0.0.2"
#define PLUGIN "FrrezeTime ScreenFade"

new g_bFreezePeriod true

new g_pCvarFadeTeamg_pCvarColorAlpha[2]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
g_pCvarFadeTeam register_cvar("amx_freezefade_team""2"// 0:nobody 1:Ts 2:CTs 3:all
    
g_pCvarColorAlpha[0] = register_cvar("amx_fade_t""250000000255"// RRRGGGBBB / R=Red G=Green B=Blue A=Alpha
    
g_pCvarColorAlpha[1] = register_cvar("amx_fade_ct""000000250255"// RRRGGGBBB / R=Red G=Green B=Blue A=Alpha

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
register_logevent("LogEvent_Round_Start"2"1=Round_Start")
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn_Post"true)
}

public 
Event_HLTV_New_Round()
{
    
g_bFreezePeriod true
}

public 
CBasePlayer_Spawn_Post(id)
{
    if( 
g_bFreezePeriod && is_user_alive(id) )
    {
        new 
iTeam _:cs_get_user_team(id)
        if( 
get_pcvar_num(g_pCvarFadeTeam) & iTeam )
        {
            new 
iColor[3], iAlpha
            get_pcvar_color_alpha
(g_pCvarColorAlpha[iTeam-1], iColoriAlpha)
            
UTIL_ScreenFade(id,iColor,1.0,_,iAlpha,FFADE_OUT|FFADE_STAYOUT,true)
        }
    }
}

get_pcvar_color_alphag_pCvar iColor[] , &iAlpha=)
{
    new 
szColor[13]
    if( 
get_pcvar_string(g_pCvarszColorcharsmax(szColor)) != charsmax(szColor) )
    {
        
abort(AMX_ERR_GENERAL"Color cvar must be 12 chars, format ^"RRRGGGBBBAAA^"")
    }
    
iColor[Red] = parse_colorszColor)
    
iColor[Green] = parse_colorszColor)
    
iColor[Blue] = parse_colorszColor)
    
iAlpha parse_colorszColor)
}

parse_color(szColor[], iStart)
{
    return 
100 szColor[iStart] + 10 szColor[iStart+1] + szColor[iStart+2] - 5328
}

public 
LogEvent_Round_Start()
{
    
g_bFreezePeriod false

    
new iPlayers[32], iNumiColor[3], iAlpha
    
new iTeamCvar get_pcvar_num(g_pCvarFadeTeam)
    if( 
iTeamCvar _:CS_TEAM_T )
    {
        
get_players(iPlayersiNum"ae""TERRORIST")
        
get_pcvar_color_alpha(g_pCvarColorAlpha[0], iColoriAlpha)
        for(--
iNumiNum>=0iNum--)
        {
            
UTIL_ScreenFade(iPlayers[iNum], iColor2.0_iAlpha)
        }
    }
    if( 
iTeamCvar _:CS_TEAM_CT )
    {
        
get_players(iPlayersiNum"ae""CT")
        
get_pcvar_color_alpha(g_pCvarColorAlpha[1], iColoriAlpha)
        for(--
iNumiNum>=0iNum--)
        {
            
UTIL_ScreenFade(iPlayers[iNum], iColor2.0_iAlpha)
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-20-2011 at 02:10.
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 19:51.


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