複製程式
new g_pFadeColor;
new g_iMsgScreenFade;
複製程式
g_pFadeColor = register_cvar( "hns_fadecolor", "0 0 0 255" );
g_iMsgScreenFade = get_user_msgid( "ScreenFade" );
register_message( g_iMsgScreenFade, "msgScreenFade" );
複製程式
MakeScreenFade( const id, const iFade = 1 )
{
new szColor[ 20 ], szRed[ 4 ], szGreen[ 4 ], szBlue[ 4 ], szAlpha[ 4 ];
get_pcvar_string( g_pFadeColor, szColor, 19 );
parse( szColor, szRed, 3, szGreen, 3, szBlue, 3, szAlpha, 3 );
message_begin( MSG_ONE, g_iMsgScreenFade, _, id );
write_short( 8192 * iFade );
write_short( 8192 * iFade );
write_short( 0x0000 );
write_byte( str_to_num( szRed ) );
write_byte( str_to_num( szGreen ) );
write_byte( str_to_num( szBlue ) );
write_byte( str_to_num( szAlpha ) );
message_end();
}
使用方法..研究一下吧...
複製程式
MakeScreenFade( iVictim, 0 );
MakeScreenFade( id );
MakeScreenFade( id, 0 );