Код
#include <amxmodx>
#include <amxmisc>
#define DP_AUTH_NONE 0
#define DP_AUTH_DPROTO 1
#define DP_AUTH_STEAM 2
#define DP_AUTH_STEAMEMU 3
#define DP_AUTH_REVEMU 4
#define DP_AUTH_OLDREVEMU 5
#define DP_AUTH_HLTV 6
#define DP_AUTH_SC2009 7
#define DP_AUTH_AVSMP 8
new pcv_dp_provider
public plugin_init() {
register_plugin("All Info", "1.4", "Rockon")
pcv_dp_provider = get_cvar_pointer("dp_r_id_provider")
}
public client_putinserver(id) {
server_cmd("dp_clientinfo %d", id)
server_exec()
new namedate[32], datetime[64], authid[32], usrip[32], name[32], auth_prov_str[32]
new logname1[128], logname2[128], message1[264], message2[264]
get_time("%d.%m.%Y", namedate, 31)
get_time("%H:%M:%S", datetime, 63)
get_user_authid(id, authid, 31)
get_user_ip(id, usrip, 31, 1)
get_user_name(id, name, 31)
new authprov = get_pcvar_num(pcv_dp_provider)
switch (authprov)
{
case DP_AUTH_NONE: copy(auth_prov_str, 32, "N/A")
case DP_AUTH_DPROTO: copy(auth_prov_str, 32, "dproto")
case DP_AUTH_STEAM: copy(auth_prov_str, 32, "STEAM")
case DP_AUTH_STEAMEMU: copy(auth_prov_str, 32, "SteamEmu")
case DP_AUTH_REVEMU: copy(auth_prov_str, 32, "RevEmu")
case DP_AUTH_OLDREVEMU: copy(auth_prov_str, 32, "Old RevEmu")
case DP_AUTH_HLTV: copy(auth_prov_str, 32, "HLTV")
case DP_AUTH_SC2009: copy(auth_prov_str, 32, "SteamClient2009")
case DP_AUTH_AVSMP: copy(auth_prov_str, 32, "AVSMP")
default: copy(auth_prov_str, 32, "Erroneous") //-1 if slot id is invalid
}
if(!is_user_connected(id)) return PLUGIN_HANDLED
if(get_user_flags(id) & ADMIN_USER ) {
format(message1, 264, "%s |%-32s|%-22s|%-15s| %s", datetime, name, authid, usrip, auth_prov_str)
format(logname1, 127, "addons\amxmodx\OtherLogs\players\%s_allinfo_players.log", namedate)
write_file(logname1, message1)
format(message1, 264, "%s %s |%-32s|%-22s|%-15s| %s", namedate, datetime, name, authid, usrip, auth_prov_str)
format(logname1, 127, "addons\amxmodx\OtherLogs\players\allinfo_players.log")
write_file(logname1, message1)
} else {
format(message2, 264, "%s |%-32s|%-22s|%-15s| %s", datetime, name, authid, usrip, auth_prov_str)
format(logname2, 127, "addons\amxmodx\OtherLogs\admins\%s_allinfo_admins.log", namedate)
write_file(logname2, message2)
format(message2, 264, "%s %s |%-32s|%-22s|%-15s| %s", namedate, datetime, name, authid, usrip, auth_prov_str)
format(logname2, 127, "addons\amxmodx\OtherLogs\admins\allinfo_admins.log")
write_file(logname2, message2)
}
return PLUGIN_HANDLED
}