Exemplo n.º 1
0
void CGamemodeManager::Unload()
{
	for( _PlayerID playerid = 0; playerid < MAX_PLAYERS; playerid ++ )
	{
		if( __NetGame->playerPool->GetSlotState( playerid ) )
		{
			__NetGame->playerPool->GetPlayer( playerid )->GetKeyBinder()->OnGameModeUnloaded();
		}
	}

	int tmp;
	if (!amx_FindPublic(&this->gmAMX, "OnGameModeExit", &tmp))
		amx_Exec(&this->gmAMX, (cell*)&tmp, tmp);

	__NetGame->filterscriptsManager->OnGameModeExit();
	if(__NetGame->scriptTimerManager) 
		__NetGame->scriptTimerManager->DeleteForMode(&this->gmAMX);

	if (this->gmIsInit)
	{

		aux_FreeProgram(&this->gmAMX);
		__Plugins->DoAmxUnload(&this->gmAMX);
		amx_sampDbCleanup(&this->gmAMX);
		//amx_DGramCleanup(&this->gmAMX);
		amx_TimeCleanup(&this->gmAMX);
		amx_FileCleanup(&this->gmAMX);
		amx_StringCleanup(&this->gmAMX);
		amx_FloatCleanup(&this->gmAMX);
		amx_CoreCleanup(&this->gmAMX);
	}

	this->gmIsInit = false;
	this->gmIsSleeping = false;
}
Exemplo n.º 2
0
void CNetwork::UnloadScript() {
	int val;
	if (!amx_FindPublic(&inimod_amx, "OnGameModeExit", &val))
		amx_Exec(&inimod_amx, (cell*)&val, val);

	if (GMLoaded) {
		aux_FreeProgram(&inimod_amx);
		amx_TimeCleanup(&inimod_amx);
		//amx_FileCleanup(&inimod_amx);
		amx_StringCleanup(&inimod_amx);
		amx_FloatCleanup(&inimod_amx);
		amx_CoreCleanup(&inimod_amx);
	}
	GMLoaded = false;
}