Raised This Month: $ Target: $400
 0% 

Need to know which factors blocks team joining


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-30-2012 , 16:27   Need to know which factors blocks team joining
Reply With Quote #1

Well, with orpheu (editing Arkshine's Infinite Round plugin) I've done a way for blocking round ends, and made my own round end conditions, for Zombie Plague.

With this I was thinking on: filling the CT team on round starting, and move one CT to T (first zombie infection) without "triggering the Game Commencing event".

I'm using a custom joining menu, overriding the default's team choosing menues. For forcing a player to join to the team (by default it chooses a random team because on ZP we don't care about the joining team on round starting) which uses Jailbreak's joining method

PHP Code:
public team_join(idCsTeams:team)
{
    static 
restorevguimsgblock

    restore 
get_pdata_int(idm_iVGUI)
    
vgui restore & (1<<0)
    if(
vgui)
        
set_pdata_int(idm_iVGUIrestore & ~(1<<0))

    switch(
team)
    {
        case 
CS_TEAM_SPECTATOR:
        {
            
msgblock get_msg_block(g_MsgShowMenu)
            
set_msg_block(g_MsgShowMenuBLOCK_ONCE)
            
dllfunc(DLLFunc_ClientPutInServerid)
            
set_msg_block(g_MsgShowMenumsgblock)
            
set_pdata_int(idm_fGameHUDInitialized1)
            
engclient_cmd(id"jointeam""6")
        }
        case 
CS_TEAM_TCS_TEAM_CT:
        {
            
msgblock get_msg_block(g_MsgShowMenu)
            
set_msg_block(g_MsgShowMenuBLOCK_ONCE)
            
engclient_cmd(id"jointeam", (team == CS_TEAM_CT) ? "2" "1")
            
engclient_cmd(id"joinclass""1")
            
set_msg_block(g_MsgShowMenumsgblock)
            
g_PlayerSpect[id] = 0
        
}
    }
    
    if(
vgui)
        
set_pdata_int(idm_iVGUIrestore)

(my code it's not exactly as the previous code, it's a little bit edited, with many things, forget it)

That works fine, and it worked better with this fix: http://forums.alliedmods.net/showpos...00&postcount=4

There is another thing that maybe can disallow a player from joining to the CT team? It's a 32 slots server, and I don't know if everyone can join to the same team on every map, and I don't have the probided people for testing this... I was thinking on info_player_start entities if they are less of 32, or something, would be nice if someone provides some information, or better, decode the joining team function from the engine, anyway would be a good contribution
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-30-2012 , 17:46   Re: Need to know which factors blocks team joining
Reply With Quote #2

For team balance there's 2 offsets of CHalfLifeMultiplay object with total spawn points for each team.
That's calculated once at map load. Even if you change info_player_* classnames, you should modify this values.

There's no specific function for team join. There's a "think" call for CHalfLifeMultiplay and for the player then some checks are done regarding current m_iJoiningState (an offset of the player entity) and it last menu opened. Then the program put the player in the team selected.

Best way is to put players as spectators in the correct moment, avoiding them to select team (blocking some commands). Then at spectator make a control to check if it has selected (or joined) a team or not for first time.

You can check offsets at wiki for CBasePlayer. For CHalfLifeMultiplay you can check my CS/CZ Ida Suite at http://forums.alliedmods.net/showthread.php?t=185936


EDIT:

Maybe there's a simple way, not tested.

- At precache + KeyValue, rename classnames for CT spawnpoints to TT spawnpoints, then you will get that only TT can join.
- After precache, create CT spawnpoints
- During the game, move players from TT to CT as needed
- You have to check what happends with team balance. Maybe everyone will go to TT, not tested of course.
__________________

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; 06-30-2012 at 17:48.
joropito is offline
Send a message via MSN to joropito
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-01-2012 , 01:41   Re: Need to know which factors blocks team joining
Reply With Quote #3

Thanks for the info! Connor showed me a code in which alterates that offset with a custom value, then declaring to true another var, these 2 are >m_bSpawnsCounted and m_iCtSpawnsNum, I only need to get these 2 values for editing it by using Orpheu on my plugin, but I cant get them because I don't have the IDA Pro software x_x (also the m_iTSpawnsNum offset would be useful to know)

Anybody can provide these offsets? It would be apreciated
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-01-2012 , 02:20   Re: Need to know which factors blocks team joining
Reply With Quote #4

The offsets are:
Code:
int              m_iTeSpawnsNum;                          // 23
int              m_iCtSpawnsNum;                          // 24
bool             m_bSpawnsCounted;                        // 40
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-01-2012 , 03:10   Re: Need to know which factors blocks team joining
Reply With Quote #5

Quote:
Originally Posted by hornet View Post
The offsets are:
Code:
int              m_iTeSpawnsNum;                          // 23
int              m_iCtSpawnsNum;                          // 24
bool             m_bSpawnsCounted;                        // 40
Linux/Windows? (for knowing which one should +/-
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-01-2012 , 03:41   Re: Need to know which factors blocks team joining
Reply With Quote #6

Well, however, if I understand correctly, you shouldn't actually need the offsets. You insert the offset name into Orpheu memory, and don't require a linux difference.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-01-2012 , 03:44   Re: Need to know which factors blocks team joining
Reply With Quote #7

Quote:
Originally Posted by hornet View Post
Well, however, if I understand correctly, you shouldn't actually need the offsets. You insert the offset name into Orpheu memory, and don't require a linux difference.
Code:
    {
        "name"        : "m_iCtSpawnsNum",
        "type"        : "int",
        "memoryType"  : "data",
        "identifiers" : 
        [
            {
                "os"    : "windows",
                "mod"   : "cstrike",
                "value" : hello i'm missed
            },
            {
                "os"    : "linux",
                "mod"   : "cstrike",
                "value" : hello i'm missed too
            }
        ]
    }
That's why i've asked that :/
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-01-2012 , 03:53   Re: Need to know which factors blocks team joining
Reply With Quote #8

Actually m_bSpawnsCounted is a real bool si it's linux 160 and windows 168
For the other ones, it's windows + 2 ( i don't remember, but you may have to use the char based offset so you would to do *4 as well for integers).
See arkshine's orpheu plugin, he is using similar offsets.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-01-2012 , 03:56   Re: Need to know which factors blocks team joining
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
Actually m_bSpawnsCounted is a real bool si it's linux 160 and windows 168
For the other ones, it's windows + 2 ( i don't remember, but you may have to use the char based offset so you would to do *4 as well for integers).
See arkshine's orpheu plugin, he is using similar offsets.
Yeah that's where I've learned from - Arkshine's plugins. I never saw anything OS related in there. I was under the impression that Orpheu sorted that part out itself.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-01-2012 , 04:02   Re: Need to know which factors blocks team joining
Reply With Quote #10

OS part is in files that are parsed at map start, not in plugin sources.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 15:24.


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