Raised This Month: $ Target: $400
 0% 

Error Help: The instruction at X referenced memory...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 08-24-2017 , 02:47   Re: Error Help: The instruction at X referenced memory...
Reply With Quote #11

Code:
<Include.....>

bool Precache = true;

int OnPrecache_Post(const char *Resource)
{
	UNREFERENCED_PARAMETER(Resource);

	if (!Precache)
		RETURN_META_VALUE(MRES_IGNORED, NULL);
	
	Precache = false;
	LOG_CONSOLE(PLID, "Precaching Resources...");
	PRECACHE_MODEL("models/player.mdl");
	RETURN_META_VALUE(MRES_IGNORED, NULL);
}

void OnServerDeactivate_Post(void)
{
	if (!Initialized)
		RETURN_META(MRES_IGNORED);
	
	TaskManager.clear();
	Initialized = false;
	Precache = true;
	RETURN_META(MRES_IGNORED);
}

void OnActivate()
{
	g_pFunctionTable->pfnSpawn = OnPrecache;
	g_pengfuncsTable_Post->pfnPrecacheModel = OnPrecache_Post; // <<<<
	g_pFunctionTable->pfnServerActivate = OnServerActivate;
	g_pFunctionTable_Post->pfnServerActivate = OnServerActivate_Post;
	g_pFunctionTable->pfnServerDeactivate = OnServerDeactivate;
	g_pFunctionTable_Post->pfnServerDeactivate = OnServerDeactivate_Post; // <<<<
	g_pFunctionTable->pfnCmdStart = OnCmdStart;
	g_pFunctionTable->pfnClientCommand = OnClientCommand;
	
	g_pengfuncsTable->pfnMessageBegin = OnMessageBegin;
	g_pengfuncsTable->pfnWriteAngle = OnWriteAngle;
	g_pengfuncsTable->pfnWriteByte = OnWriteByte;
	g_pengfuncsTable->pfnWriteChar = OnWriteChar;
	g_pengfuncsTable->pfnWriteCoord = OnWriteCoord;
	g_pengfuncsTable->pfnWriteEntity = OnWriteEntity;
	g_pengfuncsTable->pfnWriteLong = OnWriteLong;
	g_pengfuncsTable->pfnWriteShort = OnWriteShort;
	g_pengfuncsTable->pfnWriteString = OnWriteString;
	g_pengfuncsTable->pfnMessageEnd = OnMessageEnd;
	g_pengfuncsTable->pfnEmitSound = OnEmitSound;
	g_pFunctionTable->pfnStartFrame = OnStartFrame;
}
I am showing only those 2 forwards, which is problem.
Interesting is that, it only crashes when player is in game.

OnActivate is forward called after:
C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *Version)
function.
Beqa Gurgenidze is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode