Raised This Month: $ Target: $400
 0% 

radiusrange


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-15-2007 , 15:15   radiusrange
Reply With Quote #1

Hi.I have this code...but is not working properly!
1.Not showing Hudmessage to everyone...
2.If i'm outside the range with 2 persons ..the Hudmessage "You are Outside the range of %s" is overwriting...
-I want to show something like this "You are Outside the range of "name1","name2","name3""

Thanks...
Attached Files
File Type: sma Get Plugin or Get Source (radius_range.sma - 627 views - 1.9 KB)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Old 04-15-2007, 16:08
Nican
This message has been deleted by Nican. Reason: D:
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 04-15-2007 , 16:09   Re: radiusrange
Reply With Quote #2

Your code makes no sense at all.
Why would you possibly need this irritating plugin?
"In range" of what? I suggest you stop writing this plugin, no one will download it.

If you still wanna write it...:
Whenever there is one person outside of the range no one inside will se a hudmsg since your second loop wich shouldn't even be there keeps counting until i is equal to num... then the first loop would end too, since i is equal to num.

Edit: Nican, your code is just retarded...
[ --<-@ ] Black Rose is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-15-2007 , 16:20   Re: radiusrange
Reply With Quote #3

D:
he sad
Quote:
-I want to show something like this "You are Outside the range of "name1","name2","name3""
I tried to to show all names in order of distance

I kind went off-course of what he wanted, i know, putting people inside too

Sorry D:
__________________
http://www.nican132.com
I require reputation!

Last edited by Nican; 04-15-2007 at 16:39.
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-16-2007 , 02:18   Re: radiusrange
Reply With Quote #4

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
Your code makes no sense at all.
Why would you possibly need this irritating plugin?
"In range" of what? I suggest you stop writing this plugin, no one will download it.

If you still wanna write it...:
Whenever there is one person outside of the range no one inside will se a hudmsg since your second loop wich shouldn't even be there keeps counting until i is equal to num... then the first loop would end too, since i is equal to num.

Edit: Nican, your code is just retarded...
In range of a player...!This is for me not for public posting or....,i want to know when someone is in my range...! But Thanks anyway...BlackRose

Nican:what was your code?...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 04-16-2007 , 16:56   Re: radiusrange
Reply With Quote #5

I dunno if this is what u wanted, but it tells you only who you are in range with.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fakemeta> #define PLUGIN "RadiusRange Announce" #define VERSION "1.0" #define AUTHOR "Remo Williams" #define DIST 1000.0 new or_id[32][3], or_ta[32][3], or_dist[32] new g_entid[32], g_entbody[32] new Float:s_origin[32][3] new g_hud_str[32][512] new g_hud_head[] = "You are in range of: "; new g_name[32][32] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public bool:is_player_in_range(id,tid) //IS "id" in range of "tid"? {     if(!is_user_alive(tid) || !is_user_connected(tid)) return false;         get_user_origin(id, or_id[id]);     get_user_origin(tid,or_ta[id]);     or_dist[id] = get_distance(or_id[id],or_ta[id])         if(or_dist[id] < DIST) return false;     return true; } public client_authorized(id) {     reset_data(id)     set_task(1.0,"com",id,_,_,"b") } public client_disconnect(id) {     reset_data(id) } reset_data(id) {     or_id[id][0] = 0     or_ta[id][0] = 0     or_dist[id] = 0     g_entid[id] = 0     g_entbody[id] = 0     g_hud_str[id][0] = 0     g_name[id][0] = 0     s_origin[id][0] = 0.0 } public com(id) {     new ent = 0, total = 0     pev(id,pev_origin,s_origin[id])         set_hudmessage(50,50,255, 0.02, 0.84, 1, 6.0, 2.0,0.1,0.2,-1);     new len = format(g_hud_str[id],511,"%s^n",g_hud_head)     while( (ent = find_ent_in_sphere(ent,s_origin[id],DIST)) != 0)     {         if(is_player_in_range(id,ent) && id != ent)         {             get_user_name(ent,g_name[ent],31)             len += format(g_hud_str[id][len],511-len,"%s^n",g_name[ent])             total++;         }     }     if(total > 0)     {         show_hudmessage(id,g_hud_str[id]);     }     return PLUGIN_HANDLED }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-16-2007 , 17:18   Re: radiusrange
Reply With Quote #6

eh... I did this:
PHP Code:
showplayers(id){
    new 
iplayer[32][2],count
    
    
for(i=1;i<=get_maxplayers();i++){
        if(!
is_user_connected(id))
            continue;
        if(!
is_user_alive(id))
            continue;
        
        
player[count][0] = i
        player
[count][1] = get_entity_distance(id,i)
        
count++
    }    
    
    
SortCustom2D(player,count,"stats_custom_compare")
    
    new 
message[480],pos,hasgonefar=0
    pos 
+= format(message[pos],480 pos,"Inside:^n")
    for(new 
i=0;i<=count-1;i++){
        new 
name[32]
        
get_user_name(player[count][0],name,32)
        
pos += format(message[pos],480 pos,"  %s^n"name)
        
        if(
player[count][1] > 1000 && hasgonefar == 0){
            
pos += format(message[pos],480 pos,"^nOutside:^n")
            
hasgonefar 1
        
}    
    }
    
set_hudmessage(255000.010.1506.012.00.00.03)
    
show_hudmessage(idmessage)
}

public 
stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
    return 
0;

__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Reply



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:44.


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