So.... If you are within the radius of another player your screen is spammed with hud_messages "You are within.......blah blah...", of all the players you are close too. At the same time your screen is spammed with hud_messages "You are NOT within... blah blah...", of all the players you are NOT close too.
Code:
public function(id)
{
new players[32];
new num;
get_players(players, num, "a");
for(new i = 0; i < num; i++) {
if( (is_user_alive(players[i]) && is_user_alive(id)) && (is_user_connected(players[i]) && is_user_connected(id)) )
{
new distance;
new origin1[3], origin2[3];
new radius = 700;
new tempname[33];
get_user_name(players[i], tempname, 32);
get_user_origin(players[i], origin1);
get_user_origin(id, origin2);
distance = get_distance(origin1, origin2);
if(distance < radius)
{
// WITHIN RADIUS OF PLAYER
set_hudmessage(255, 212, 42, -1.0, -1.0, 0, 15.0, 30.0, 0.0, 0.99, 4);
show_hudmessage(id, "You are INSIDE RANGE of %s", tempname);
}
else {
// OUTSIDE RADIUS OF PLAYER
set_hudmessage(255, 212, 42, -1.0, -1.0, 0, 15.0, 30.0, 0.0, 0.99, 4);
show_hudmessage(id, "You are OUTSIDE RANGE of %s", tempname);
}
}
}
set_task(1.0, "function", id);
return 0;
}
I am trying to figure out how to make the "NOT WITHIN" hud_messages not override the "WITHIN" messages.. The player does'nt need to see he is not "WITHIN" another players radius if he is currently "WITHIN" a players radius.
Hud channels and/or coodernates is not what I'm looking to get help in here. I need someone to show me some code that would not permit the "NOT WITHIN" function from being ran IF there is currently a "WITHIN" function being ran on the player. (id)
I've been messing with it for a few now and just get caught in these stupid loops of dumbness... Heck even if there's another better way to do what I'm looking for..
thanks for your help..
__________________