This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[CS:GO]Disconnect: Kicked by Console : For suiciding too many times.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 07-05-2015 , 23:22   [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #1

background:HNS CT death is killed by himself,when the CT killed by himself more than 5 times, the server will kick you with the message "Kicked by Console : For suiciding too many times."
first I try to find some ConVar, but I can't found any ConVar about it. So I try to decompile the server.dll/.so, and then I found that, something like this:
PHP Code:
void CCSGameRules::PlayerKilledCBasePlayer *pVictim, const CTakeDamageInfo &info )
{
//...
  
if ( Q_strcmp(pKiller"planted_c4") )
  {
    if ( 
pScorer == pVictim || !pScorer )
    {
      if ( 
bool(this 600) )//I think this is CCSGameRules function
      
{
        if ( !
bool(pVictim 9608) )//I think this is CBasePlayer class member var
        
{
          if (
mp_autokick.GetBool())
          {
            if ( !
CCSGameRules::IsPlayingOffline() )
            {
              if ( !
CCSGameRules::IsWarmupPeriod(g_pGameRules) )
              {
                
int iPendingTeamNum CBaseEntity::GetPendingTeamNumber(pVictim);
                if ( 
iPendingTeamNum == CBaseEntity::GetTeamNumber(pVictim) )
                {
                  
int iSuicideCount = ++*(int *)(pVictim 2368);
                  if ( 
iSuicideCount >= )
                  {
                      
//then the server will kick the player here.
                  
}
                }
              }
            }
          }
        }
      }
    }
  }
//...

I think I have to block this operating on my hns server,
so my idea is hook CCSGameRules:: PlayerKilled as Pre,
and the store the iSuicideCount and set the iSuicideCount to zero or lower than 5,
and restore the iSuicideCount on CCSGameRules:: PlayerKilled Post
I think this solution is not bad . Also I'm new on CS:GO, so if you have any better than this, please just post here
__________________
QQ:116268742

Last edited by K.K.Lv; 07-05-2015 at 23:25.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 07-05-2015 , 23:39   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #2

https://forums.alliedmods.net/showpo...1&postcount=11

the +600 is the offset to the function i hooked. By blocking the function it never adds to the suicidecount.
Dr!fter is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 07-06-2015 , 00:04   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #3

good work Dr!fter, more clear and more efficiency, I will do it with a SourceMod Extension when I'm free
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 07-06-2015 , 09:05   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #4

Quote:
Originally Posted by K.K.Lv View Post
good work Dr!fter, more clear and more efficiency, I will do it with a SourceMod Extension when I'm free
The link i provided has all the code and gamedata to do it using dhooks. Another extension isnt required.
Dr!fter is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 07-06-2015 , 20:18   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #5

but I see the DHook is not a release version, or is there a release version I can download ?
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
versatile_bfg
Veteran Member
Join Date: Feb 2012
Old 07-06-2015 , 20:21   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #6

__________________
versatile_bfg is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 07-06-2015 , 21:20   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #7

@versatile_bfg
DHooks (Dynamic Hooks - Dev Preview)
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
versatile_bfg
Veteran Member
Join Date: Feb 2012
Old 07-06-2015 , 21:24   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #8

Quote:
Originally Posted by K.K.Lv View Post
@versatile_bfg
DHooks (Dynamic Hooks - Dev Preview)
Just use it. The builds are there and it has been out for awhile. A lot of the deathmatch plugins use it.
__________________
versatile_bfg is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 07-07-2015 , 01:33   Re: [CS:GO]Disconnect: Kicked by Console : For suiciding too many times.
Reply With Quote #9

Quote:
Originally Posted by K.K.Lv View Post
@versatile_bfg
DHooks (Dynamic Hooks - Dev Preview)
I left it as dev preview cause I was lazy. as far as I know it works, its complete and there is no bugs (that I know of).
Dr!fter is offline
Reply



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 23:13.


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