SA-MP Forums Archive
function header differs from prototype - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: function header differs from prototype (/showthread.php?tid=534717)



function header differs from prototype - ZombieNest - 31.08.2014

Hi, I need some help here, I was compiling a gamemode and this happened :
error is function head differs from prototype but I can't see anything wrong, The line is:
Код:
public OnGameModeExit()
and the whole line:
Код:
public OnGameModeExit()
{
    print("[OnGameModeExit] Shutting down...");

	djson_GameModeExit();

	// First param: print each individual entity when it's saved
	// Second param: print the total amount of entities saved

	SavePlayerVehicles();
	SaveSafeboxes();
	SaveTents();
	SaveDefences();
	SaveSigns();

	SaveSprayTags();

	print("\nSave Complete! Safe to shut down.");
    return 1;
}



Re: function header differs from prototype - LeroyII - 31.08.2014

Forgive me if i am wrong, but line 5 in this code.. Sholdn't it go like this:
Код:
djson_OnGameModeExit();



Re: function header differs from prototype - ThePhenix - 31.08.2014

Make sure you're using the right samp include.


Re: function header differs from prototype - jakejohnsonusa - 31.08.2014

Quote:
Originally Posted by LeroyII
Посмотреть сообщение
Forgive me if i am wrong, but line 5 in this code.. Sholdn't it go like this:
Код:
djson_OnGameModeExit();
Nope, just check the DJson Include page. It should be as he has it.


As stated above, you need the latest (0.3z R4) includes in your /pawno/include folder.


Re: function header differs from prototype - Eth - 31.08.2014

show me the line before ongamemodeinit.


Re: function header differs from prototype - ZombieNest - 31.08.2014

Ok but what 0.3z R4 includes? which one?
btw there are defines before ongamemodeinit
Код:
public OnGameModeInit()
{
	print("\n[OnGameModeInit] Initialising 'Main'...");

	OnGameModeInit_Setup();

	#if defined main_OnGameModeInit
		return main_OnGameModeInit();
	#else
		return 1;
	#endif
}
#if defined _ALS_OnGameModeInit
	#undef OnGameModeInit
#else
	#define _ALS_OnGameModeInit
#endif
 
#define OnGameModeInit main_OnGameModeInit
#if defined main_OnGameModeInit
	forward main_OnGameModeInit();
#endif