I wanted wene any player go to a certin origin(area1), it will display the name on the HUD message.
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
new area1[3]={-711, 259, -2}
new origin[3]
new playername[32]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /test","hud")
}
public hud(id)
{
get_user_name(id, playername, 31)
get_user_origin(id, origin, 2)
if(get_distance(origin,area1) <= 100.0)
{
set_hudmessage(0,175,0,-1.5,0.95,2,0.0,99.9,0.0,0.0,2)
show_hudmessage(id,"%s",playername)
client_print(id, print_chat, "LOOK")
}
return PLUGIN_HANDLED
}
But in the HUD the name stays even wene theres no one at the origin.