Raised This Month: $ Target: $400
 0% 

Autojoin problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
topiim
Senior Member
Join Date: Feb 2010
Old 07-31-2014 , 17:57   Autojoin problems
Reply With Quote #1

Actually I'm doing something like an Automix and I'm trying to hook the jointeam with a code that I found in the Auto-Jointeam plugin.
The problem: It lets me to choose my class (skin) and it doesn't have to.

Here is the code:

PHP Code:
new teamsChoosen false;
new 
hookM true;
new 
team[32];

public 
plugin_init(){
        
register_message(get_user_msgid("VGUIMenu"), "Message_VGUIMenu");
        
register_message(get_user_msgid("ShowMenu"), "Message_ShowMenu");
        
register_clcmd("jointeam""join");
        
register_clcmd("chooseteam""choose");
}

public 
Message_VGUIMenu(msgIddestid) {    
    if(
hookM && !teamsChoosen){    
        if(
is_user_connected(id) && get_msg_arg_int(1) == 2){
            new 
params[2];
            
params[0] = msgId;
        
            
set_task(0.1"autoJoin"idparamssizeof(params));
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
Message_ShowMenu(msgIddestid){    
    if(
hookM && !teamsChoosen){
        new 
menuCode[32];
        
get_msg_arg_string(4menuCodecharsmax(menuCode));
        
        if(
containi(menuCode"Team_Select") > 0){
            new 
params[2];
            
params[0] = msgId;
        
            
set_task(0.1"autoJoin"idparamssizeof(params));
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
autoJoin(params[], id){    
    new 
block get_msg_block(params[0]);
    
set_msg_block(params[0], BLOCK_SET);
    
    
engclient_cmd(id"jointeam"team[id]);
    
engclient_cmd(id"joinclass""5");
    
    
set_msg_block(params[0], block);
}

public 
join(id){
    new 
param[32];
    
read_args(paramcharsmax(param));
    
remove_quotes(param);
    
trim(param);

    if(
hookM && !teamsChoosen){
        if(
equal(param"1")){
            return 
PLUGIN_CONTINUE;
        }
        else if(
equal(param"2")){
            return 
PLUGIN_CONTINUE;
        }
        else{
            
client_print(idprint_chat"You cannot join to that team now.");
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
choose(id){
    new 
random random_num(01);

    if(
random == 0){
        
team[id] = "1";
    }
    else if(
random == 1){
        
team[id] = "2";
    }

    
engclient_cmd(id"jointeam"team[id]);
    
    return 
PLUGIN_HANDLED;


Last edited by topiim; 07-31-2014 at 17:59.
topiim is offline
topiim
Senior Member
Join Date: Feb 2010
Old 08-02-2014 , 15:52   Re: Autojoin problems
Reply With Quote #2

Solved. Thanks for the help guys, I'm being sarcastic btw.
topiim is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2014 , 17:49   Re: Autojoin problems
Reply With Quote #3

Quote:
Originally Posted by topiim View Post
Solved. Thanks for the help guys, I'm being sarcastic btw.
You're welcome, I'm not being sarcastic btw.
__________________
fysiks 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 22:06.


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