Advertisement
iXdoctor

Players Info Menu

May 13th, 2014
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.42 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < amxmisc >
  5.  
  6. new iMaxPlayers;
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin( "Players Info Check", "1.0", "iXdoctor" );
  11.    
  12.     register_clcmd( "say", "HandleSay" );
  13.    
  14.     register_clcmd( "say_team", "HandleSay" );
  15.    
  16.     iMaxPlayers = get_maxplayers();
  17. }
  18.  
  19.  
  20. public HandleSay( client )
  21. {
  22.     new iMessage[ 191 ];
  23.    
  24.     read_args( iMessage, charsmax( iMessage ) );
  25.    
  26.     remove_quotes( iMessage );
  27.    
  28.    
  29.     if( equali( iMessage, "/playersinfo" ) )
  30.     {
  31.         if( !is_user_admin( client ) )
  32.             return ColorChat( client, "You are not allowed to use this because you are not admin." )
  33.            
  34.         else
  35.             CmdPlayersInfo( client );
  36.            
  37.         }
  38.        
  39.     return 1;
  40. }
  41.  
  42. public CmdPlayersInfo( client )
  43. {
  44.     new szMenu[ 128 ];
  45.    
  46.     formatex( szMenu, charsmax( szMenu ), "\d[ \yAdmins\d ] \yPlayers Info Menu \d( \yBy xDoctor\d )" )
  47.    
  48.     new Menu = menu_create( szMenu, "CmdPlayersHandler" );
  49.    
  50.     for( new i = 0; i < iMaxPlayers; i++ )
  51.     {
  52.         if(!is_user_connected(i))
  53.             continue;
  54.        
  55.         formatex( szMenu, charsmax( szMenu ), "\rPlayer\w: \y%s \w|| \yAuthId\w: \y%s \w|| \yUserIp\w: \y%s", GetUserName( i ), GetUserAuthId( i ), GetUserIp( i ) );
  56.        
  57.         menu_additem( Menu, szMenu );
  58.     }
  59.    
  60.     menu_display( client, Menu, 0 );
  61.    
  62.     return 1;
  63.        
  64. }
  65.  
  66. public CmdPlayersHandler( client, Menu, Item )
  67. {
  68.     if( Item == MENU_EXIT )
  69.     {
  70.         menu_destroy( Menu );
  71.        
  72.         return 1;  
  73.     }
  74.    
  75.     return CmdPlayersInfo( client );
  76.    
  77. }
  78.  
  79. stock GetUserAuthId( const Index )
  80. {
  81.     new iUserAuthId[ 35 ];
  82.    
  83.     get_user_authid( Index, iUserAuthId, charsmax( iUserAuthId ) );
  84.    
  85.     return iUserAuthId;
  86.    
  87. }
  88.  
  89. stock GetUserIp( const Index )
  90. {
  91.     new iUserIp[ 35 ];
  92.    
  93.     get_user_ip( Index, iUserIp, charsmax( iUserIp ) );
  94.    
  95.     return iUserIp;
  96.    
  97. }
  98.  
  99. stock GetUserName( const Index )
  100. {
  101.     new gNick[ 32 ];
  102.    
  103.     get_user_name( Index, gNick, charsmax( gNick ) );
  104.    
  105.     return gNick;
  106.    
  107. }
  108.  
  109. stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
  110. {
  111.     new msg[191], players[32], count = 1
  112.     static len
  113.     len = formatex(msg, charsmax(msg), "^1[ ^4AMXX^1 ] ")
  114.     vformat(msg[len], charsmax(msg) - len, string, 3)
  115.     if(id)    players[0] = id
  116.     else    get_players(players,count,"ch")
  117.    
  118.     for (new i = 0; i < count; i++)
  119.     {
  120.         if(is_user_connected(players[i]))
  121.         {
  122.             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i])
  123.             write_byte(players[i])
  124.             write_string(msg)
  125.             message_end()
  126.         }
  127.     }
  128.    
  129.     return 1;
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement