Jump to content
GIGN Forum

Xlist


Recommended Posts

Te pat forumā atradu šo plaginu, bet ir dažas nepilnības, kuras es vēlētos lai palīdz atrisināt! Ir tā, kad rakstot x_ips viņš parāda cs logu, kurā vairākās rinās sarakstīts spēlētāja niks, pēc nika ip! Bet kā to visu iedabūt konsolē?

/* AMX Mod script.

*

*

*

*/

#include <amxmod>

#include <amxmisc>

public admin_banip(id, level, cid) {

if (!cmd_access(id, level, cid, 2))

return PLUGIN_HANDLED

new ban_time = 0

new ip[16]

read_argv(1, ip, 15)

new ban_times[13]

read_argv(2, ban_times, 12)

ban_time = str_to_num(ban_times)

if(!ban_time)

ban_time = 0

new authid[16], name[32]

get_user_authid(id,authid,15)

get_user_name(id,name,31)

log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^" ban ^"%s^" (minutes ^"%i^") (reason ^"^")", name,get_user_userid(id),authid, ip, ban_time)

new srvcmd[65]

format(srvcmd, 64, "addip %i %s", ban_time, ip)

if (ban_time == 0) {

server_cmd("addip 0 %s; writeip", ip)

} else {

server_cmd("addip %d %s", ban_time, ip)

}

return PLUGIN_HANDLED_MAIN

}

public admin_unbanip(id, level, cid) {

if (!cmd_access(id, level, cid, 2))

return PLUGIN_HANDLED

new ip[16]

read_argv(1, ip, 15)

new authid[16], name[32]

get_user_authid(id,authid,15)

get_user_name(id,name,31)

log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^" unban ^"%s^" (reason ^"^")", name,get_user_userid(id),authid, ip)

server_cmd("removeip %s; writeip", ip)

return PLUGIN_HANDLED_MAIN

}

public admin_ips(id) {

new players[32], inum, name[33], buf[2049], ip[17], tempn[35], temp[65]

get_players(players, inum)

new i

for(i = 0; i < inum; i++) {

get_user_name(players, name, 32)

get_user_ip(players, ip, 16, 1)

copy(tempn, 32, name)

// add(tempn, 34, "...........................................", 34)

format(temp, 64, "%s ... %s^n", tempn, ip)

add(buf, 2048, temp)

}

show_motd(id, buf, "Player's IP")

return PLUGIN_CONTINUE

}

public admin_ipl(id) {

new buf[2049], ip[33], temp[65]

new len

if (file_exists("listip.cfg")) {

for(new i=0; i < 100 && read_file("listip.cfg", i, ip, 32, len) != 0; i += 1) {

read_file("listip.cfg", i, ip, 32, len)

format(temp, 32, "%s ^n", ip)

add(buf, 2048, temp)

}

}

show_motd(id, buf, "Banned IP")

return PLUGIN_CONTINUE

}

public plugin_init()

{

register_plugin("IPTools", "1.05", "SYZo")

register_clcmd("amx_ips", "admin_ips", 0)

register_clcmd("amx_ipl", "admin_ipl", ADMIN_BAN)

register_concmd("amx_banip", "admin_banip", ADMIN_BAN, "<ip address> [time]")

register_concmd("amx_unbanip", "admin_unbanip", ADMIN_BAN,"<ip address>")

return PLUGIN_CONTINUE

}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }

*/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...