Depending on what functionality you are looking for, you will have to modify this code. I set it up so that it checks every 2 seconds if a player is within the radius and makes them solid_not if they're within the radius.
If you want them to never collide, you can either lower the seconds for the set_task or use client_prethink/postthink. I would go with lowering the set_task seconds.
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Kamil"
new cvar_collisions
new players[32], playersnum
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_collisions = register_cvar("no_collisions", "1")
start_preventing()
}
public start_preventing()
{
if(!get_pcvar_num(cvar_collisions)) return PLUGIN_HANDLED
set_task(2.0, "all_players_function", 0, "", 0, "b")
}
public all_players_function()
{
get_players(players, playersnum, "ah")
for(new i = 0; i < playersnum; i++)
{
prevent_collide(players[i])
}
}
public prevent_collide(id)
{
new origin[3]
new player[1]
new Float:radius = 100.0
get_user_origin(id, origin, 0)
find_sphere_class(id, "player", radius, player, 1)
if(id != player[0])
{
entity_set_int(id, EV_INT_solid, SOLID_NOT)
entity_set_int(player[0], EV_INT_solid, SOLID_NOT)
}
else
{
entity_set_int(id, EV_INT_solid, SOLID_BBOX)
}
}
This was fun to figure out

. Also, I think this may be more efficient then teame06's method used in his KZ plugin. It all depends on how the find_sphere_class() function works.