Raised This Month: $ Target: $400
 0% 

Finding Players near Player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-02-2011 , 16:52   Re: Finding Players near Player
Reply With Quote #10

Code:
#include <amxmodx> #include <engine> /* distance around player for teammates to be in */ #define TEAMMATE_RADIUS     100.0 /* how many teammates must be around the player */ #define TEAMMATE_COUNT      3 /* how long (in seconds) teammates must be around player to unfreeze */ #define UNFREEZE_TIME       7.0 public client_PreThink(id) {     static Float:start[33];         if( gfFrost[id] )     {         if( start[id] > 0.0 )         {             if( GetTeammateRadius(id, TEAMMATE_RADIUS) >= TEAMMATE_COUNT )             {                 if( (get_gametime() - start[id]) >= UNFREEZE_TIME )                 {                     /* unfreeze player */                     odmroz(id);                                         start[id] = 0.0;                 }             }             else             {                 start[id] = 0.0;             }         }         else if( GetTeammateRadius(id, TEAMMATE_RADIUS) >= TEAMMATE_COUNT )         {             start[id] = get_gametime();         }     }     else     {         start[id] = 0.0;     } } GetTeammateRadius(id, Float:radius) {     new players[32];     new pnum = find_sphere_class(id, "player", radius, players, 32);         new team = get_user_team(id);         for( new i = 0; i < pnum; i++ )     {         if( get_user_team(players[i]) != team )         {             players[i--] = players[--pnum];         }     }         return pnum; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 14:33.


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