I'm making plugin with would write a message to a connected player by the IP adress.
And I'm not sure do i need to check once again IP in "announcment" function?
PHP Code:
#include <amxmodx>
#include <amxmisc>
new ip_set;
new g_IP[33];
public plugin_init()
{
register_plugin("IP Announc", "1.0", "GhostMan");
ip_set = register_cvar("amx_ipannounc", "11.22.33.44");
}
public client_putinserver(id)
{
get_user_ip(id, p_IP, charsmax(p_IP), 0);
if(g_IP[id] == ip_set)
{
set_task(35.0, "announcment")
}
}
public announcment(id)
{
if(g_IP[id] == ip_set)
{
new p_Name[33];
get_user_name(id, p_Name, charsmax(p_Name))
set_hudmessage(255, 255, 0, -1.0, -1.0, 1, 6.0, 8.0)
show_hudmessage(id, "Hello %s", p_Name)
}
}