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

[TF2] Tournament change team status


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 08-10-2013 , 12:40   [TF2] Tournament change team status
Reply With Quote #1

Hi!

I looking for command to changing team status. I found in other plugin for MvM command:
Code:
tournament_player_readystate
But in tournament mode this command dont working.

Last edited by pTu; 08-10-2013 at 12:44.
pTu is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 08-10-2013 , 14:44   Re: [TF2] Tournament change team status
Reply With Quote #2

To hook you should hook an event for that
some example code
PHP Code:
HookEvent("tournament_stateupdate"Event_TournamentStateupdate); 
public 
Event_TournamentStateupdate(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
team GetClientTeam(GetEventInt(event"userid"));
    new 
bool:nameChange GetEventBool(event"namechange");
    new 
bool:readyState GetEventBool(event"readystate");
    if (!
nameChange)
    {
        switch (
team)
        {
            case 
TF_TEAM_RED (or whatever its called): redready true
            
case TF_TEA_M_BLUEbluready true
        
}

        if (
redready && bluready)
        {
            
//both teams are ready
        
}
        else if (
redready)
        {
            
// red is ready
        
}
        else if (
blueready)
        {
            
//blue is ready
        
}
        else
        {
            
// both teams are not ready
        
}
    }

to switch - take a look at a matchmod for tf2
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 08-10-2013 at 15:36.
Root_ is offline
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 08-10-2013 , 21:28   Re: [TF2] Tournament change team status
Reply With Quote #3

Ty for code and info about matchmod but i dont found in matchmod plugin code about "how to change team status on Ready". :/
pTu is offline
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 08-11-2013 , 11:37   Re: [TF2] Tournament change team status
Reply With Quote #4

On IRC @psychonic and @asherkin prompts me to used CreateEvent teamplay_team_ready and SetEventInt Team. i create code but still team is not ready.

PHP Code:
new Handle:event CreateEvent("teamplay_team_ready");
    
SetEventInt(event"team"2);
    
FireEvent(event); 
pTu 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 16:00.


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