Code:
#include <amxmodx>
#include <cstrike>
#define PLUGIN "Test"
#define AUTHOR "Jim"
#define VERSION "1.0"
new g_maxplayers
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("amx_ghosters", "check")
g_maxplayers = get_maxplayers()
}
public check(id)
{
if(!(get_user_flags(id) & ADMIN_BAN))
return PLUGIN_CONTINUE
new ip[16], tempip[16], CsTeams:team
new tag
for(new i = 1; i <= g_maxplayers; i++)
{
if(!is_user_connected(i))
continue
team = cs_get_user_team(i)
get_user_ip(i, ip, 15, 1)
for(new j = i + 1; j <= g_maxplayers; j++)
{
if(!is_user_connected(j))
continue
if(cs_get_user_team(j) != team)
{
get_user_ip(j, tempip, 15, 1)
if(equal(ip, tempip))
{
tag = 1
tell_admin(i, j, id)
}
}
}
}
if(!tag)
client_print(id, print_chat, "[AMXX] No Ghosters Were Found")
return PLUGIN_HANDLED
}
public tell_admin(a, b, admin)
{
new namea[32], nameb[32]
get_user_name(a, namea, 31)
get_user_name(b, nameb, 31)
client_print(admin, print_chat, "[AMXX] %s and %s got same IP.", namea, nameb)
}