]#include <amxmodx>
#include <amxmisc>
#define PLUGIN "myAC.Kick"
#define VERSION "1.1"
#define AUTHOR "Wonder"
#define MAX_IPS 50
#define KICKTIME 1
#define REASON "[myAC] It is required to start myAC.Client !!!"
new g_ips[MAX_IPS][16]
new g_config[64]
new g_ip
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_cfg() {
get_configsdir(g_config,63)
format(g_config,63,"%s/whitelist.txt",g_config)
load_settings()
}
public delayed_kick(userid) {
server_cmd("kick #%d %s", userid, REASON)
}
public client_connect(id){
new infoField[32]
new ip[16]
get_user_ip(id,ip,15,1)
for (new i=0; i<g_ip; ++i) {
if (equal(ip,g_ips)) {
return PLUGIN_CONTINUE
}
}
get_user_info(id, "*myAC", infoField, 32)
if (strlen(infoField) <= 0) {
new userid=get_user_userid(id)
set_task(float(KICKTIME), "delayed_kick", userid)
}
return PLUGIN_CONTINUE
}
public load_settings() {
if (!file_exists(g_config)) {
return PLUGIN_CONTINUE
}
new string[16],line,len
while (read_file(g_config,line++,string,15,len)) {
if (string[0]==';' || !len) continue
copy(g_ips[g_ip],15,string)
g_ip++
}
return PLUGIN_CONTINUE
}
help me edit scripting no block hltv connect server
#include <amxmisc>
#define PLUGIN "myAC.Kick"
#define VERSION "1.1"
#define AUTHOR "Wonder"
#define MAX_IPS 50
#define KICKTIME 1
#define REASON "[myAC] It is required to start myAC.Client !!!"
new g_ips[MAX_IPS][16]
new g_config[64]
new g_ip
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_cfg() {
get_configsdir(g_config,63)
format(g_config,63,"%s/whitelist.txt",g_config)
load_settings()
}
public delayed_kick(userid) {
server_cmd("kick #%d %s", userid, REASON)
}
public client_connect(id){
new infoField[32]
new ip[16]
get_user_ip(id,ip,15,1)
for (new i=0; i<g_ip; ++i) {
if (equal(ip,g_ips)) {
return PLUGIN_CONTINUE
}
}
get_user_info(id, "*myAC", infoField, 32)
if (strlen(infoField) <= 0) {
new userid=get_user_userid(id)
set_task(float(KICKTIME), "delayed_kick", userid)
}
return PLUGIN_CONTINUE
}
public load_settings() {
if (!file_exists(g_config)) {
return PLUGIN_CONTINUE
}
new string[16],line,len
while (read_file(g_config,line++,string,15,len)) {
if (string[0]==';' || !len) continue
copy(g_ips[g_ip],15,string)
g_ip++
}
return PLUGIN_CONTINUE
}
help me edit scripting no block hltv connect server