Raised This Month: $ Target: $400
 0% 

Screen Fade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andrzN
Senior Member
Join Date: Jan 2010
Location: Bodø / Norway
Old 04-18-2011 , 10:43   Screen Fade
Reply With Quote #1

Hello!
I need a plugin that fades CT's screen from black(255) to clear(0) slowly in a time of 10 seconds.
It should, as said above, only work for CT, and it should fade the screen every new round!

Thaaaaanks: D
__________________
Owner of Gamepark.se - Scandinavian Community

#1 - HideNSeek [Easyblocks] IP: eb.gamepark.se
#2 - HideNSeek [Noblocks] IP: nb.gamepark.se
#3 - HideNSeek [HNS Training Blocks] IP: training.gamepark.se
andrzN is offline
Send a message via MSN to andrzN
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-18-2011 , 12:02   Re: Screen Fade
Reply With Quote #2

Are you using (willing to use) orpheu ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
andrzN
Senior Member
Join Date: Jan 2010
Location: Bodø / Norway
Old 04-18-2011 , 13:04   Re: Screen Fade
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Are you using (willing to use) orpheu ?
what is orpheu?: s
__________________
Owner of Gamepark.se - Scandinavian Community

#1 - HideNSeek [Easyblocks] IP: eb.gamepark.se
#2 - HideNSeek [Noblocks] IP: nb.gamepark.se
#3 - HideNSeek [HNS Training Blocks] IP: training.gamepark.se
andrzN is offline
Send a message via MSN to andrzN
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-18-2011 , 14:12   Re: Screen Fade
Reply With Quote #4

A module not integrated to default amxx, nvm.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-18-2011 , 14:34   Re: Screen Fade
Reply With Quote #5

Is really necessary to use Orpheu here ?
__________________
Arkshine is offline
andrzN
Senior Member
Join Date: Jan 2010
Location: Bodø / Norway
Old 04-18-2011 , 14:51   Re: Screen Fade
Reply With Quote #6

I'm sorry if I sound like a retard. But I've got no idea what the orpheu does. If either fo you could script me this small plugin, I would be more that thankfull. Or ofcourse, which is why I posted in scripting help, you can give me the parts of the code that I need to make the plugin work
__________________
Owner of Gamepark.se - Scandinavian Community

#1 - HideNSeek [Easyblocks] IP: eb.gamepark.se
#2 - HideNSeek [Noblocks] IP: nb.gamepark.se
#3 - HideNSeek [HNS Training Blocks] IP: training.gamepark.se
andrzN is offline
Send a message via MSN to andrzN
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-18-2011 , 16:44   Re: Screen Fade
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
Is really necessary to use Orpheu here ?
Not really.


So, is CT freezetime during regular freezetime or just after regular freezetime ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
andrzN
Senior Member
Join Date: Jan 2010
Location: Bodø / Norway
Old 04-18-2011 , 17:18   Re: Screen Fade
Reply With Quote #8

during regular freezetime. It's normal freezetime for CT Only
__________________
Owner of Gamepark.se - Scandinavian Community

#1 - HideNSeek [Easyblocks] IP: eb.gamepark.se
#2 - HideNSeek [Noblocks] IP: nb.gamepark.se
#3 - HideNSeek [HNS Training Blocks] IP: training.gamepark.se
andrzN is offline
Send a message via MSN to andrzN
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
andrzN
Senior Member
Join Date: Jan 2010
Location: Bodø / Norway
Old 04-19-2011 , 20:53   Re: Screen Fade
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
You have to compile locally with this include : http://forums.alliedmods.net/showthread.php?t=87623

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <screenfade_util.inc>

#define VERSION "0.0.1"
#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""250 0 0 255"// RRRGGGBBB / R=Red G=Green B=Blue A=Alpha
    
g_pCvarColorAlpha[1] = register_cvar("amx_fade_ct""0 250 0 255"// 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[3] , &iAlpha=)
{
    new 
szColor[16], szRed[4], szGreen[4], szBlue[4], szAlpha[4]
    
get_pcvar_string(g_pCvarszColorcharsmax(szColor))
    
parse(szColorszRedcharsmax(szRed), szGreencharsmax(szGreen), szBluecharsmax(szBlue), szAlphacharsmax(szAlpha))
    
iColor[0] = str_to_num(szRed)
    
iColor[1] = str_to_num(szGreen)
    
iColor[2] = str_to_num(szBlue)
    
iAlpha str_to_num(szAlpha)
}

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)
        }
    }


Thank you ever so much, youre awesome! Thanks to you others too!
I like the support here on AM!
__________________
Owner of Gamepark.se - Scandinavian Community

#1 - HideNSeek [Easyblocks] IP: eb.gamepark.se
#2 - HideNSeek [Noblocks] IP: nb.gamepark.se
#3 - HideNSeek [HNS Training Blocks] IP: training.gamepark.se
andrzN is offline
Send a message via MSN to andrzN
Reply


Thread Tools
Display Modes

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