Raised This Month: $51 Target: $400
 12% 

[REQ] Make ADMIN_IMMUNITY's IP invisible to other admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
T0FF
Member
Join Date: Oct 2014
Location: Asia
Old 08-10-2015 , 10:23   [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #1

Description: It is join_ip plugin, which shows players' ip only to admins on connecting.

Requiredl/Request: Someone edit it so that the ip of ADMIN_IMMUNITY stays invisible even to other admins.

Code:
/* AMXX Mod script.
*
*
*  Join_IP 1.1 created by jsauce
* 
*
*  Okay so this plugin gets a user's info when they are authorized, then
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 
*  
*
*  
*
*  1.1 Changed access() to get_user_flags() seems to work better for everyone.
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A
*  1.0 initial release		// rank idea from Kindzhon's enter/leave plugin.
*
*/


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//	You must be using the csstats module and have stats plugins loaded.
//	Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B	// Change to something else if you like.

public plugin_init()
{
  register_plugin("Join IP","1.1","jsauce")
  
}
public client_authorized(id)
{
	set_task(0.5,"client_is_auth",id)
}

public client_is_auth(id)
{
	new authid[35],user[32],ip[32],players[32],inum
	get_user_name(id,user,31)
	get_user_ip(id,ip,31,1)
	get_user_authid(id,authid,34)
	get_players(players,inum)
	#if defined CSSTATS
	new izStats[8], izBody[8]
	new iRankPos, iRankMax
  	iRankPos = get_user_stats(id,izStats,izBody)
  	iRankMax = get_statsnum()
	for (new i = 0; i < inum; ++i)
	{
    		if(get_user_flags(players[i]) & ADMIN)
		{
      			client_print(players[i],print_chat,"%s (%s) (%s) (RANK: %i of %i) Is Connecting To Server ..",user,ip,authid,iRankPos,iRankMax)
      		}
      		else
		{ 
  			client_print(players[i],print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
  		}
  	}
	#else
	for (new i = 0; i < inum; ++i)
	{
    		if(get_user_flags(players[i]) & ADMIN)
		{
      			client_print(players[i],print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
      		}
      		else
		{ 
  			client_print(players[i],print_chat,"%s Is Connecting To Server ..",user)
  		}
  	}
	#endif
	return PLUGIN_CONTINUE
}



public client_disconnect(id)
{
	new authid[35],user[32],ip[32],players[32],inum
	get_user_name(id,user,31)
	get_user_ip(id,ip,31,1)
	get_user_authid(id,authid,34)
	get_players(players,inum)
	#if defined CSSTATS
	new izStats[8], izBody[8]
	new iRankPos, iRankMax
  	iRankPos = get_user_stats(id,izStats,izBody)
  	iRankMax = get_statsnum()
	for (new i = 0; i < inum; ++i)
	{
    		if(get_user_flags(players[i]) & ADMIN)
		{
      			client_print(players[i],print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
      		}
      		else
		{ 
  			client_print(players[i],print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
  		}
  	}
	#else
	for (new i = 0; i < inum; ++i)
	{
    		if(get_user_flags(players[i]) & ADMIN)
		{
      			client_print(players[i],print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
      		}
      		else
		{ 
  			client_print(players[i],print_chat,"%s Has Disconnected From Server!",user)
  		}
  	}
	#endif
	return PLUGIN_CONTINUE
}
Thanking in anticipation.
T0FF is offline
pillowCloud
Member
Join Date: Aug 2015
Location: AlliedModders
Old 08-10-2015 , 14:07   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #2

*I must say that i'm not a professional and not sure that this is the best solution

This is my solution (NOT TESTED):
PHP Code:
/* AMXX Mod script.
*
*
*  Join_IP 1.1 created by jsauce
*
*
*  Okay so this plugin gets a user's info when they are authorized, then
*  it displays it to everyone when they join and leave. If you are an admin you
*  get to see the user's ip address and steamid. All other user's just get to see
*  the player's name!
*
*
*
*
*  1.1 Changed access() to get_user_flags() seems to work better for everyone.
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin.
*
*/


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B    // Change to something else if you like.
    
public plugin_init()
{
    
register_plugin("Join IP","1.1","jsauce")
    
}
public 
client_authorized(id)
{
    
set_task(0.5,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) (RANK: %i of %i) Is Connecting To Server ..",user,authid,iRankPos,iRankMax)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) (RANK: %i of %i) Is Connecting To Server ..",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
        }
    }
    
#else
        
for (new 0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) Is Connecting To Server ..",user,authid)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s Is Connecting To Server ..",user)
        }
    }
    
#endif
    
return PLUGIN_CONTINUE
}



public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) (RANK: %i of %i) Has Disconnected From Server!",user,authid,iRankPos,iRankMax)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
        }
    }
    
#else
        
for (new 0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) Has Disconnected From Server!",user,authid)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s Has Disconnected From Server!",user)
        }
    }
    
#endif
    
return PLUGIN_CONTINUE


Last edited by pillowCloud; 08-10-2015 at 14:20.
pillowCloud is offline
T0FF
Member
Join Date: Oct 2014
Location: Asia
Old 08-12-2015 , 06:11   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #3

Quote:
Originally Posted by pillowCloud View Post
*I must say that i'm not a professional and not sure that this is the best solution

This is my solution (NOT TESTED):
PHP Code:
/* AMXX Mod script.
*
*
*  Join_IP 1.1 created by jsauce
*
*
*  Okay so this plugin gets a user's info when they are authorized, then
*  it displays it to everyone when they join and leave. If you are an admin you
*  get to see the user's ip address and steamid. All other user's just get to see
*  the player's name!
*
*
*
*
*  1.1 Changed access() to get_user_flags() seems to work better for everyone.
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin.
*
*/


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B    // Change to something else if you like.
    
public plugin_init()
{
    
register_plugin("Join IP","1.1","jsauce")
    
}
public 
client_authorized(id)
{
    
set_task(0.5,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) (RANK: %i of %i) Is Connecting To Server ..",user,authid,iRankPos,iRankMax)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) (RANK: %i of %i) Is Connecting To Server ..",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
        }
    }
    
#else
        
for (new 0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) Is Connecting To Server ..",user,authid)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s Is Connecting To Server ..",user)
        }
    }
    
#endif
    
return PLUGIN_CONTINUE
}



public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) (RANK: %i of %i) Has Disconnected From Server!",user,authid,iRankPos,iRankMax)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
        }
    }
    
#else
        
for (new 0inum; ++i)
    {
        if(
get_user_flags(players[i]) & ADMIN)
        {
            if ((
get_user_flags(players[i]) == ADMIN_IMMUNITY))
            {
                
client_print(players[i],print_chat,"%s (%s) Has Disconnected From Server!",user,authid)
            }
            else
            {
                
client_print(players[i],print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
            }
        }
        else
        {
            
client_print(players[i],print_chat,"%s Has Disconnected From Server!",user)
        }
    }
    
#endif
    
return PLUGIN_CONTINUE

Thanks for response. But Admin_IMMUNITY 's ip is still visible to other low level admins.
T0FF is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-12-2015 , 06:20   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #4

Code:
  if ((get_user_flags(players[i]) == ADMIN_IMMUNITY))
->
Code:
  if ((get_user_flags(players[i]) & ADMIN_IMMUNITY))
get_user_flags return a bitsum formed by all of user flags. Checking "==" means he must have only the ADMIN_IMMUNITY flag. Using & means that you are checking if the ADMIN_IMMUNITY flag is contained in the bitsum.

I have not checked the code, just spotted this mistake. There may be other things wrong.
__________________
HamletEagle is offline
T0FF
Member
Join Date: Oct 2014
Location: Asia
Old 08-12-2015 , 08:51   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Code:
  if ((get_user_flags(players[i]) == ADMIN_IMMUNITY))
->
Code:
  if ((get_user_flags(players[i]) & ADMIN_IMMUNITY))
get_user_flags return a bitsum formed by all of user flags. Checking "==" means he must have only the ADMIN_IMMUNITY flag. Using & means that you are checking if the ADMIN_IMMUNITY flag is contained in the bitsum.

I have not checked the code, just spotted this mistake. There may be other things wrong.
Thanks for pointing the mistake.
Bro can you correct the above code? I am a illiterate to coding.
Kindly, correct the mistake in above code, as you explained.
T0FF is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-12-2015 , 09:19   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #6

Code is bad, I have fixed some things, but there are more, anyway, try this:
PHP Code:
/* AMXX Mod script. 


*  Join_IP 1.1 created by jsauce 


*  Okay so this plugin gets a user's info when they are authorized, then 
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 




*  1.1 Changed access() to get_user_flags() seems to work better for everyone. 
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A 
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin. 

*/ 


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B    // Change to something else if you like.

public plugin_init()
{
    
register_plugin("Join IP","1.1","jsauce")

}
public 
client_authorized(id)
{
    
set_task(0.5,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
Flagsindex
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        
Flags get_user_flags(index)
        if(
Flags ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s)(RANK: %i of %i) Is Connecting To Server ..",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        
Flags get_user_flags(index)
        if(
get_user_flags(index) & ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(players[i],print_chat,"%s(%s) Is Connecting To Server ..",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Is Connecting To Server ..",user)
        }
    }
    
#endif
}



public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
Flagsindex
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        
Flags get_user_flags(index)
        if(
Flags ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s  (%s) (RANK: %i of %i) Has Disconnected From Server!",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        
Flags get_user_flags(index)
        if(
get_user_flags(index) & ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s) Has Disconnected From Server!",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Has Disconnected From Server!",user)
        }
    }
    
#endif

__________________

Last edited by HamletEagle; 08-12-2015 at 09:20.
HamletEagle is offline
T0FF
Member
Join Date: Oct 2014
Location: Asia
Old 08-12-2015 , 11:05   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
Code is bad, I have fixed some things, but there are more, anyway, try this:
PHP Code:
/* AMXX Mod script. 


*  Join_IP 1.1 created by jsauce 


*  Okay so this plugin gets a user's info when they are authorized, then 
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 




*  1.1 Changed access() to get_user_flags() seems to work better for everyone. 
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A 
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin. 

*/ 


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B    // Change to something else if you like.

public plugin_init()
{
    
register_plugin("Join IP","1.1","jsauce")

}
public 
client_authorized(id)
{
    
set_task(0.5,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
Flagsindex
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        
Flags get_user_flags(index)
        if(
Flags ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s)(RANK: %i of %i) Is Connecting To Server ..",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        
Flags get_user_flags(index)
        if(
get_user_flags(index) & ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(players[i],print_chat,"%s(%s) Is Connecting To Server ..",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Is Connecting To Server ..",user)
        }
    }
    
#endif
}



public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
Flagsindex
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        
Flags get_user_flags(index)
        if(
Flags ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s  (%s) (RANK: %i of %i) Has Disconnected From Server!",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        
Flags get_user_flags(index)
        if(
get_user_flags(index) & ADMIN)
        {
            if(
Flags ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s) Has Disconnected From Server!",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Has Disconnected From Server!",user)
        }
    }
    
#endif

[Problem]
Now, Admin_Immunity only sees "Playername is connecting to server .."
Doesn't even see players ip, whereas other low level admins can see players' ip.
T0FF is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-12-2015 , 11:51   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #8

PHP Code:
/* AMXX Mod script. 


*  Join_IP 1.1 created by jsauce 


*  Okay so this plugin gets a user's info when they are authorized, then 
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 




*  1.1 Changed access() to get_user_flags() seems to work better for everyone. 
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A 
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin. 

*/ 


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B    // Change to something else if you like.

public plugin_init()
{
    
register_plugin("Join IP","1.1","jsauce")

}
public 
client_authorized(id)
{
    
set_task(0.5,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
index
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s)(RANK: %i of %i) Is Connecting To Server ..",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(players[i],print_chat,"%s(%s) Is Connecting To Server ..",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Is Connecting To Server ..",user)
        }
    }
    
#endif
}



public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
index
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s  (%s) (RANK: %i of %i) Has Disconnected From Server!",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s) Has Disconnected From Server!",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Has Disconnected From Server!",user)
        }
    }
    
#endif

Oops, used the wrong index. Now ?
__________________
HamletEagle is offline
T0FF
Member
Join Date: Oct 2014
Location: Asia
Old 08-12-2015 , 12:42   Re: [REQ] Make ADMIN_IMMUNITY's IP invisible to other admins
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
/* AMXX Mod script. 


*  Join_IP 1.1 created by jsauce 


*  Okay so this plugin gets a user's info when they are authorized, then 
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 




*  1.1 Changed access() to get_user_flags() seems to work better for everyone. 
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A 
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin. 

*/ 


#include <amxmodx>
#include <amxmisc>

//#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_LEVEL_B    // Change to something else if you like.

public plugin_init()
{
    
register_plugin("Join IP","1.1","jsauce")

}
public 
client_authorized(id)
{
    
set_task(0.5,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
index
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s)(RANK: %i of %i) Is Connecting To Server ..",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Is Connecting To Server ..",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(players[i],print_chat,"%s(%s) Is Connecting To Server ..",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Is Connecting To Server ..",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Is Connecting To Server ..",user)
        }
    }
    
#endif
}



public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum
    get_user_name
(id,user,charsmax(user))
    
get_user_ip(id,ip,charsmax(ip),1)
    
get_user_authid(id,authid,charsmax(authid))
    
get_players(players,inum)
    new 
index
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
    iRankPos 
get_user_stats(id,izStats,izBody)
    
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s  (%s) (RANK: %i of %i) Has Disconnected From Server!",user,authid,iRankPos,iRankMax)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) (RANK: %i of %i) Has Disconnected From Server!",user,ip,authid,iRankPos,iRankMax)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s (RANK: %i of %i) Has Disconnected From Server!",user,iRankPos,iRankMax)
        }
    }
    
#else
    
for (new 0inum; ++i)
    {    
        
index players[i]
        if(
get_user_flags(index) & ADMIN)
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                
client_print(index,print_chat,"%s (%s) Has Disconnected From Server!",user,authid)
            }
            else 
            {
                
client_print(index,print_chat,"%s (%s) (%s) Has Disconnected From Server!",user,ip,authid)
            }
        }
        else
        { 
            
client_print(index,print_chat,"%s Has Disconnected From Server!",user)
        }
    }
    
#endif

Oops, used the wrong index. Now ?
Thanks brother you helped me.
It's working as i needed.

Last edited by T0FF; 08-12-2015 at 13:02.
T0FF is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode