Advertisement
iXdoctor

Players Console Log by xDoctor.

Jan 4th, 2015
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.38 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    "YES PROTECT" // YES == ENABLED, DONT == DISABLED //
  9.  
  10. enum _: gType
  11. {
  12.     LOG_IN,
  13.     LOG_OUT
  14. }
  15.  
  16. new const g_iProtectedSteamIDs [ ] [ ] =
  17. {
  18.     "STEAM_ID_LAN",
  19.     "VALVE_ID_LAN"
  20. }
  21.  
  22. new g_iTargetIp[ 33 ], g_iName[ 33 ], g_iSteamID[ 33 ], g_iType[ 33 ];
  23.  
  24. public plugin_init()            register_plugin( "Players Log Info", "1.0", "xDoctor" );
  25.  
  26. public client_connect( index )      ConsoleInfo( index, g_iType[ index ] = LOG_IN );
  27. public client_disconnect( index )   ConsoleInfo( index, g_iType[ index ] = LOG_OUT );
  28.  
  29. stock ConsoleInfo( const Player, const DidWhat )
  30. {
  31.     get_user_name( Player, g_iName, charsmax( g_iName ) );
  32.     get_user_authid( Player, g_iSteamID, charsmax( g_iSteamID ) );
  33.     get_user_ip( Player, g_iTargetIp, charsmax( g_iTargetIp ) );
  34.    
  35.     for( new i; i < get_maxplayers(); i++ )
  36.     {
  37.         if( get_user_flags( Player ) & PROTECT_ACCESS && PROTECT_ACCESS != ADMIN_ALL )
  38.             continue;
  39.        
  40.         if( equali( g_iSteamID, g_iProtectedSteamIDs[ i ] ) && contain( PROTECT_STEAMIDS, "YES" ) )
  41.             continue;
  42.            
  43.         if( get_user_flags( i ) & REQ_ACCESS && is_user_connected( i )  )
  44.             client_print( i, print_console, "%s %s. SteamID: %s, IP: %s", g_iName, DidWhat == LOG_IN ? "Connected" : "Disconnected", g_iSteamID, g_iTargetIp );
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement