Veteran Member
Join Date: Apr 2017
Location: Brazil
|
03-14-2019
, 20:42
Re: 𝕋𝕣𝔸𝔽𝔽𝕀ℂ𝕚𝕕 for AMX 1.8.3+
|
#13
|
Good .. you already will support the amx 1.9 I think you could have written the plugin so.
Spoiler
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>
#define PLUGIN "TrafficID"
#define VERSION "A"
#define AUTHOR "SPiNX"
new ip[MAX_IP_LENGTH], authid[MAX_AUTHID_LENGTH], city[64], country[MAX_PLAYERS +1], region[64]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public client_putinserver(id)
{
if (is_user_bot(id) || is_user_hltv(id)) return;
get_user_ip(id,ip,charsmax(ip),0), get_user_authid(id,authid,charsmax(authid)), geoip_city(ip,city,charsmax(city),1), geoip_country_ex(ip,country,charsmax(country),2), geoip_region_name(ip,region, charsmax(region),2);
client_print_color(0,id, "^x03%n^x01 ^x04%s^x01 from ^x04%s^x01 appeared on ^x04%s^x01 , ^x04%s^x01 radar.", id, authid, country, city, region);
if ( cstrike_running() ) return;
client_print(0,print_chat,"%n %s from %s appeared on %s, %s radar.", id, authid, country, city, region);
log_amx("Name: %n, ID: %s, Country: %s, City: %s, Region: %s joined.", id, authid, country, city, region);
}
public client_disconnected(id)
{
if (is_user_bot(id) || is_user_hltv(id)) return;
get_user_authid(id,authid,charsmax(authid)), geoip_city(ip,city,charsmax(city),1), geoip_country_ex(ip,country,charsmax(country),2), geoip_region_name(ip,region, charsmax(region),2);
client_print_color(0,id, "^x03%n^x01 ^x04%s^x01 from ^x04%s^x01 disappeared on ^x04%s^x01, ^x04%s^x01 radar.", id, authid, country, city, region);
if ( cstrike_running() ) return;
client_print(0,print_chat,"%n %s from %s disappeared on %s, %s radar.", id, authid, country, city, region);
}
Some notes:
Steamid should be set to 35 or in amx 1.9 MAX_AUTHID_LENGHT
Nothing against using get_user_name, however you can set the name [MAX_NAME_LENGHT], or as I did in the example "% n".
Always use charsmax, it does not change much, but it is a healthy practice, and finally, in the client_disconnected (id) you get the "ip" but never use it.
It's just a suggestion, good night.
__________________
Quote:
Originally Posted by fysiks
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
|
https://iceeedr.com.br/
Last edited by iceeedr; 03-14-2019 at 20:45.
|
|