Advertisement
IdoGame

ixdoctor chat problem fixed

Sep 2nd, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 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. CmdPlayersInfo(client)
  33. }
  34.  
  35. else ColorChat(client,"You Need To Be Admin To Use This Menu")
  36.  
  37.  
  38.  
  39. }
  40.  
  41. public CmdPlayersInfo( client )
  42. {
  43. new szMenu[ 128 ];
  44.  
  45. formatex( szMenu, charsmax( szMenu ), "\d[ \yAdmins\d ] \yPlayers Info Menu \d( \yBy xDoctor\d )" )
  46.  
  47. new Menu = menu_create( szMenu, "CmdPlayersHandler" );
  48.  
  49. for( new i = 0; i < iMaxPlayers; i++ )
  50. {
  51. if(!is_user_connected(i))
  52. continue;
  53.  
  54. formatex( szMenu, charsmax( szMenu ), "\rPlayer\w: \y%s \w|| \yAuthId\w: \y%s \w|| \yUserIp\w: \y%s", GetUserName( i ), GetUserAuthId( i ), GetUserIp( i ) );
  55.  
  56. menu_additem( Menu, szMenu );
  57. }
  58.  
  59. menu_display( client, Menu, 0 );
  60.  
  61. return 1;
  62.  
  63. }
  64.  
  65. public CmdPlayersHandler( client, Menu, Item )
  66. {
  67. if( Item == MENU_EXIT )
  68. {
  69. menu_destroy( Menu );
  70.  
  71. return 1;
  72. }
  73.  
  74. return CmdPlayersInfo( client );
  75.  
  76. }
  77.  
  78. stock GetUserAuthId( const Index )
  79. {
  80. new iUserAuthId[ 35 ];
  81.  
  82. get_user_authid( Index, iUserAuthId, charsmax( iUserAuthId ) );
  83.  
  84. return iUserAuthId;
  85.  
  86. }
  87.  
  88. stock GetUserIp( const Index )
  89. {
  90. new iUserIp[ 35 ];
  91.  
  92. get_user_ip( Index, iUserIp, charsmax( iUserIp ) );
  93.  
  94. return iUserIp;
  95.  
  96. }
  97.  
  98. stock GetUserName( const Index )
  99. {
  100. new gNick[ 32 ];
  101.  
  102. get_user_name( Index, gNick, charsmax( gNick ) );
  103.  
  104. return gNick;
  105.  
  106. }
  107.  
  108. stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
  109. {
  110. new msg[191], players[32], count = 1
  111. static len
  112. len = formatex(msg, charsmax(msg), "^1[ ^4AMXX^1 ] ")
  113. vformat(msg[len], charsmax(msg) - len, string, 3)
  114. if(id) players[0] = id
  115. else get_players(players,count,"ch")
  116.  
  117. for (new i = 0; i < count; i++)
  118. {
  119. if(is_user_connected(players[i]))
  120. {
  121. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i])
  122. write_byte(players[i])
  123. write_string(msg)
  124. message_end()
  125. }
  126. }
  127.  
  128. return 1;
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement