Thanks for the help folks smile

EvilSOB, your suggestion works well on test case but after some testing I noticed that it does not work too well on my real problem (it still sometimes happens that not both objects react properly).

MrGuest your post gave me an idea for a new code that looks like this and works quite well for both test case and my real case. Here is improved code of test case:

Code:
#include <acknex.h>
#include <default.c>

ENTITY* ball1;
ENTITY* ball2;
STRING* command_kill = "kill";

function collision_impact()
{
	my.string1 = command_kill;
	you.string1 = command_kill;
}

action ball_move()
{
	my.emask |= ENABLE_IMPACT;
	my.event = collision_impact;
	while (!key_ctrl) wait (1); // wait until the player presses the [ctrl] key
	while (my != NULL)
	{
		c_move(my, vector(50 * time_step, 0, 0), nullvector, GLIDE);
		if (my.string1 == command_kill)
		{
			ent_remove(me);
		}
		wait (1);
	}
}

function main()
{
	video_mode = 9;
		
	level_load ("");
	vec_set(camera.x,vector(0, -1000, 0));
	vec_set(camera.pan,vector(90, 0, 0));
		
	ball1 = ent_create ("ball.mdl", vector(-500, 0, 0), ball_move);
	ball2 = ent_create ("ball.mdl", vector(500, 0, 0), ball_move);
	ball2.pan = 180;
}