Raised This Month: $51 Target: $400
 12% 

screenfade win


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonny1990
Senior Member
Join Date: Apr 2020
Old 07-02-2020 , 09:35   screenfade win
Reply With Quote #1

Hello! looking for a plugin, when the team won the round, the screen turns red or blue depending on which team won CT, TT as in the screenfade effect
jonny1990 is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 07-02-2020 , 18:59   Re: screenfade win
Reply With Quote #2

Code:
#include <amxmodx> #define CT 1 #define T 2 new g_iWinnerTeam public plugin_init() {     register_logevent("CTWin", 6, "3=CTs_Win", "3=All_Hostages_Rescued")     register_logevent("TWin" , 6, "3=Terrorists_Win", "3=Target_Bombed") } public CTWin() {     g_iWinnerTeam = CT;     ScreenFadeAll(); } public TWin() {     g_iWinnerTeam = T;     ScreenFadeAll(); } public ScreenFadeAll() {     switch(g_iWinnerTeam)     {         case CT: ScreenFade(0 , 3.0, 0, 0, 255 , 50);         case T: ScreenFade(0 , 3.0, 255, 0, 0 , 50);     } } stock ScreenFade(plr, Float:fDuration, red, green, blue, alpha) {     new i = plr ? plr : get_maxplayers();     if( !i )     {         return 0;     }         message_begin(plr ? MSG_ONE : MSG_ALL, get_user_msgid( "ScreenFade"), {0, 0, 0}, plr);     write_short(floatround(4096.0 * fDuration, floatround_round));     write_short(floatround(4096.0 * fDuration, floatround_round));     write_short(4096);     write_byte(red);     write_byte(green);     write_byte(blue);     write_byte(alpha);     message_end();         return 1; }

Last edited by ZaX; 07-03-2020 at 01:10.
ZaX is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 07-02-2020 , 22:22   Re: screenfade win
Reply With Quote #3

PHP Code:
//-=CVARS=-/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//win_both_teams <0|1>
//0 = only winning team is screen faded of team winner's color
//1 = both teams are screen faded of team winner's color

//win_fade_color_t <red> <green> <blue> <alpha>
//The fade color for when terrorists win
//Set alpha to 0 to not show any color
//
//win_fade_color_ct <red> <green> <blue> <alpha>
//The fade color for when counter-terrorists win
//Set alpha to 0 to not show any color
//
//win_fade_time_t <seconds>
//The time of the fade color on the screen for when terrorists win
//Set time to 0 to not show any color
//
//win_fade_time_ct <seconds>
//The time of the fade color on the screen for when counter-terrorists win   
//Set time to 0 to not show any color                                        
//                                                                          
////////////////////////////////////////////////////////////////////////////

#include < amxmodx >
#include < cstrike >

#define FFADE_IN 0x0000
#define FFADE_OUT 0x0001

// the fade type for the color
// FFADE_IN goes from color to normal
// FFADE_OUT goes from normal to color
#define FADE_TYPE FFADE_OUT

new pCvar_BothTeams;
new 
pCvar_ColorCsTeams ];
new 
pCvar_TimeCsTeams ];

new 
g_iMsgId_ScreenFade;

public 
plugin_init( ) {
    
register_plugin"Round End Fade Color""0.0.1""Exolent" );
    
    
register_event"SendAudio""EventTWin""a""2=%!MRAD_terwin" );
    
register_event"SendAudio""EventCTWin""a""2=%!MRAD_ctwin" );
    
register_event"SendAudio""EventCTWin""a""2&%!MRAD_ROUNDDRAW")
    
register_event"SendAudio""EventTWin""a""2&%!MRAD_ROUNDDRAW" )
    
    
pCvar_BothTeams register_cvar"win_both_teams""1" );
    
pCvar_ColorCS_TEAM_T ] = register_cvar"win_fade_color_t""255 255 255 255" );
    
pCvar_ColorCS_TEAM_CT ] = register_cvar"win_fade_color_ct""255 255 255 255" );
    
pCvar_TimeCS_TEAM_T ] = register_cvar"win_fade_time_t""5" );
    
pCvar_TimeCS_TEAM_CT ] = register_cvar"win_fade_time_ct""5" );
    
    
g_iMsgId_ScreenFade get_user_msgid"ScreenFade" );
}

public 
EventTWin( ) {
    
HandleRoundEndCS_TEAM_T );
}

public 
EventCTWin( ) {
    
HandleRoundEndCS_TEAM_CT );
}

HandleRoundEndCsTeams:iWinner ) {
    new 
iSeconds get_pcvar_numpCvar_TimeiWinner ] );
    if( !
iSeconds ) {
        return;
    }
    
    new 
szColor16 ];
    
get_pcvar_stringpCvar_ColoriWinner ], szColor15 );
    
    new 
szRed], szGreen], szBlue], szAlpha];
    
parseszColorszRed3szGreen3szBlue3szAlpha);
    
    new 
iAlpha str_to_numszAlpha );
    if( !
iAlpha ) {
        return;
    }
    
    new 
iRed str_to_numszRed );
    new 
iGreen str_to_numszGreen );
    new 
iBlue str_to_numszBlue );
    
    new 
iUnits clamp( ( iSeconds * ( << 12 ) ), 00xFFFF );
    
    new 
iPlayers32 ], iNum;
    if( 
get_pcvar_numpCvar_BothTeams ) ) {
        
get_playersiPlayersiNum );
    } else {
        
get_playersiPlayersiNum"e"iWinner == CS_TEAM_T "TERRORIST" "CT" );
    }
    
    for( new 
0iNumi++ ) {
        
message_beginMSG_ONE_UNRELIABLEg_iMsgId_ScreenFade_iPlayers] );
        
write_shortiUnits );
        
write_shortiUnits );
        
write_shortFADE_TYPE );
        
write_byteiRed );
        
write_byteiGreen );
        
write_byteiBlue );
        
write_byteiAlpha );
        
message_end( );
    }

__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
jonny1990
Senior Member
Join Date: Apr 2020
Old 07-03-2020 , 02:50   Re: screenfade win
Reply With Quote #4

Quote:
Originally Posted by DruGzOG View Post
"255 255 255 255"
why are there four settings in rgb color

Last edited by jonny1990; 07-03-2020 at 02:50.
jonny1990 is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 07-03-2020 , 03:07   Re: screenfade win
Reply With Quote #5

It is RGBA color. The last one is an alpha value.
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 07-03-2020 , 03:50   Re: screenfade win
Reply With Quote #6

all thanks
jonny1990 is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 07-03-2020 , 11:30   Re: screenfade win
Reply With Quote #7

Quote:
Originally Posted by jonny1990 View Post
why are there four settings in rgb color
Quote:
Originally Posted by +ARUKARI- View Post
It is RGBA color. The last one is an alpha value.
As mentioned, there will be always.

I would recommend this to get an idea. https://www.hexcolortool.com/#181051
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Reply



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 03:20.


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