Raised This Month: $ Target: $400
 0% 

32 slots Team swap


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-30-2010 , 14:14   32 slots Team swap
Reply With Quote #1

I'm having problems with 32 slots team swap.

Actually I'm getting overflow error (with server crash) when I try to swap teams in a full 32 slot server.

I found that with 20 slots works fine but if I increase the number of players, I get crashes.

I know it's related with too many reliable messages.
I've tried to hook messages to change MSG_ONE to MSG_BROADCAST with the following hook but still getting same error.

PHP Code:
public fwd_messagebegin(msg_destmsg_typeorigin[3], ent)
{
      if(
msg_type != gmsgTeamInfo)
            return 
FMRES_IGNORED

      
if(msg_dest == MSG_ALL)
      {
            
message_begin(MSG_BROADCASTmsg_typeoriginent)
            return 
FMRES_SUPERCEDE
      
}
      return 
FMRES_IGNORED

I've tested to change team using only m_iTeam (offset 114) and let CS change team at round start but still the same. Only with no more than 20 players works fine.

Someone have any clue to solve this?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 05-30-2010 at 20:25.
joropito is offline
Send a message via MSN to joropito
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 05-30-2010 , 14:20   Re: 32 slots Team swap
Reply With Quote #2

Dont you need message_end
__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret
infek is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-30-2010 , 15:07   Re: 32 slots Team swap
Reply With Quote #3

Quote:
Originally Posted by infek View Post
Dont you need message_end
No, because I'm hooking online message_begin.

Btw, that is one of the ways I've tried to avoid this problem.

I can remove this hook and the problem will still exists.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 05-30-2010 , 15:49   Re: 32 slots Team swap
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <fakemeta>

new const VERSION[] = "0.0.1"

const MAX_PLAYERS 32

const XTRA_OFS_PLAYERS 5
const OFFSET_TEAM 114

const TEAM_T 1
const TEAM_CT 2

public plugin_init()
{
    
register_plugin("ZBB Swap Teams"VERSION"Swap Team (LULZ)")

    
register_logevent("Logevent_Round_End"2"1=Round_End")
}

public 
Logevent_Round_End()
{
    new 
iPlayers[MAX_PLAYERS], iNumid
    get_players
(iPlayersiNum"h")
    for(new 
ii<iNumi++)
    {
        
id iPlayers[i]
        switch( 
get_pdata_int(idOFFSET_TEAMXTRA_OFS_PLAYERS) )
        {
            case 
TEAM_T:
            {
                
set_pdata_int(idOFFSET_TEAMTEAM_CTXTRA_OFS_PLAYERS)
            }
            case 
TEAM_CT:
            {
                
set_pdata_int(idOFFSET_TEAMTEAM_TXTRA_OFS_PLAYERS)
            }
        }
    }

That's what I've been using for the past 3 years for a certain mod.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Old 05-30-2010, 16:02
DruGzOG
This message has been deleted by DruGzOG. Reason: dp
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-30-2010 , 20:25   Re: 32 slots Team swap
Reply With Quote #6

I'm doing the same way DruGzOG

Now I guess the problem is I'm doing a lot of things at spawnpost (set score, deaths, health, gravity, render and more) and it's like a flood...
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
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 05:22.


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