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;
}
__________________