Raised This Month: $ Target: $400
 0% 

Player Radius Issues


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
raa
Senior Member
Join Date: Oct 2005
Old 04-13-2007 , 03:58   Player Radius Issues
Reply With Quote #1

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..
__________________

Last edited by raa; 04-13-2007 at 04:17.
raa is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode