Kod php:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <geoip>
#include <regex>
#include <colorchat>
#define PATTERN "^^([\|\*\[\]\-=^^]*)([\w\d^^\-t _@]+)([\|\*\[\]\-=^^]+)[\t ]?([\w\t @\-=\.!]+)$"
#define PLUGIN "Clan info"
#define VERSION "1.2"
#define AUTHOR "peku33"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("amx_clan_info_version", VERSION, FCVAR_SERVER);
}
public client_putinserver(id)
{
new name[33], ip[16], country[64]
get_user_name(id, name, 32);
get_user_ip(id, ip, 15, 1)
geoip_country(ip, country, 63);
new Regex:result, error[1], tag_b[33], tag[33], tag_e[33]
result = regex_match(name, PATTERN, error[0], error, 1)
if(result >= REGEX_OK)
{
regex_substr(result, 1, tag_b, 32);
regex_substr(result, 2, tag, 32);
regex_substr(result, 3, tag_e, 32);
regex_substr(result, 4, name, 32);
if(strlen(tag_b) < 1)
tag_e[0] = '^0'
ColorChat(0, RED, "Dolacza ^04%s ^01z klanu ^04%s%s%s. ^01Kraj: ^04%s, ^01ip: ^04%s", name, tag_b, tag, tag_e, country, ip);
regex_free(result);
}
else
{
ColorChat(0, RED, "Dolacza ^04%s. ^01Kraj: ^04%s, ^01ip: ^04%s", name, country, ip);
}
}