Hi Everyone;

I'm trying to save and load my game using the F2 for save and F3 for load. Every time I press F2 it saves the game correctly but when I press F3 it just freezes. Any ideas welcome?

This is my code:

Code:
function mySave()
{
	if (inkey_active == 1) {return;}
	if (players_health <= 0) {return;} 
	
	game_save("save01", 1, SV_ALL-SV_INFO);
	file_for_screen("save01.png",01);  // saves a screenshot to "shot01.png"
}
 
function myLoad()
{
	if (game_load("save01",1) <= 0) { 
		slot1_txt.flags |= SHOW; 
	} 
	else{
		slot1_txt.flags &= ~SHOW;
		game_load("save01", 1);
	}	
}



Then in my main function:

Code:
void main()
{
	video_mode = 10;
	video_depth = 32; // 32 bit mode
	video_screen = 1; // C-Script: start settings for Fullscreen*/
	
	fps_max = 60;
	
	level_load("level.wmb");


	// Wait for 3 frames, until the level is loaded
	on_f2 = mySave;
	on_f3 = myLoad;
	wait (3); 
		
}



Thank you in advance. Any ideas welcome.