Thread: [INC] debug
View Single Post
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-26-2017 , 01:36   Re: debug.inc
Reply With Quote #15

As an example of using this inc i use it just for curiostiy to see wich one is called faster, plugin_natives() / CFg / Precahe and Init with the following code:

PHP Code:
#include <amxmodx>
#include <debug>

public plugin_init( )
    
debug_log1DEBUG_SERVER_CONSOLE"Plugin Init" );

public 
plugin_precache()
    
debug_log1DEBUG_SERVER_CONSOLE"Precahe" );

public 
plugin_cfg( )
    
debug_log1DEBUG_SERVER_CONSOLE"Plguin Cfg" );

public 
plugin_natives( )
    
debug_log1DEBUG_SERVER_CONSOLE"Plugin Natives" ); 
Output:

Code:
L 05/26/2017 - 08:32:11: -------- Mapchange to de_dust2 --------
[Map: de_dust2, Time: 8:32] Plugin Natives
[Map: de_dust2, Time: 8:32] Precahe
[Map: de_dust2, Time: 8:32] Plugin Init
[Map: de_dust2, Time: 8:32] Plguin Cfg
Another think was to make a plugin that anytime i touch an entity to print me a message with its classsanem and index, i used FM_Touch to detect any kind of entity because i wanne see about all of them:

PHP Code:
#include <amxmodx>
#include <debug>
#include <fakemeta>


public plugin_init( )
{
    
register_forward(FM_Touch,"fwd_touch")
}

public 
fwd_touchent,id )
{
    if( !
pev_valid(ent) || !id )    
        return 
PLUGIN_HANDLED;

    new 
classname[32];
    
pev(entpev_classnameclassnamecharsmax(classname) );

    
debug_log1DEBUG_PLAYERS_CHAT"Classname: %s | Index: %i"classnameent );

    return 
PLUGIN_CONTINUE;


Last edited by Craxor; 05-26-2017 at 01:38.
Craxor is offline
Send a message via ICQ to Craxor