Raised This Month: $51 Target: $400
 12% 

Delay between team switch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-03-2011 , 01:43   Delay between team switch
Reply With Quote #1

As you might know, there's some mods out of there that block any join team attemp from a certain client if they do it really fast. I am wondering if there's a way to get rid of such annoying thing.

Directly from hl2mp_player.cpp:

PHP Code:
void CHL2MP_Player::ChangeTeamint iTeam )
{
    if ( 
GetNextTeamChangeTime() >= gpGlobals->curtime )
    {
        
char szReturnString[128];
        
Q_snprintfszReturnStringsizeofszReturnString ), "Please wait %d more seconds before trying to switch teams again.\n", (int)(GetNextTeamChangeTime() - gpGlobals->curtime) );

        
ClientPrintthisHUD_PRINTTALKszReturnString );
        return;
    }

    
bool bKill false;

    if ( 
HL2MPRules()->IsTeamplay() == true )
    {
        if ( 
iTeam != GetTeamNumber() && GetTeamNumber() != TEAM_UNASSIGNED )
        {
            
bKill true;
        }
    }

    
BaseClass::ChangeTeamiTeam );

    
m_flNextTeamChangeTime gpGlobals->curtime TEAM_CHANGE_INTERVAL;

    if ( 
HL2MPRules()->IsTeamplay() == true )
    {
        
SetPlayerTeamModel();
    }
    else
    {
        
SetPlayerModel();
    }

    if ( 
bKill == true )
    {
        
ClientKilledict() );
    }

0x00 is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 04-03-2011 , 02:24   Re: Delay between team switch
Reply With Quote #2

Take a look on SDKHooks' source code.
Sammy-ROCK! is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-03-2011 , 12:40   Re: Delay between team switch
Reply With Quote #3

Not really usefull.

edit; by changing m_flNextModelChangeTime & m_flNextTeamChangeTime to 0.0 OnGameFrame(); should do the trick?

Last edited by 0x00; 04-03-2011 at 12:58.
0x00 is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-03-2011 , 23:17   Re: Delay between team switch
Reply With Quote #4

A better way would be to use one of SDKHook's OnThink hooks.
bl4nk is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-04-2011 , 22:17   Re: Delay between team switch
Reply With Quote #5

m_flNextModelChangeTime & m_flNextTeamChangeTime does not exist according to sm_dump_netprops, wierd.

Last edited by 0x00; 04-06-2011 at 09:31.
0x00 is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 04-05-2011 , 12:52   Re: Delay between team switch
Reply With Quote #6

Try changing the model to the same model the client is as well as there team every 4 secounds to block team switching.
__________________
Master(d)



Master53 is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-05-2011 , 13:18   Re: Delay between team switch
Reply With Quote #7

Quote:
Originally Posted by Master53 View Post
Try changing the model to the same model the client is as well as there team every 4 secounds to block team switching.
What a way of block team changes. I'd still choose the method described by myself at the top of the thread, I just don't know why its not working when it should /sadface
0x00 is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-06-2011 , 09:32   Re: Delay between team switch
Reply With Quote #8

Whatever, I gave up.. if someone is willing to take this as a paid job, feel free to contact me.
0x00 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 11:21.


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