Raised This Month: $32 Target: $400
 8% 

Simple plugin request


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plaz03
Junior Member
Join Date: Feb 2019
Old 11-27-2021 , 09:41   Simple plugin request
Reply With Quote #1

I just want to get fade black effect at the end of round. I tried this plugin its running but not giving any effect at the end of round.


PHP Code:
#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_Color;
new 
pCvar_Time;

new 
g_iMsgId_ScreenFade;

public 
plugin_init( ) {
    
register_plugin"Round End Fade Color""0.0.1""Exolent" );
    
    
register_clcmd("fade""HandleRoundEnd")
    
    
pCvar_Color register_cvar"fade_color""255 255 255 255" );
    
pCvar_Time register_cvar"fade_time""5" );

    
    
g_iMsgId_ScreenFade get_user_msgid"ScreenFade" );
}

public 
HandleRoundEndid ) {
    new 
iSeconds get_pcvar_numpCvar_Time );
    if( !
iSeconds ) {
        return;
    }
    
    new 
szColor16 ];
    
get_pcvar_stringpCvar_ColorszColor15 );
    
    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;
    
    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( );
    }

Attached Files
File Type: sma Get Plugin or Get Source (fade.sma - 117 views - 1.8 KB)

Last edited by plaz03; 11-27-2021 at 09:46.
plaz03 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-27-2021 , 10:46   Re: Simple plugin request
Reply With Quote #2

Quote:
Originally Posted by plaz03 View Post
I just want to get fade black effect at the end of round. I tried this plugin its running but not giving any effect at the end of round.


PHP Code:
#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_Color;
new 
pCvar_Time;

new 
g_iMsgId_ScreenFade;

public 
plugin_init( ) {
    
register_plugin"Round End Fade Color""0.0.1""Exolent" );
    
    
register_clcmd("fade""HandleRoundEnd")
    
    
pCvar_Color register_cvar"fade_color""255 255 255 255" );
    
pCvar_Time register_cvar"fade_time""5" );

    
    
g_iMsgId_ScreenFade get_user_msgid"ScreenFade" );
}

public 
HandleRoundEndid ) {
    new 
iSeconds get_pcvar_numpCvar_Time );
    if( !
iSeconds ) {
        return;
    }
    
    new 
szColor16 ];
    
get_pcvar_stringpCvar_ColorszColor15 );
    
    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;
    
    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( );
    }

TRY THIS

pCvar_Color = register_cvar( "fade_color", "255 255 255 255" );
To
pCvar_Color = register_cvar( "fade_color", "0 0 0" );
SHIFT0 is offline
plaz03
Junior Member
Join Date: Feb 2019
Old 11-27-2021 , 11:55   Re: Simple plugin request
Reply With Quote #3

Quote:
Originally Posted by SHIFT0 View Post
TRY THIS

pCvar_Color = register_cvar( "fade_color", "255 255 255 255" );
To
pCvar_Color = register_cvar( "fade_color", "0 0 0" );
Nope still nothing on screen after round end.
plaz03 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-27-2021 , 13:08   Re: Simple plugin request
Reply With Quote #4

What u want after the round ended ?
SHIFT0 is offline
Old 11-27-2021, 14:30
Bacardi
This message has been deleted by Bacardi. Reason: wrong section
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-29-2021 , 07:31   Re: Simple plugin request
Reply With Quote #5

Code:
#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_Color;
new pCvar_Time;

new g_iMsgId_ScreenFade;

public plugin_init( ) {
    register_plugin( "Round End Fade Color", "0.0.1", "Exolent" );
    
    //register_clcmd("fade", "HandleRoundEnd")
    register_logevent("HandleRoundEnd", 2, "1=Round_End") 
    
    pCvar_Color = register_cvar( "fade_color", "255 255 255 255" );
    pCvar_Time = register_cvar( "fade_time", "5" );

    
    g_iMsgId_ScreenFade = get_user_msgid( "ScreenFade" );
}

public HandleRoundEnd( id ) {
    new iSeconds = get_pcvar_num( pCvar_Time );
    if( !iSeconds ) {
        return;
    }
    
    new szColor[ 16 ];
    get_pcvar_string( pCvar_Color, szColor, 15 );
    
    new szRed[ 4 ], szGreen[ 4 ], szBlue[ 4 ], szAlpha[ 4 ];
    parse( szColor, szRed, 3, szGreen, 3, szBlue, 3, szAlpha, 3 );
    
    new iAlpha = str_to_num( szAlpha );
    if( !iAlpha ) {
        return;
    }
    
    new iRed = str_to_num( szRed );
    new iGreen = str_to_num( szGreen );
    new iBlue = str_to_num( szBlue );
    
    new iUnits = clamp( ( iSeconds * ( 1 << 12 ) ), 0, 0xFFFF );
    
    new iPlayers[ 32 ], iNum;
    
    for( new i = 0; i < iNum; i++ ) {
        message_begin( MSG_ONE_UNRELIABLE, g_iMsgId_ScreenFade, _, iPlayers[ i ] );
        write_short( iUnits );
        write_short( iUnits );
        write_short( FADE_TYPE );
        write_byte( iRed );
        write_byte( iGreen );
        write_byte( iBlue );
        write_byte( iAlpha );
        message_end( );
    }
}
__________________








CrazY. is offline
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 22:28.


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