If else syntax error in source code 1.5

Results 1 to 13 of 13
  1. #1
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    If else syntax error in source code 1.5

    if (ZApplication::GetInstance()->GetLaunchMode() == ZApplication::ZLAUNCH_MODE_DEBUG) {
    #ifdef _DEBUG
    ZPostSpawn(pos, dir);
    #endif
    } else {
    ZMatch.cpp(455): error C2059: syntax error : 'else'
    ZMatch.cpp(451): error C2059: syntax error : 'if'
    ZMatch.cpp(451): error C2143: syntax error : missing ';' before '{'
    ZMatch.cpp(455): error C2143: syntax error : missing ';' before '{'
    ZMatch.cpp(451): error C2447: '{' : missing function header (old-style formal list?)
    ZMatch.cpp(455): error C2447: '{' : missing function header (old-style formal list?)

    What's worng? HELP?

    this errors gave me the vs 2003 when I put the spawn fix of vusion

    -


  2. #2
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: If else syntax error in source code 1.5

    perhaps what's before that?

  3. #3
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    Re: If else syntax error in source code 1.5

    Quote Originally Posted by Vusion View Post
    perhaps what's before that?
    here is the file if you need it.
    Attached Files Attached Files

  4. #4
    Fuck Army. sahar042 is offline
    MemberRank
    Jul 2009 Join Date
    833Posts

    Re: If else syntax error in source code 1.5

    Quote Originally Posted by ZeidForce View Post
    here is the file if you need it.

    try this :

    Code:
    #include "stdafx.h"
    
    #include "ZMatch.h"
    #include "ZGame.h"
    #include <windows.h>
    #include "ZCharacterManager.h"
    #include "ZCharacter.h"
    #include "ZPost.h"
    #include "ZGameInterface.h"
    #include "ZApplication.h"
    #include "ZGameClient.h"
    #include "ZScreenEffectManager.h"
    #include "ZActionDef.h"
    #include "ZWorldItem.h"
    #include "ZApplication.h"
    #include "ZRule.h"
    #include "ZMapDesc.h"
    #include "MMatchGlobal.h"
    #include "ZRuleDuel.h"
    #include "ZRuleDuelTournament.h"
    #include "ZInput.h"
    
    #define READY_COUNT	5
    
    ZMatch::ZMatch() : m_pRule(NULL)
    {
    	m_pStageSetting = ZGetGameClient()->GetMatchStageSetting();
    	m_nRoundState = MMATCH_ROUNDSTATE_PREPARE;
    	m_nLastDeadTime = 0;
    	m_nNowTime = 0;
    	m_nSoloSpawnTime = -1;
    	memset(m_nTeamScore, 0, sizeof(m_nTeamScore));
    	memset(m_nTeamKillCount, 0, sizeof(m_nTeamKillCount));
    }
    
    ZMatch::~ZMatch()
    {
    
    }
    
    bool ZMatch::Create()
    {
    	m_nNowTime = 0;
    	m_nCurrRound = 0;
    	memset(m_nTeamScore, 0, sizeof(m_nTeamScore));
    	memset(m_nTeamKillCount, 0, sizeof(m_nTeamKillCount));
    
    	m_pRule = ZRule::CreateRule(this, GetMatchType());
    
    	return true;
    }
    
    void ZMatch::Destroy()
    {
    	if (m_pRule)
    	{
    		delete m_pRule; m_pRule = NULL;
    	}
    
    }
    
    void ZMatch::SetRound(int nCurrRound)
    {
    	m_nCurrRound = nCurrRound;
    //	memset(m_nTeamKillCount, 0, sizeof(m_nTeamKillCount));
    }
    
    
    void ZMatch::Update(float fDelta)
    {
    	m_nNowTime = timeGetTime();
    
    	switch (GetRoundState())
    	{
    	case MMATCH_ROUNDSTATE_PREPARE:
    		{
    
    		}
    		break;
    	case MMATCH_ROUNDSTATE_PRE_COUNTDOWN:
    		{
    		}
    		break;
    	case MMATCH_ROUNDSTATE_COUNTDOWN:
    		{
    			if ((m_nNowTime - m_nStartTime) > ((READY_COUNT+1) * 1000))
    			{
    				m_nStartTime = m_nNowTime;
    			}
    		}
    		break;
    	case MMATCH_ROUNDSTATE_PLAY:
    		{
    			ProcessRespawn();
    		}
    		break;
    	}
    
    	if (m_pRule) m_pRule->Update(fDelta);
    }
    
    
    void ZMatch::ProcessRespawn()
    {
    #ifdef _QUEST
    	if (ZGetGameTypeManager()->IsQuestDerived(GetMatchType())) return;
    #endif
    	// µ¥¾²¸ִֵ¡ְֿ °ז¿ל ֱ׳ְ¸¸י ¹·־ »ל¾ֶ³­´.
    	if (!IsWaitForRoundEnd() && ZGetGame()->m_pMyCharacter)
    	{
    		static bool bLastDead = false;
    		if (ZGetGame()->m_pMyCharacter->IsDie())
    		{
    			if (bLastDead == false) {
    				m_nLastDeadTime = m_nNowTime;	// ֱ׳ְ÷ ½ֳ°£
    			}
    
    			//¹צֱֱַ₪÷¸ְ׃½ֱֳײ¼® 
    			/*ZBuffSummary* pBuffSummary = ZGetGame()->m_pMyCharacter->GetCharacterBuff()->GetBuffSummary();
    			int nDelayAfterDying = pBuffSummary->GetRespawnTime(RESPAWN_DELAYTIME_AFTER_DYING);
    			*/
    			int nDelayAfterDying = RESPAWN_DELAYTIME_AFTER_DYING;
    
    			m_nSoloSpawnTime = m_nNowTime - m_nLastDeadTime;
    
    			if (m_nSoloSpawnTime >= RESPAWN_DELAYTIME_AFTER_DYING_MAX)	// ֱ׳¾מ¼­ ¾ֶ¹«°ֽµµ ¾ָ´©¸£°ם ְײְ¸¸י 15ֳִָֺ ¸®½÷ֶש
    			{
    				SoloSpawn();
    			}
    			else if (m_nSoloSpawnTime >= nDelayAfterDying)
    			{
    				static bool st_bCapturedActionKey = false;
    				bool bNow = ZIsActionKeyPressed(ZACTION_USE_WEAPON) || ZIsActionKeyPressed(ZACTION_JUMP);
    
    				if ((st_bCapturedActionKey == true) && (bNow == false)) {
    					SoloSpawn();
    				}
    
    				st_bCapturedActionKey = bNow;
    			}
    
    			
    
    
    		}
    
    		bLastDead = ZGetGame()->m_pMyCharacter->IsDie();
    	}
    
    }
    
    int ZMatch::GetRoundReadyCount(void)
    {
    	return ( READY_COUNT - (timeGetTime() - m_nStartTime) / 1000 );
    }
    
    
    void ZMatch::OnDrawGameMessage()
    {
    
    #ifndef _PUBLISH
    	// for debug ½ֳ°£ ַ¥½ֳ
    	float fTime=ZGetGame()->GetTime();
    	int nTimeMinute=fTime/60.f;
    	fTime=fmod(fTime,60.f);
    	int nTimeSecond=fTime;
    	fTime=fmod(fTime,1.f);
    
    	char szTimeMessage[256] = "";
    	sprintf(szTimeMessage, "%d:%02d.%02d",nTimeMinute,nTimeSecond,int(fTime*100.f));
    	ZApplication::GetGameInterface()->SetTextWidget("Time", szTimeMessage);
    #endif
    
    #define CENTERMESSAGE	"CenterMessage"
    
    	switch (GetRoundState())
    	{
    	case MMATCH_ROUNDSTATE_PREPARE:
    		{
    		}
    		break;
    	case MMATCH_ROUNDSTATE_COUNTDOWN:
    		{
    
    		}
    		break;
    	case MMATCH_ROUNDSTATE_PLAY:
    		{
    
    		}
    		break;
    	case MMATCH_ROUNDSTATE_FINISH:
    		{
    
    		}
    		break;
    	default:
    		{
    
    		}
    		break;
    	}
    
    }
    
    
    
    void ZMatch::SoloSpawn()
    {
    	if (GetMatchType() == MMATCH_GAMETYPE_DUEL) return;
    	if (GetMatchType() == MMATCH_GAMETYPE_DUELTOURNAMENT) return;
    
    	if (ZGetGame()->m_pMyCharacter->IsDie())
    	{
    		rvector pos = rvector(0.0f, 0.0f, 0.0f);
    		rvector dir = rvector(0.0f, 1.0f, 0.0f);
    
    		ZMapSpawnData* pSpawnData = NULL;
    		
    		if (IsTeamPlay())
    		{
    			int nSpawnIndex[2] = { 0, 0 };
    			for (int i = 0; i < 2; i++)
    				if (ZGetGame()->m_pMyCharacter->GetTeamID() == MMT_RED + i)
    					pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetTeamData(i, nSpawnIndex[i]);
    		}
    		else
    			pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetSoloRandomData();
    		
    
    		if (pSpawnData == NULL)
    		{
    //			_ASSERT(0);
    		}
    		else
    		{
    			if (ZApplication::GetInstance()->GetLaunchMode() == ZApplication::ZLAUNCH_MODE_DEBUG) {
    				if (ZGetGame()->GetSpawnRequested() == false) {
    					ZPostRequestSpawn(ZGetMyUID(), pSpawnData->m_Pos, pSpawnData->m_Dir);
    					ZGetGame()->SetSpawnRequested(true);
    				}
    #ifdef _DEBUG
    				ZPostSpawn(pSpawnData->m_Pos, pSpawnData->m_Dir);
    #endif
    			} else {
    				if (ZGetGame()->GetSpawnRequested() == false) {
    					ZPostRequestSpawn(ZGetMyUID(), pSpawnData->m_Pos, pSpawnData->m_Dir);
    					ZGetGame()->SetSpawnRequested(true);
    				}
    			}	
    		}
    		
    		m_nSoloSpawnTime = -1;
    	}
    }
    
    
    
    void ZMatch::InitCharactersPosition()
    {
    	// ְְֶְֿ °ז¿ל
    	if (IsTeamPlay())
    	{
    		int nSpawnIndex[ 2] = { 0, 0 };
    
    		for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
    			itor != ZGetGame()->m_CharacterManager.end(); ++itor)
    		{
    			ZCharacter* pCharacter = (*itor).second;
    			for (int i = 0; i < 2; i++)
    			{
    				if (pCharacter->GetTeamID() == MMT_RED + i)
    				{
    					ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetTeamData(i, nSpawnIndex[i]);
    					if (pSpawnData != NULL)
    					{
    						pCharacter->SetPosition(pSpawnData->m_Pos);
    						pCharacter->SetDirection(pSpawnData->m_Dir);
    
    						nSpawnIndex[i]++;
    					}
    				}
    			}
    		}
    
    		return;
    	}
    
    	// µא¾ף¸נµו ְֿ °ז¿ל
    	else if ( ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DUEL)
    	{
    		ZRuleDuel* pDuel = (ZRuleDuel*)ZGetGameInterface()->GetGame()->GetMatch()->GetRule();
    		if ( pDuel)
    		{
    			int nIndex = 2;
    			if ( pDuel->QInfo.m_uidChampion == ZGetMyUID())
    				nIndex = 0;
    			else if ( pDuel->QInfo.m_uidChallenger == ZGetMyUID())
    				nIndex = 1;
    
    			// µא¾ף ְ¿כ ¸ְֺּ¸י ¸ַ ֳ³ְ½°ת µ־¹רֲ° ְ§ִ¡
    			if ( MGetMapDescMgr()->IsMapOnlyDuel( ZGetGameClient()->GetMatchStageSetting()->GetMapIndex()))
    			{
    				ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetData( nIndex);
    				if ( pSpawnData != NULL)
    				{
    					ZGetGame()->m_pMyCharacter->SetPosition( pSpawnData->m_Pos);
    					ZGetGame()->m_pMyCharacter->SetDirection( pSpawnData->m_Dir);
    				}
    			}
    
    			// µא¾ף ְ¿כ ¸ְֺּ ¾ֶ´ֿ¸י ְְֶ°ת °°ְ÷ ¹ז½ִ
    			else
    			{
    				ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetTeamData( nIndex, 0);
    				if (pSpawnData != NULL)
    				{
    					ZGetGame()->m_pMyCharacter->SetPosition( pSpawnData->m_Pos);
    					ZGetGame()->m_pMyCharacter->SetDirection( pSpawnData->m_Dir);
    				}
    			}
    
    			return;
    		}
    	}
    
    	else if ( ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DUELTOURNAMENT )
    	{
    		ZRuleDuelTournament *pDTRule = (ZRuleDuelTournament*)ZGetGameInterface()->GetGame()->GetMatch()->GetRule();
    		if (pDTRule)
    		{
    			int nIndex = 2;
    			if (pDTRule->m_DTGameInfo.uidPlayer1 == ZGetMyUID())				nIndex = 0;
    			else if (pDTRule->m_DTGameInfo.uidPlayer2 == ZGetMyUID())			nIndex = 1;
    
    			// µא¾ף ְ¿כ ¸ְֺּ¸י ¸ַ ֳ³ְ½°ת µ־¹רֲ° ְ§ִ¡
    			if ( MGetMapDescMgr()->IsMapOnlyDuel( ZGetGameClient()->GetMatchStageSetting()->GetMapIndex()))
    			{
    				ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetData(nIndex);
    				if (pSpawnData != NULL)
    				{
    					ZGetGame()->m_pMyCharacter->SetPosition(pSpawnData->m_Pos);
    					ZGetGame()->m_pMyCharacter->SetDirection(pSpawnData->m_Dir);
    				}
    			}
    
    			// µא¾ף ְ¿כ ¸ְֺּ ¾ֶ´ֿ¸י ְְֶ°ת °°ְ÷ ¹ז½ִ
    			else
    			{
    				ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetTeamData(nIndex, 0);
    				if (pSpawnData != NULL)
    				{
    					ZGetGame()->m_pMyCharacter->SetPosition(pSpawnData->m_Pos);
    					ZGetGame()->m_pMyCharacter->SetDirection(pSpawnData->m_Dir);
    				}
    			}
    
    			return;
    		}
    	}
    
    	// ½ע·־ְֿ °ז¿ל³× ְּµµְתµµ ¾ֶ´ֿ¸י ·£´‎
    	ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetSoloRandomData();
    	if (pSpawnData != NULL)
    	{
    		ZGetGame()->m_pMyCharacter->SetPosition(pSpawnData->m_Pos);
    		ZGetGame()->m_pMyCharacter->SetDirection(pSpawnData->m_Dir);
    	}
    }
    
    void ZMatch::InitCharactersProperties()
    {
    	for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
    		itor != ZGetGame()->m_CharacterManager.end(); ++itor)
    	{
    		ZCharacter* pCharacter = (*itor).second;
    		pCharacter->InitStatus();
    		pCharacter->SetVisible(true);
    	}
    
    }
    
    void ZMatch::InitRound()
    {
    	// ½ֳ°£ְ» 0ְ¸·־
    	ZGetGame()->InitRound();
    
    	InitCharactersPosition();
    	InitCharactersProperties();
    
    	// ¿שµו¾ְֵֶּ ֳֺ±גָ­
    	ZGetWorldItemManager()->Reset();
    
    	// ¸ַ ֳ³ְ½ °װְ׃½ֳ ½÷ֶש½ֳֵ²´.
    	rvector pos = ZGetGame()->m_pMyCharacter->GetPosition();
    	rvector dir = ZGetGame()->m_pMyCharacter->m_DirectionLower;
    
    	m_nRoundKills = 0;
    
    	bool isObserver = false;
    
    if (ZApplication::GetInstance()->GetLaunchMode() == ZApplication::ZLAUNCH_MODE_DEBUG) {
    #ifdef _DEBUG
    ZPostSpawn(pos, dir);
    #endif
    } else {
    		if (ZGetGame()->GetSpawnRequested() == false) {
    			if (GetMatchType() == MMATCH_GAMETYPE_DUEL)
    			{
    //				ZRuleDuel* pDuel = (ZRuleDuel*)GetRule();
    //				if (pDuel->GetQueueIdx(ZGetMyUID()) <= 1){
    //					ZPostRequestSpawn(ZGetMyUID(), pos, dir);
    //					g_pGame->SetSpawnRequested(true);
    //				} else isObserver = true;
    				for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
    					itor != ZGetGame()->m_CharacterManager.end(); ++itor)
    				{
    					ZCharacter* pCharacter = (*itor).second;
    					pCharacter->ForceDie();
    					pCharacter->SetVisible(false);
    				}
    			}
    			else if(GetMatchType() == MMATCH_GAMETYPE_DUELTOURNAMENT){
    				for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
    					itor != ZGetGame()->m_CharacterManager.end(); ++itor)
    				{
    					ZCharacter* pCharacter = (*itor).second;
    					pCharacter->ForceDie();
    					pCharacter->SetVisible(false);
    				}
    			}
    			else
    			{
    				ZPostRequestSpawn(ZGetMyUID(), pos, dir);
    				ZGetGame()->SetSpawnRequested(true);
    			}
    		}
    	}
    
    //	m_nRoundKills = 0;
    
    	// AdminHide ֳ³¸®
    	MMatchObjCache* pObjCache = ZGetGameClient()->FindObjCache(ZGetMyUID());
    	if (pObjCache && pObjCache->CheckFlag(MTD_PlayerFlags_AdminHide)) {
    		ZGetGameInterface()->GetCombatInterface()->SetObserverMode(true);
    	} else {
    		// ¿ֱֹ®¹צ ¸נµו¿´ְ¸¸י ַ״ֱ¦.
    		if (!isObserver)
    			ZGetGame()->ReleaseObserver();
    		else
    		{
    			ZGetGameInterface()->GetCombatInterface()->SetObserverMode(true);
    			ZGetGame()->ReserveObserver();
    			ZGetGame()->m_pMyCharacter->ForceDie();
    
    		}
    	}
    	memset(m_nTeamKillCount, 0, sizeof(m_nTeamKillCount));
    }
    
    
    
    void ZMatch::SetRoundState(MMATCH_ROUNDSTATE nRoundState, int nArg)
    {
    	if (m_nRoundState == nRoundState) return;
    	m_nRoundState = nRoundState;
    
    #ifdef _LOG_ENABLE_ROUNDSTATE_
    	char buf[128];
    	switch(ZGetGame()->GetMatch()->GetRoundState())
    	{
    	case MMATCH_ROUNDSTATE_PREPARE:		sprintf(buf, "RoundState: PREPARE \n"); break;
    	case MMATCH_ROUNDSTATE_COUNTDOWN:	sprintf(buf, "RoundState: COUNTDOWN \n"); break;
    	case MMATCH_ROUNDSTATE_PLAY:		sprintf(buf, "RoundState: PLAY \n"); break;
    	case MMATCH_ROUNDSTATE_FINISH:		sprintf(buf, "RoundState: FINISH \n"); break;
    	case MMATCH_ROUNDSTATE_EXIT:		sprintf(buf, "RoundState: EXIT \n"); break;
    	case MMATCH_ROUNDSTATE_FREE:		sprintf(buf, "RoundState: FREE \n"); break;
    	case MMATCH_ROUNDSTATE_FAILED:		sprintf(buf, "RoundState: FAILED \n"); break;
    	case MMATCH_ROUNDSTATE_PRE_COUNTDOWN: sprintf(buf, "RoundState: PRE_COUNTDOWN \n"); break;
    	}
    	OutputDebugString(buf);
    #endif
    
    	//# ¾ױְ¸·־´ֲ ְּ switch ³»÷־¿¡ ·ך¿¡ µ¸¥ if else if else¸¦ ֳ°¡ֱַֿצ ¾ֺ´ֲ°װ ֱֱ°½ְ´ֿ´.
    	//# ¶ף¿מµו»ףֲֵ ÷¯ָ­½ֳ ·ך¿¡ µ¶ף ַ״¾ַׂ ְְֿ÷ ZRule***ֲֺ¿¡ ³ײ´ֲ °ְּֽ ֱֱ°½ְ´ֿ´. => virtual ZRule::OnSetRoundState()
    
    	switch(m_nRoundState) 
    	{
    
    	case MMATCH_ROUNDSTATE_PREPARE: 
    		{
    
    		}
    		break;
    	case MMATCH_ROUNDSTATE_PRE_COUNTDOWN:
    		{
    		}
    		break;
    	case MMATCH_ROUNDSTATE_COUNTDOWN : 
    		{
    			OutputDebugString("MMATCH_ROUNDSTATE_COUNTDOWN>> InitRound BEGIN \n");
    			InitRound();
    			OutputDebugString("MMATCH_ROUNDSTATE_COUNTDOWN>> InitRound END \n");
    		}
    		break;
    	case MMATCH_ROUNDSTATE_PLAY:
    		{
    			if (!IsTeamPlay())
    			{
    
    			}
    		}
    		break;
    	case MMATCH_ROUNDSTATE_FINISH:
    		{
    			ZGetGame()->FlushObserverCommands();
    
    			if (GetMatchType() == MMATCH_GAMETYPE_DUEL)
    			{				
    				for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
    					itor != ZGetGame()->m_CharacterManager.end(); ++itor)
    				{
    					ZCharacter* pCharacter = (*itor).second;
    					if (pCharacter->GetKils() >= GetRoundCount())
    					{
    						ZGetGameInterface()->FinishGame();
    						break;
    					}
    				}	
    			}
    			else if(GetMatchType() == MMATCH_GAMETYPE_DUELTOURNAMENT)
    			{
    				//
    			}
    			else
    			{
    				if (m_nCurrRound + 1 >= GetRoundCount())
    				{
    					ZGetGameInterface()->FinishGame();
    				}		
    			}
    
    			if (IsTeamPlay())
    			{
    				if (nArg == MMATCH_ROUNDRESULT_RED_ALL_OUT )
    				{
    					if( m_nTeamScore[MMT_BLUE] < m_nTeamScore[MMT_RED] )
    						m_nTeamScore[MMT_BLUE] = m_nTeamScore[MMT_RED] = 0;
    					else
    						m_nTeamScore[MMT_BLUE]++;
    				}
    				else if( nArg ==  MMATCH_ROUNDRESULT_BLUE_ALL_OUT )
    				{
    					if( m_nTeamScore[MMT_RED] < m_nTeamScore[MMT_BLUE] )
                            m_nTeamScore[MMT_RED] =	m_nTeamScore[MMT_BLUE] = 0;
    					else
    						m_nTeamScore[MMT_RED]++;
    				}
    				else if (nArg == MMATCH_ROUNDRESULT_DRAW)
    				{
    					// Do nothing...
    				} 
    				else {
    					MMatchTeam nTeamWon = (nArg == MMATCH_ROUNDRESULT_REDWON ? MMT_RED : MMT_BLUE);
    					if (nTeamWon == MMT_RED)
    						m_nTeamScore[MMT_RED]++;
    					else if (nTeamWon == MMT_BLUE)
    						m_nTeamScore[MMT_BLUE]++;
    				}
    			}
    		}
    		break;
    	case MMATCH_ROUNDSTATE_EXIT:
    		{
    			
    		}
    		break;
    	case MMATCH_ROUNDSTATE_FREE:
    		{
    
    		}
    		break;
    	};
    
    	m_pRule->OnSetRoundState(m_nRoundState);
    }
    
    const char* ZMatch::GetTeamName(int nTeamID)
    {
    	switch (nTeamID)
    	{
    	case MMT_SPECTATOR:
    		return MMATCH_SPECTATOR_STR;
    	case MMT_RED:
    		return MMATCH_TEAM1_NAME_STR;
    	case MMT_BLUE:
    		return MMATCH_TEAM2_NAME_STR;
    	default:
    		return "";
    	}
    	return "";
    }
    
    
    int ZMatch::GetRoundCount()
    {
    //	if (IsWaitForRoundEnd())
    		return m_pStageSetting->GetStageSetting()->nRoundMax;
    
    	return 1;
    }
    
    
    void ZMatch::GetTeamAliveCount(int* pnRedTeam, int* pnBlueTeam)
    {
    	int nRedTeam = 0, nBlueTeam = 0;
    	if (IsTeamPlay())
    	{
    		for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin();
    			itor != ZGetGame()->m_CharacterManager.end(); ++itor)
    		{
    			ZCharacter* pCharacter = (*itor).second;
    			if (!pCharacter->IsDie())
    			{
    				if (pCharacter->GetTeamID() == 0)
    				{
    					nRedTeam++;
    				}
    				else
    				{
    					nBlueTeam++;
    				}
    			}
    		}
    	}
    
    	*pnRedTeam = nRedTeam;
    	*pnBlueTeam = nBlueTeam;
    }
    
    void ZMatch::RespawnSolo()
    {
    	if ((!IsWaitForRoundEnd()) && (ZGetGame()->m_pMyCharacter->IsDie()))
    	{
    		SoloSpawn();
    	}
    }
    
    void ZMatch::OnForcedEntry(ZCharacter* pCharacter)
    {
    	if (pCharacter == NULL)
    	{
    		_ASSERT(0); return;
    	}
    	// ³­ְװַׁ ֳַ·¹ְּ¾מ°¡ ³× ְ½ְֵֿ °ז¿ל
    	if (pCharacter == ZGetGame()->m_pMyCharacter)
    	{
    		// AdminHide ֳ³¸®
    		MMatchObjCache* pObjCache = ZGetGameClient()->FindObjCache(ZGetMyUID());
    		if (pObjCache && pObjCache->CheckFlag(MTD_PlayerFlags_AdminHide)) {
    			ZGetGameInterface()->GetCombatInterface()->SetObserverMode(true);
    		} else {
    			// ְֳֶַ·¹ְּ¸י ½÷ֵֶׁ׳ְֵּֽ
    			if (IsWaitForRoundEnd()/* && ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL*/)
    			{
    				pCharacter->SetVisible(false);
    				pCharacter->ForceDie();
    				ZGetCombatInterface()->SetObserverMode(true);
    			}	
    			else	// ¼ײ·־ְֿ°ז¿ל´ֲ ¹·־ ½÷ֶש
    			{
    				InitRound();
    			}
    		}
    	}
    	else
    	{
    		// ְֳֶַ·¹ְּ¿¡ ´¸¥ ֳַ·¹ְּ¾מ°¡ ³­ְװַֿ¸י ´ְ½ֶַ÷־ֵֽ ֱרַאַ״¾ ַֿ±ג¶§¹®¿¡ ִ³¸¯ֵֽ ÷¸¿©ֱײֱצ ¾ְֺ½
    		// ´ FREE»ףְֲֵֿ ¶§¿¡´ֲ ÷¸¿©ֱ״´
    		if (IsWaitForRoundEnd() && (GetRoundState() != MMATCH_ROUNDSTATE_FREE))
    		{
    			if (pCharacter != NULL)
    			{
    				pCharacter->SetVisible(false);
    			}
    			pCharacter->ForceDie();
    		}
    	}
    }
    
    int ZMatch::GetRemainedSpawnTime()
    {
    	int nTimeSec = -1;
    
    	if (GetRoundState() == MMATCH_ROUNDSTATE_PLAY)
    	{
    		if (!IsWaitForRoundEnd())
    		{
    			if (ZGetGame()->m_pMyCharacter->IsDie())
    			{
    				if (m_nSoloSpawnTime < 0) return -1;
    
    				//¹צֱֱַ₪÷¸ְ׃½ֱֳײ¼® 
    				/*ZBuffSummary* pBuffSummary = ZGetGame()->m_pMyCharacter->GetCharacterBuff()->GetBuffSummary();
    				int nDelayAfterDying = pBuffSummary->GetRespawnTime(RESPAWN_DELAYTIME_AFTER_DYING);*/
    				int nDelayAfterDying = RESPAWN_DELAYTIME_AFTER_DYING;
    
    				int nElapsedTime = m_nSoloSpawnTime;
    				if (nElapsedTime > nDelayAfterDying) 
    					nElapsedTime = nDelayAfterDying;
    
    				nTimeSec = (((nDelayAfterDying - nElapsedTime)+999) / 1000);
    			}
    		}
    	}
    
    	return nTimeSec;
    }
    
    
    void ZMatch::SetRoundStartTime( void)
    {
    	m_dwStartTime = timeGetTime();
    }
    
    DWORD ZMatch::GetRemaindTime( void)
    {
    	return ( timeGetTime() - m_dwStartTime);
    }
    
    
    bool ZMatch::OnCommand(MCommand* pCommand)
    {
    	if (m_pRule) return m_pRule->OnCommand(pCommand);
    	return false;
    }
    
    void ZMatch::OnResponseRuleInfo(MTD_RuleInfo* pInfo)
    {
    	if (pInfo->nRuleType != GetMatchType()) return;
    
    	if (m_pRule)
    	{
    		m_pRule->OnResponseRuleInfo(pInfo);
    	}
    }
    Last edited by Phoenix; 21-02-12 at 04:31 PM. Reason: Use CODE tags, not QUOTE tags.

  5. #5
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    Re: If else syntax error in source code 1.5

    when I put that gave me this error.

    Gunz fatal error LNK1257: code generation failed

  6. #6
    Fuck Army. sahar042 is offline
    MemberRank
    Jul 2009 Join Date
    833Posts

    Re: If else syntax error in source code 1.5

    cryptoo...

  7. #7
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    Re: If else syntax error in source code 1.5

    Quote Originally Posted by sahar042 View Post
    cryptoo...
    the dll's?

    I follow the tutorial of emisand 100%
    Last edited by ZeidForce; 21-02-12 at 02:36 PM.

  8. #8
    Fuck Army. sahar042 is offline
    MemberRank
    Jul 2009 Join Date
    833Posts

    Re: If else syntax error in source code 1.5

    Quote Originally Posted by ZeidForce View Post
    the dll's?

    I follow the tutorial of emisand 100%
    what dll lol... the lib...

  9. #9
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    Re: If else syntax error in source code 1.5

    that is what im talking about, the lib's that we have to put in the Gunz/LIB and in the cml/lib

    cryptlib2003.lib
    cryptlib2003d.lib

    my bad, lib.

    How to fix it?

    Gunz fatal error LNK1257: code generation failed
    Last edited by ZeidForce; 21-02-12 at 03:56 PM.

  10. #10
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: If else syntax error in source code 1.5

    check the output tab, and scroll a bit up. you'll see your error.

  11. #11
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    Re: If else syntax error in source code 1.5

    this is the error.

    fatal error C1382: the PCH file 'Cryptopp\Source\Release\algparam.obj' was generated. Please rebuild this object
    LINK : fatal error LNK1257: code generation failed

    what to do?

  12. #12
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: If else syntax error in source code 1.5

    Please rebuild this object. GUESS.

  13. #13
    Valued Member ZeidForce is offline
    MemberRank
    Nov 2009 Join Date
    C:\Puerto Rico\Location
    133Posts

    Re: If else syntax error in source code 1.5

    Finally thanks :)

    Close this thread please.



Advertisement