Han ocurrido los siguientes errores:
Warning [2] Undefined variable $unreadreports - Line: 119 - File: global.php(961) : eval()'d code PHP 8.4.6 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/global.php(961) : eval()'d code 119 errorHandler->error_callback
/global.php 961 eval
/printthread.php 16 require_once



MxEMexico
[Aporte] ScreenFade Round + Hud Info - Versión para impresión

+- MxEMexico (https://www.mxemexico.com)
+-- Foro: Extras (https://www.mxemexico.com/forumdisplay.php?fid=162)
+--- Foro: Pawn/Scripting. (https://www.mxemexico.com/forumdisplay.php?fid=100)
+--- Tema: [Aporte] ScreenFade Round + Hud Info (/showthread.php?tid=4337)



ScreenFade Round + Hud Info - Sky^^ - 01-28-2018

Hola, está algo muerta esta sección, así que vengo a dejar esto..

FUNCIÓN: Este plugin cuenta el número de rondas y detecta si la ronda fue ganada por Terroristas, CT o si la ronda fue empate. Muestra un HudMessage con los siguientes datos:
  1. Cuantas rondas llevan ganadas los terroristas.
  2. Cuantas rondas llevan ganadas los ct.
  3. Y cuenta las rondas que van jugadas.
Algo más, al terminar la ronda manda un screenfade junto con un print dependiendo del equipo que ganó o si la ronda fue empate.

Código:
Código PHP:
<?php 
/* ========================================================================= */

#include <amxmodx>

new const _Plugin[ ][ ] = { "ScreenFade Round + Hud Info", "1.0.1", "Sky" };
new const
_Prefix[ ] = "[ SKY ]";

/* ========================================================================= */

new gCountRound, gTScore, gCScore;
new
g_Message_ScreenFade;

const
UNIT_SECOND = (1<<12);
const
FFADE_IN = 0x0000;

/* ========================================================================= */

public plugin_init( )
{
register_plugin( _Plugin[ 0 ], _Plugin[ 1 ], _Plugin[ 2 ] );

register_event( "HLTV","event_NewRound","a","1=0","2=0" );
register_event( "SendAudio", "event_WinTerrorist", "a", "2&%!MRAD_terwin" );
register_event( "SendAudio", "event_WinPolices", "a", "2&%!MRAD_ctwin" );
register_event( "SendAudio", "event_RoundDraw","a","2&%!MRAD_rounddraw"  );
register_event( "TextMsg","event_GameRestart","a","2&#Game_w" );

register_logevent( "event_GameCommencing",2,"1=Game_Commencing" );
register_logevent( "event_WinPolices", 6, "3=Target_Saved" );
register_logevent( "event_WinTerrorist", 6, "3=Target_Bombed" );

g_Message_ScreenFade = get_user_msgid( "ScreenFade" );

set_task( 1.0, "ShowScoreHud", _, _, _, "b" );
}

/* ========================================================================= */

public event_GameCommencing( )
{
gCountRound = 0;
gTScore = 0;
gCScore = 0;
}
public
event_NewRound( ) ++gCountRound;
public
event_GameRestart( )
{
if(
gCountRound > 0 )
{
gCountRound = 0;
gTScore = 0;
gCScore = 0;
}
}

public
event_WinTerrorist( )
{
set_Msg( 0, 1 );
++
gTScore;

return
PLUGIN_HANDLED;
}
public
event_WinPolices( )
{
set_Msg( 0, 2 );
++
gCScore;

return
PLUGIN_HANDLED;
}
public
event_RoundDraw( )
{
set_Msg( 0, 3 );

return
PLUGIN_HANDLED;
}

/* ========================================================================= */

public ShowScoreHud( )
{
static
RandomR, RandomG, RandomB;
RandomR = random_num( 0, 100 ); RandomG = random_num( 0, 200 ); RandomB = random_num( 0 , 255 );

set_hudmessage( RandomR, RandomG, RandomB, -1.0, 0.0, 0, 0.5, 2.0, 0.08, 2.0, true );
show_hudmessage( 0,"Terroristas: %d | Policías: %d^nRondas: %d", gTScore, gCScore, gCountRound );
}

public
set_Msg( id, type )
{
if(
type == 1 )
{
client_print( id, print_chat, "%s La ronda %d fue ganada por los Terroristas.", _Prefix, gCountRound );

message_begin( MSG_ONE_UNRELIABLE, g_Message_ScreenFade, _, id );
write_short( ( UNIT_SECOND ) * 2 );
write_short( 0 );
write_short( FFADE_IN );
write_byte( 255 ); // color rojo
write_byte( 0 ); // color verde
write_byte( 0 ); // color azul
write_byte( 255 );
message_end( );
}

if(
type == 2 )
{
client_print( id, print_chat, "%s La ronda %d fue ganada por los Policias.", _Prefix, gCountRound );

message_begin( MSG_ONE_UNRELIABLE, g_Message_ScreenFade, _, id );
write_short( ( UNIT_SECOND ) * 2 );
write_short( 0 );
write_short( FFADE_IN );
write_byte( 0 ); // color rojo
write_byte( 68 ); // color verde
write_byte( 255 ); // color azul
write_byte( 255 );
message_end( );
}

if(
type == 3 ) client_print( id, print_chat, "%s La ronda %d fue empatada.", _Prefix, gCountRound );
}

/* ========================================================================= */


Saludos!