HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include < amxmodx >
  2. #include < dhudmessage >
  3. #include < zombieplague >
  4.  
  5. #define PLUGIN_NAME "[ZP] DHUD Informer"
  6. #define PLUGIN_VERSION "0.0.0.1"
  7. #define PLUGIN_AUTHOR "Andrei"
  8.  
  9. enum _: eTeamData
  10. {
  11. WIN_NO_ONE = 0,
  12. WIN_ZOMBIES,
  13. WIN_HUMANS
  14.  
  15. }; new g_iWin[ eTeamData ];
  16.  
  17. public plugin_init()
  18. {
  19. register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
  20.  
  21. register_dictionary( "zp_score.txt" );
  22. register_message( get_user_msgid( "TextMsg" ), "Message_TextMsg" );
  23. }
  24.  
  25. public Message_TextMsg( )
  26. {
  27. static szMessages[ 32 ];
  28. get_msg_arg_string( 2, szMessages, charsmax( szMessages ) );
  29.  
  30. if( equal( szMessages, "#Game_will_restart_in" ) )
  31. {
  32. g_iWin[ WIN_HUMANS ] = 0;
  33. g_iWin[ WIN_ZOMBIES ] = 0;
  34. g_iWin[ WIN_NO_ONE ] = 0;
  35. }
  36. }
  37.  
  38. public zp_round_started( )
  39. {
  40. set_task( 1.0, "Ctask__Update", _ ,_ ,_ , .flags = "b" );
  41. }
  42.  
  43. public zp_round_ended( iWinTeam )
  44. {
  45. switch( iWinTeam )
  46. {
  47. case WIN_HUMANS: g_iWin[ WIN_HUMANS ]++;
  48. case WIN_ZOMBIES: g_iWin[ WIN_ZOMBIES ]++;
  49. default: g_iWin[ WIN_NO_ONE ]++;
  50. }
  51.  
  52. remove_task();
  53. }
  54.  
  55.  
  56. public Ctask__Update( )
  57. {
  58. set_dhudmessage( .red = 0, .green = 255, .blue = 0, .x = -1.0, .y = 0.02, .effects = 0, .fxtime = 6.0, .holdtime = 2.0, .fadeintime = 1.0, .fadeouttime = 1.0, .reliable = false );
  59. show_dhudmessage( 0, "%L ", LANG_PLAYER, "SCORE_HUMANS", zp_get_human_count() );
  60. set_dhudmessage( .red = 100, .green = 100, .blue = 100, .x = -1.0, .y = 0.02, .effects = 0, .fxtime = 6.0, .holdtime = 2.0, .fadeintime = 1.0, .fadeouttime = 1.0, .reliable = false );
  61. show_dhudmessage( 0, "%L^n%L", LANG_PLAYER, "SCORE_ROUND", ( g_iWin[ WIN_HUMANS ] + g_iWin[ WIN_ZOMBIES ] + g_iWin[ WIN_NO_ONE ] ), LANG_PLAYER, "SCORE_WINS", g_iWin[ WIN_HUMANS ], g_iWin[ WIN_ZOMBIES ] );
  62. set_dhudmessage( .red = 255, .green = 0, .blue = 0, .x = -1.0, .y = 0.02, .effects = 0, .fxtime = 6.0, .holdtime = 2.0, .fadeintime = 1.0, .fadeouttime = 1.0, .reliable = false );
  63. show_dhudmessage( 0, " %L", LANG_PLAYER, "SCORE_ZOMBIES", zp_get_zombie_count() );
  64. }