HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < dhudmessage >
  4.  
  5. #pragma semicolon 1
  6. #define MAX_RESTART 3
  7.  
  8. new const PLUGIN[] = "Live Plugin";
  9. new const VERSION[] = "2.0";
  10. new const AUTHOR[] = "[ZOF 'X]";
  11.  
  12. new iXYPos;
  13. new const Float:HUD_XY_POS[ ][ ] =
  14. {
  15. { -1.0, 0.90 },
  16. { -1.0, 0.80 },
  17. { -1.0, 0.70 },
  18. { -1.0, 0.60 },
  19. { -1.0, 0.50 },
  20. { -1.0, 0.40 },
  21. { -1.0, 0.30 },
  22. { -1.0, 0.20 },
  23. { -1.0, 0.10 }
  24. };
  25.  
  26. new pCvar;
  27. new iNumRounds, bool:GivenLive = false;
  28.  
  29. public plugin_init( )
  30. {
  31. register_plugin(PLUGIN,VERSION,AUTHOR);
  32.  
  33. register_event( "HLTV", "Event_NewRound", "a", "1=0", "2=0" );
  34. register_logevent( "logevent_RoundStart", 2, "1=Round_Start" );
  35.  
  36. pCvar = register_cvar( "amx_auto_live", "1" );
  37.  
  38. register_clcmd( "say /live", "cmd_live", ADMIN_KICK );
  39. register_clcmd( "say_team /live", "cmd_live", ADMIN_KICK );
  40.  
  41. register_clcmd( "say .live", "cmd_live", ADMIN_KICK );
  42. register_clcmd( "say_team .live", "cmd_live", ADMIN_KICK );
  43. }
  44.  
  45. public Event_NewRound( )
  46. {
  47. if( get_pcvar_num( pCvar ) && iNumRounds > 1 && !GivenLive ) {
  48. set_task( 0.1, "NotifyGivingLive" );
  49. set_task( 3.0, "GiveRestartRound", _, _, _, "a", MAX_RESTART );
  50. set_task( 12.0, "ShowHUD_LiveLive" );
  51. set_task( 19.0, "NotifyThat_LIVE" );
  52. GivenLive = true;
  53. }
  54. }
  55.  
  56. public logevent_RoundStart( )
  57. {
  58. if( !GivenLive ) iNumRounds++;
  59. }
  60.  
  61. public NotifyGivingLive( )
  62. {
  63. set_dhudmessage( 0, 160, 0, -1.0, 0.44, 0, 1.0, 3.0, 0.2, 0.3, false );
  64. show_dhudmessage( 0, "____________LIVE KEZDODIK 3 MP MULVA!____________" );
  65. }
  66.  
  67. public NotifyThat_LIVE( )
  68. {
  69. set_dhudmessage( 0, 160, 0, -1.0, 0.44, 0, 1.0, 3.0, 0.2, 0.3, false );
  70. show_dhudmessage( 0, "____________LIVE MEGY GO GO GO____________" );
  71. }
  72.  
  73. public GiveRestartRound( )
  74. {
  75. server_cmd( "sv_restartround ^"1^"" );
  76. }
  77.  
  78. public ShowHUD_LiveLive( )
  79. {
  80. set_task( 0.2, "HUD_LiveLive", _, _, _, "a", sizeof( HUD_XY_POS ) * 3 );
  81. }
  82.  
  83. public HUD_LiveLive( index )
  84. {
  85. if( iXYPos >= sizeof( HUD_XY_POS ) ) iXYPos = 0;
  86. set_dhudmessage( random_num( 0, 255 ), random_num( 0, 255 ), random_num( 0, 255 ), HUD_XY_POS[ iXYPos ][ 0 ], HUD_XY_POS[ iXYPos ][ 1 ], 0, 50.0, 0.4, 0.2, 0.3, false );
  87. show_dhudmessage( index, "[ L I V E ] [ L I V E ] [ L I V E ]" );
  88. iXYPos++;
  89. }
  90.  
  91. public cmd_live( index, level, cid )
  92. {
  93. if( !cmd_access( index, level, cid, 0 ) ) return PLUGIN_CONTINUE;
  94.  
  95. iXYPos = 0; GivenLive = true;
  96. set_task( 0.1, "NotifyGivingLive" );
  97. set_task( 3.0, "GiveRestartRound", _, _, _, "a", MAX_RESTART );
  98. set_task( 12.0, "ShowHUD_LiveLive" );
  99. set_task( 19.0, "NotifyThat_LIVE" );
  100. GivenLive = true;
  101.  
  102. return PLUGIN_CONTINUE;
  103. }
  104. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  105. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  106. */
  107.