plugin do pokazywania ip graczy dodatkowo piszę czy gracz ma zmienne ip
zakresy są dodane przeze mnie i można je samemu zmieniać/dodawać
plik zmienne wrzucić do configs
addons/amxmodx/configs/zmienne.txt
a .sma skompilować i wrzucić do plugins i dopisać w plugins.ini nazwe pluginu
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
#define MAX_WORD_NUM 128
new ips[MAX_WORD_NUM][10]
new len[MAX_WORD_NUM]
new num
public plugin_init()
{
register_concmd("amx_ip","ShowIP");
new ipnum = read_wordfile();
new pluginname[33];
formatex(pluginname, 32, "IP (%d zakresow)", ipnum);
register_plugin(pluginname, VERSION, AUTHOR);
}
public read_wordfile()
{
new line, filename[] = "addons/amxmodx/configs/zmienne.txt";
if(!file_exists(filename))
set_fail_state("Plik z zakresami nie istnieje");
while(num < MAX_WORD_NUM && read_file(filename, line++, ips[num], 9, len[num]))
if(ips[num][0] != ';') num++;
return num
}
public is_dynamic_ip(ip[])
{
for(new x = 0; x < num; ++x)
if(equal(ip,ips[x]))
return true;
return false;
}
public is_steam(auth[])
{
if(contain(auth, "STEAM_0:0:") != -1 || contain(auth, "STEAM_0:1:") != -1)
return true;
return false;
}
public ShowIP(id)
{
new szIP[16] , szName[33], szAuth[25], tempIP[16], tempIP1[6], tempIP2[6];
new Players[32] , pnum;
get_players( Players , pnum , "c");
console_print(id , "^n^nNick Adres IP Gra^n");
for(new i = 0; i < pnum; i++)
{
get_user_ip(Players[i],szIP , 15 , 1);
get_user_name(Players[i] , szName , 32);
get_user_authid(Players[i], szAuth, 24);
copy(tempIP, 15, szIP);
while(contain(tempIP, ".") > -1)
replace(tempIP, 15, ".", " ");
parse(tempIP, tempIP1, 5, tempIP2, 5);
formatex(tempIP, 9, "%s.%s", tempIP1, tempIP2);
console_print(id , "%s %s %s%s", szName , szIP, is_steam(szAuth) ? "Klient STEAM" : "Klient NonSteam", is_dynamic_ip(tempIP) ? " Zmienny adres IP" : "");
}
return PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
advanced_amx_ip.sma
zmienne.txt