Czy ktoś może postawić diagnozę, co jest nie tak?
#include <amxmodx>
#include <amxmisc>
#include <sockets>
#define PLUGIN "Azereus mod"
#define VERSION "1.32"
#define AUTHOR "podrurznik"
new gsz[512];
new show_msg=0;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(30.000, "CheckAllUser",0,"", 1,"b")
register_clcmd("az_run","CheckAllUser_test");
register_clcmd("az_kick","kicket");
}
public client_connect(id)
{
if (!is_user_bot(id))
CheckOneUser(id)
}
public kicket(idx)
{
client_cmd(idx,"echo [---- Zostales wyproszony z serwera----]");
client_cmd(idx,"wait");
client_cmd(idx,"disconnect");
}
public old_version(idx)
{
client_print(idx, print_chat, "[AZEREUS - Stara wersja pluginu, prosimy go zaktualizowac]")
}
public serwer_banned(idx)
{
client_print(idx, print_chat, "[AZEREUS - Ten serwer nie akceptacji grupy azereus.pl]")
}
public getWebContent(const szHost[], const szFile[], szOutPut[], iLen)
{
new socket,error;
socket = socket_open(szHost, 80, SOCKET_TCP, error);
if (socket > 0)
{
formatex(gsz, 511, "GET /%s^n^n", szFile);
socket_send(socket, gsz, iLen)
socket_recv(socket, szOutPut, iLen);
socket_close(socket);
return 1;
}
else
{
return 0;
}
}
public CheckOneUser(idx)
{
new adres2[8] = "&name="
new adres3[10] = "&serwer="
new ip[25]
new serwer[25]
get_user_ip ( idx, ip, 25,1)
get_user_ip ( 0, serwer, 25,0)
new name[32]
new adres[500] = "azer_ffa.php?mod=6&check_ip="
get_user_name(idx, name, 31)
add(adres,sizeof(adres),ip,sizeof(ip))
add(adres,sizeof(adres),adres2,sizeof(adres2))
add(adres,sizeof(adres),name,sizeof(name))
add(adres,sizeof(adres),adres3,sizeof(adres3))
add(adres,sizeof(adres),serwer,sizeof(serwer))
getWebContent("azereus.pl",adres, gsz, charsmax(gsz))
if (equal(gsz,"1",1))
kicket(idx)
}
public CheckAllUser_test(id)
{
show_msg=1
CheckAllUser(id)
show_msg=0
}
public CheckAllUser(id)
{
if (show_msg==1)
client_cmd(0,"echo [Sprawdzenia rozpoczete]")
new socket,error;
new user_search[32]
new palka[10] = "|"
new is_send=0;
//new my_name [32]
new name [32]
new user_cnt=0;
new sid[4]
new ip[25]
new adres[500] = "azer_ffa.php?mod=10&users="
get_user_ip ( 0, ip, 25,0)
add(adres,sizeof(adres),ip,sizeof(ip))
add(adres,sizeof(adres),palka,1)
new Players[32],Num
get_players(Players, Num)
if (show_msg==1)
client_cmd(0,"echo [num: %d]",Num);
for(new i=0;i<Num;i++)
{
if (show_msg==1)
client_cmd(0,"echo [sprawdzamy index: %d]",Players[i]);
user_cnt++
user_search[user_cnt]=Players[i]
num_to_str(Players[i], sid, 3);
get_user_ip(Players[i], ip, 25,1)
get_user_name(Players[i], name, 31)
if (contain(name, "|")!=-1)
name= "unknown"
if (contain(name, "&")!=-1)
name= "unknown"
if (contain(name, " ")!=-1)
name= "unknown"
add(adres,sizeof(adres),name,sizeof(name))
add(adres,sizeof(adres),palka,1)
add(adres,sizeof(adres),ip,sizeof(ip))
add(adres,sizeof(adres),palka,1)
add(adres,sizeof(adres),sid,sizeof(sid))
add(adres,sizeof(adres),palka,1)
if (user_cnt>10)
is_send=1
if (i==(Num-1))
is_send=1
if (is_send==1)
{
if (show_msg==1)
client_cmd(0,"echo Rusza iteracja przy num: %d",Num);
new odp[512]
socket = socket_open("azereus.pl", 80, SOCKET_TCP, error);
formatex(odp,511, "GET /%s^n^n", adres);
socket_send(socket, odp,charsmax(odp))
socket_recv(socket, odp,charsmax(odp));
socket_close(socket);
if (show_msg==1)
{
client_cmd(id,"echo [adres: %s]",adres);
client_cmd(id,"echo [odpowiedz: %s]",odp);
client_cmd(id,"echo [user_cnt: %d]",user_cnt);
}
for(new idx=1;idx<=user_cnt;idx++)
{
if (odp[idx]=='1')
{
if (show_msg==1)
client_cmd(0,"echo [niema azera dla ID: %d]",user_search[idx])
kicket(user_search[idx])
}
if (odp[idx]=='2')
if (show_msg==1)
client_cmd(0,"echo [jest ok dla indeksu %d]",user_search[idx]);
}
user_cnt=0
is_send=0
adres = "azer_ffa.php?mod=10&users="
get_user_ip ( 0, ip, 25,0)
add(adres,sizeof(adres),ip,sizeof(ip))
add(adres,sizeof(adres),palka,1)
}
}
}


Dodatki SourceMod



Temat jest zamknięty









