ProGamingEXP - PROFESSIONAL GAMING EXPERIENCE
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Hiện bộ gõ=phím F8
PRESS F9 to turn on/off the unicode typing method. Bộ gõ Tiếng Việt kiểu VNI đã mặc định bật, bấm F8 để hiện trạng thái bộ gõ và hiệu chỉnh khi cần.
Latest topics
» Specified Game requires a saved game file problem
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeTue Nov 24, 2015 6:08 am by kingsamurie

» Strange Invalid version error after changing to bnet version 26
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeWed Oct 07, 2015 9:26 am by Gen

» Perfect-G 412KANAKO Gallery
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeWed Sep 23, 2015 11:32 pm by Guest

» Fully Naked Pics Of Jessica Gomes
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeTue Jul 07, 2015 5:57 pm by Guest

» The One Tree Hill Season 3
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeSun Jun 07, 2015 11:27 am by Guest

» The One Tree Hill Season 3
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeSun Jun 07, 2015 11:20 am by Guest

» When i host i get this error using Gen MOdded Ghostone(Latest ver)
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeMon Apr 21, 2014 12:00 am by kingsamurie

» When i type !map on any kind of map i get this error
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeSun Apr 20, 2014 11:59 pm by kingsamurie

» Players get kicked
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeThu Oct 17, 2013 1:51 am by keisersoze

» Where to find Games!
!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Icon_minitimeTue Oct 15, 2013 11:22 am by kokkis

Thống Kê/Statistic
Free counters!

!FF, !ffcounter commands v1.43 -> v1.49, v1.50

Go down

!FF, !ffcounter commands v1.43 -> v1.49, v1.50 Empty !FF, !ffcounter commands v1.43 -> v1.49, v1.50

Post by Gen Mon Nov 05, 2012 5:29 am

I did all everything to fix it since 1.42 [You must be registered and logged in to see this link.]. If you're using v1.49 & v1.50, when you type !version in lobby, it should say the version v1.49, v1.50 correctly.

For ff patch:

I did add m_Stats to the main condition
if( Command == "ffcounter" && m_Stats && m_GameLoaded && m_Map->GetMapType( ).find("dota") != string::npos )
if( (Command == "ff" || Command == "forfeit") && m_Stats && m_GameLoaded && player->CanFF() && m_Map->GetMapType( ).find("dota") != string::npos)

Previous problem was with m_Stats->SetWinner(2); when m_Stats is NULL, so in order to make sure it's not NULL before calling SetWinner function, I added a condition (for both SetWinner(1) & SetWinner(2))
if (m_Stats != NULL)
m_Stats->SetWinner(2);

Code:
   if( (Command == "ff" || Command == "forfeit") && m_Stats && m_GameLoaded && player->CanFF() && m_Map->GetMapType( ).find("dota") != string::npos)
   {
      if(player->GetHasFFed()) 
      {
         player->SetHadFFed( false );
         player->SetCanFF(false);      // w8 1 min
      }
      else
      {
         player->SetHadFFed( true );
         player->SetTimeFFed(GetTime());  //set time         
      }
      
      uint32_t VotesSentinel = 0;
      uint32_t VotesScourge = 0;
      uint32_t CountSentinel = 0;
      uint32_t CountScourge = 0;
      bool team_p=false;
       // sentinel 1
       // scourge 1

      int k=0;
      for( vector<CGameSlot> :: iterator i = m_Slots.begin( ); i != m_Slots.end( ); i++ )
      {
         if( i->GetSlotStatus( ) == SLOTSTATUS_OCCUPIED && i->GetComputer( ) == 0 )
         {
            CGamePlayer *Player = GetPlayerFromPID( i->GetPID( ) );
            if(Player)
            {
               if(k>=0 && k<5)
               {
                  CountSentinel++;
                  if(Player->GetHasFFed())
                  {
                     VotesSentinel++;                     
                  }
                  if (Player->GetName()==player->GetName()) team_p=false; //sentinel
               }
               else if(k>=5 && k<10)
               {
                  CountScourge++;
                  if(Player->GetHasFFed())
                  {
                     VotesScourge++;
                  }
               if (Player->GetName()==player->GetName()) team_p=true; //scourge
               }
            }
         }
         k++;
      }

      if(player->GetHasFFed())
      {
         if (!team_p) {
         //sentinel
            SendAllChat( "Player [" + User + "] gave FF command. Counter for scores of Sentinel: " + UTIL_ToString( VotesSentinel ) + "/" + UTIL_ToString( CountSentinel));
         } else {
         //scourge
            SendAllChat( "Player [" + User + "] gave FF command. Counter for scores of Scourge: " + UTIL_ToString( VotesScourge ) + "/" + UTIL_ToString( CountScourge ));
         }         
      } else
      {
            if (!team_p) {
            SendAllChat( "Player [" + User + "] took his/her oath of FF. Counter for scores of Sentinel: " + UTIL_ToString( VotesSentinel ) + "/" + UTIL_ToString( CountSentinel ));
         } else {
            SendAllChat( "Player [" + User + "] took his/her oath of FF. Counter for scores of Scourge: " + UTIL_ToString( VotesScourge ) + "/" + UTIL_ToString( CountScourge ));
         };
      }

      if((VotesSentinel == CountSentinel) && (CountSentinel!=0) ) // has at least a player
      {
         if (m_Stats != NULL)
            m_Stats->SetWinner(2);     
        //game_ff=true;  //disable autoban //autosave
         SendAllChat("The team FF Sentinel resigned. The Scourge wins this game.");
         if (!m_GameEndCountDownStarted)
                  {
                     CONSOLE_Print( "[GAME: " + m_GameName + "] ending (admin can end the game now with !endn)" );
                     SendAllChat("Game over in 10 secs automatically. YOU CAN LEAVE NOW!");
                     m_GameEndCountDownStarted = true;
                     m_GameEndCountDownCounter = 10;
                     m_GameEndLastCountDownTicks = GetTicks();
                  }
      }
      else if((VotesScourge == CountScourge) && (CountScourge!=0)) // has at least a player
      {
         if (m_Stats != NULL)
            m_Stats->SetWinner(1);   
         //game_ff=true;    //disable autoban  //autosave
         SendAllChat("The team FF Scourge resigned. The Sentinel wins this game.");
         if (!m_GameEndCountDownStarted)
                  {
                     CONSOLE_Print( "[GAME: " + m_GameName + "] ending (admin can end the game now with !endn)" );
                     SendAllChat("Game over in 10 secs automatically. YOU CAN LEAVE NOW!");
                     m_GameEndCountDownStarted = true;
                     m_GameEndCountDownCounter = 10;
                     m_GameEndLastCountDownTicks = GetTicks();
                  }
      }
//      player->SetFFSentTime( GetTime( ) );
   }

What else to be fixed? I need helps & advices here.
BUT I want to see all of your ghostlog & replays which relate to the crash issue. B'cuz I never host & play Dota so IDK and I can't get what's wrong in the code. We can get rid of !ff command if you guys would want to, b'cuz it's not necessarily needed. v1.51 is awaiting on this subject to be released soon.

Gen
Admin
Admin

Posts : 148
Join date : 2012-02-26

http://GarenaID G.M.Bot

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum