/* Copyright 2016 Safety1st
'Precache Info' is free software;
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Precache Info"
#define VERSION "0.1"
#define AUTHOR "Safety1st"
/*----------------------EDIT ME-------------------------*/
//#define SHOW_DETAILED_INFO // vedd ki a // jelet a # elől a bővebb precache infóhoz.
/*------------------------------------------------------*/
new giFwdModel, giFwdSound, giFwdGeneric
new giModelCount, giSoundCount, giGenericCount
public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR )
unregister_forward( FM_PrecacheModel, giFwdModel )
unregister_forward( FM_PrecacheSound, giFwdSound )
unregister_forward( FM_PrecacheGeneric, giFwdGeneric )
server_print( "************************************^n[Precache info]" )
server_print( " %d modell (modellek, spriteok); 512 max engedelyezett", giModelCount )
server_print( " %d hang; 512 max engedelyezett", giSoundCount )
server_print( " %3d altalanos (bmp, mp3, txt, res, ...); 512 max engedelyezett", giGenericCount )
server_print( " %d osszesen.", giModelCount + giSoundCount + giGenericCount )
server_print( "************************************" )
}
public plugin_precache() {
giFwdModel = register_forward( FM_PrecacheModel, "FM_PrecacheModel_Post", ._post = 1 )
giFwdSound = register_forward( FM_PrecacheSound, "FM_PrecacheSound_Post", ._post = 1 )
giFwdGeneric = register_forward( FM_PrecacheGeneric, "FM_PrecacheGeneric_Post", ._post = 1 )
}
public FM_PrecacheModel_Post( const model[] ) {
giModelCount++
#if defined SHOW_DETAILED_INFO
server_print( "%3d: MODEL ^"%s^"", get_orig_retval(), model )
#endif
}
public FM_PrecacheSound_Post( const sound[] ) {
giSoundCount++
#if defined SHOW_DETAILED_INFO
server_print( "%3d: SOUND ^"%s^"", get_orig_retval(), sound )
#endif
}
public FM_PrecacheGeneric_Post( const generic[] ) {
giGenericCount++
#if defined SHOW_DETAILED_INFO
server_print( "%3d: GENERIC ^"%s^"", get_orig_retval(), generic )
#endif
}