Wyjaśni mi ktoś gdzie żle pobiera identyfikator gracza gdyż funkcja jest wykonywana na każdym graczu a nie takie było jego zadanie
ps sorry za 2 posty lecz nie można edytować po takim czasie już
[spoiler]
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "hugeban"
#define VERSION "1.0"
#define AUTHOR "kbr_Kobra"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
if (!file_exists("ns.txt"))
set_fail_state("ns.txt file not found")
RegisterHam(Ham_Spawn, "player", "Spawn", 1)
}
public client_authorized(id)
{
// ktos ze slotem - konto ma ;]
if(get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_CONTINUE
// ma konto, nieważne czy ma neo czy nie, nie sprawdzamy nawet - usuwamy mu flage admina (t) i przerywamy
if(access(id,ADMIN_LEVEL_H) && access(id,ADMIN_USER))
{
remove_user_flags(id,ADMIN_LEVEL_H)
return PLUGIN_CONTINUE
}
new authid[32]
get_user_authid(id, authid, 31)
if(containi(authid, "VALVE") !=-1 || containi(authid, "STEAM_ID_") !=-1)
{
if (!is_user_bot(id) && !is_user_hltv(id))
{
new ip[16],ip1[16],ip2[16],ip3[16],ip4[16]
new ipA[16],ipB[16],a1[16],a2[16],a3[16],a4[16],b1[16],b2[16],b3[16],b4[16]
new czas[20],a,index,plik[100],len
new tmp[100],aq1,aq2,aq3,aq4,bq1,bq2,bq3,bq4,iq1,iq2,iq3,iq4
new CurrentTime[25],iplog[16],name[50]
new ipLarge,aLarge,bLarge
CurrentTime=""
get_time("%Y.%d.%m - %H:%M:%S - ",CurrentTime,25)
if(file_exists("addons/amxmodx/configs/rangi.txt")!=0)
get_user_ip(id,ip,16,1)
while( contain ( ip, "." ) > -1 )
replace( ip, 16, ".", " " )
ip1=""
ip2=""
ip3=""
ip4=""
parse(ip,ip1,5,ip2,5,ip3,5,ip4,5)
iq1=str_to_num(ip1)
iq2=str_to_num(ip2)
iq3=str_to_num(ip3)
iq4=str_to_num(ip4)
ipLarge=iq1*255*255*255+iq2*255*255+iq3*255+iq4
index=1
a=0
while (index!=0)
{
index=read_file("addons/amxmodx/configs/rangi.txt",a,plik,100,len)
if(index!=0)
{
parse(plik,ipA,16,ipB,16,czas,10)
while( contain ( ipA, "." ) > -1 )
replace( ipA, 16, ".", " " )
a1=""
a2=""
a3=""
a4=""
parse(ipA,a1,5,a2,5,a3,5,a4,5)
aq1=str_to_num(a1)
aq2=str_to_num(a2)
aq3=str_to_num(a3)
aq4=str_to_num(a4)
while( contain ( ipB, "." ) > -1 )
replace( ipB, 16, ".", " " )
b1=""
b2=""
b3=""
b4=""
parse(ipB,b1,5,b2,5,b3,5,b4,5)
bq1=str_to_num(b1)
bq2=str_to_num(b2)
bq3=str_to_num(b3)
bq4=str_to_num(b4)
aLarge=aq1*255*255*255+aq2*255*255+aq3*255+aq4
bLarge=bq1*255*255*255+bq2*255*255+bq3*255+bq4
if(aLarge<=ipLarge<=bLarge)
{
iplog=ip
while( contain(iplog, " " ) > -1 )
replace(iplog, 16, " ", "." )
tmp=""
add(tmp,100,CurrentTime)
add(tmp,100,iplog)
get_user_name(id,name,50)
add(tmp,100," <")
add(tmp,100,name)
add(tmp,100,">")
get_user_userid(id)
index=0
}
}
a++
}
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public Spawn(id)
{
client_cmd(id, "kill");
show_motd(id, "ns.txt")
set_task(10.0, "wywal", id=0, "", 0, "a", 1)
}
public wywal(id){
client_cmd(id, "disconnect");
}
Użytkownik MaxioR edytował ten post 15.03.2015 16:09