Generally it happens, when you use freeze_mode = 2;
Try to use proc_mode = PROC_NOFREEZE; in your function that uses freeze_mode, like code below:

[P] - Pause a running game on/off

Code:
#include <default.c>

#define PRAGMA_PATH "%EXE_DIR%\samples"

ENTITY* spot_point;

function on_p_event () // Pause a running game on & off
{
	proc_mode = PROC_NOFREEZE;
	
	while (key_p) {wait (1);}
	
	if(freeze_mode == 2) // all frozen??
	{
		freeze_mode = 0; // go on
	}
	else
	{
		freeze_mode = 2; // pause everything
	}
}

function spot()
{
	spot_point = me;
	my.flags |= CAST|LIGHT;
	my.lightrange = 500;
	vec_set(my.blue,vector(255,100,100));
	set(me, SPOTLIGHT);
	while(1) {
		my.pan += 3*time_step;
		my.tilt = -60;
		wait(1);
	}
}

function main()
{
	shadow_stencil = 1;
	level_load("small.hmp");
	vec_set(sky_color,vector(20,10,10));
	vec_set(ambient_color,vector(40,40,40));
	sun_light = 0;
	spot_point = ent_create(CUBE_MDL,vector(0,0,200),spot);
	vec_set(camera.x,vector(-400,0,50));
	ent_create(NULL,0,0);
	def_move();
}




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P