HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Copyright 2016 Safety1st
  2.  
  3. 'Precache Info' is free software;
  4. you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18.  
  19. #include <amxmodx>
  20. #include <fakemeta>
  21.  
  22. #define PLUGIN "Precache Info"
  23. #define VERSION "0.1"
  24. #define AUTHOR "Safety1st"
  25.  
  26. /*----------------------EDIT ME-------------------------*/
  27. //#define SHOW_DETAILED_INFO // vedd ki a // jelet a # elől a bővebb precache infóhoz.
  28. /*------------------------------------------------------*/
  29.  
  30. new giFwdModel, giFwdSound, giFwdGeneric
  31. new giModelCount, giSoundCount, giGenericCount
  32.  
  33. public plugin_init() {
  34. register_plugin( PLUGIN, VERSION, AUTHOR )
  35.  
  36. unregister_forward( FM_PrecacheModel, giFwdModel )
  37. unregister_forward( FM_PrecacheSound, giFwdSound )
  38. unregister_forward( FM_PrecacheGeneric, giFwdGeneric )
  39.  
  40. server_print( "************************************^n[Precache info]" )
  41. server_print( " %d modell (modellek, spriteok); 512 max engedelyezett", giModelCount )
  42. server_print( " %d hang; 512 max engedelyezett", giSoundCount )
  43. server_print( " %3d altalanos (bmp, mp3, txt, res, ...); 512 max engedelyezett", giGenericCount )
  44. server_print( " %d osszesen.", giModelCount + giSoundCount + giGenericCount )
  45. server_print( "************************************" )
  46. }
  47.  
  48. public plugin_precache() {
  49. giFwdModel = register_forward( FM_PrecacheModel, "FM_PrecacheModel_Post", ._post = 1 )
  50. giFwdSound = register_forward( FM_PrecacheSound, "FM_PrecacheSound_Post", ._post = 1 )
  51. giFwdGeneric = register_forward( FM_PrecacheGeneric, "FM_PrecacheGeneric_Post", ._post = 1 )
  52. }
  53.  
  54. public FM_PrecacheModel_Post( const model[] ) {
  55. giModelCount++
  56.  
  57. #if defined SHOW_DETAILED_INFO
  58. server_print( "%3d: MODEL ^"%s^"", get_orig_retval(), model )
  59. #endif
  60. }
  61.  
  62. public FM_PrecacheSound_Post( const sound[] ) {
  63. giSoundCount++
  64.  
  65. #if defined SHOW_DETAILED_INFO
  66. server_print( "%3d: SOUND ^"%s^"", get_orig_retval(), sound )
  67. #endif
  68. }
  69.  
  70. public FM_PrecacheGeneric_Post( const generic[] ) {
  71. giGenericCount++
  72.  
  73. #if defined SHOW_DETAILED_INFO
  74. server_print( "%3d: GENERIC ^"%s^"", get_orig_retval(), generic )
  75. #endif
  76. }