Advertisement
iXdoctor

NEW NEW LOG VERISON

Jan 5th, 2015
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.71 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < amxmisc >
  5.  
  6. #define REQ_ACCESS  ADMIN_CHAT
  7. #define PROTECT_ACCESS  ADMIN_IMMUNITY
  8. #define PROTECT_STEAMIDS 1 // 1 == On, 0 == Off //
  9. #define LOG_NAME    "Console_Log"
  10.  
  11. new const g_iProtectedSteamIDs [ ] [ ] =
  12. {
  13.     "STEAM_ID_LAN",
  14.     "VALVE_ID_LAN"
  15. }
  16.  
  17. new szFile[ 64 ], szFileDir[ 32 ];
  18.  
  19. public plugin_init()
  20. {
  21.     register_plugin( "Players Log Info", "1.0", "xDoctor" );
  22.    
  23.     get_configsdir( szFileDir, charsmax( szFileDir ) );
  24.    
  25.     format( szFile, charsmax( szFile ), "%s/%s.ini", szFileDir, LOG_NAME );
  26.    
  27.     if( !file_exists( szFile ) )
  28.         write_file( szFile, "; Players Enter LOG CREATED ;" );
  29. }
  30.  
  31. public client_connect( index )      ConsoleInfo( index, 1 );
  32. public client_disconnect( index )   ConsoleInfo( index, 0 );
  33.  
  34. ConsoleInfo( const Player, DidWhat )
  35. {
  36.     new g_iTargetIp[ 33 ], g_iName[ 33 ], g_iSteamID[ 33 ], count;
  37.  
  38.     get_user_name( Player, g_iName, charsmax( g_iName ) );
  39.     get_user_authid( Player, g_iSteamID, charsmax( g_iSteamID ) );
  40.     get_user_ip( Player, g_iTargetIp, charsmax( g_iTargetIp ) );
  41.    
  42.     for( new i; i < get_maxplayers(); i++ )
  43.     {
  44.         if( get_user_flags( Player ) & PROTECT_ACCESS && PROTECT_ACCESS != ADMIN_ALL )
  45.             continue;
  46.        
  47.         if( equali( g_iSteamID, g_iProtectedSteamIDs[ i ] ) && PROTECT_STEAMIDS == 1 )
  48.             continue;
  49.            
  50.         if( get_user_flags( i ) & REQ_ACCESS && is_user_connected( i ) )
  51.             client_print( i, print_console, "%s %s. SteamID: %s, IP: %s", g_iName, DidWhat == 1 ? "Connected" : "Disconnected", g_iSteamID, g_iTargetIp );
  52.            
  53.         count = i;
  54.     }
  55.    
  56.     log_to_file( szFile, "Printed to %i Online Admins, %s %s. SteamID: %s, IP: %s", count, g_iName, DidWhat == 1 ? "Connected" : "Disconnected", g_iSteamID, g_iTargetIp );
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement