Raised This Month: $ Target: $400
 0% 

catch "team is full" event, help it doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 03-29-2009 , 05:42   catch "team is full" event, help it doesn't work
Reply With Quote #1

PHP Code:
/* AMX Mod X Plugin

* (c) Copyright 2008, ConnorMcLeod 
* This file is provided as is (no warranties). 

*/ 

#include <amxmodx>
#include <fakemeta>

#define ADMIN_CHOOSETEAM    ADMIN_RCON

#define OFFSET_TEAM        114
#define OFFSET_DEFUSE_PLANT        193
#define HAS_DEFUSE_KIT            (1<<16)
#define OFFSET_INTERNALMODEL        126

new g_msgidStatusIcong_msgidTeamInfo

public plugin_init()
{
    
register_plugin("Admin ChooseTeam""0.1""ConnorMcLeod")
    
register_event("TextMsg""Too_Many""b""1=4""2&#Too_Many")
}

public 
plugin_cfg()
{
    
g_msgidStatusIcon get_user_msgid("StatusIcon")
    
g_msgidTeamInfo get_user_msgid("TeamInfo")
}

public 
Too_Many(id)
{
    if(
is_user_bot(id))
        return

/*    if(!(get_user_flags(id) & ADMIN_CHOOSETEAM))
    {
        return
    }*/

    
static team[12]
    
read_data(2team11)
    if(
team[10] == 'T')
    {
        if( 
get_pdata_int(idOFFSET_TEAM) != 1)
        {
            
cs_set_user_team(id1)
        }
    }
    else if(
team[10] == 'C')
    {
        if( 
get_pdata_int(idOFFSET_TEAM) != 2)
        {
            
cs_set_user_team(id2)
        }
    }
}

cs_set_user_team(idteam)
{
    switch(
team)
    {
        case 
1
        {
            new 
iDefuser get_pdata_int(idOFFSET_DEFUSE_PLANT)
            if(
iDefuser HAS_DEFUSE_KIT)
            {
                
iDefuser -= HAS_DEFUSE_KIT
                set_pdata_int
(idOFFSET_DEFUSE_PLANTiDefuser)

                static const 
defuser[] = "defuser"            
                
message_begin(MSG_ONE_UNRELIABLEg_msgidStatusIcon_id)
                
write_byte(0)
                
write_string(defuser)
                
write_byte(0)
                
write_byte(255)
                
write_byte(0)
                
message_end()
            }
            
set_pdata_int(idOFFSET_TEAM1)
            
set_pdata_int(idOFFSET_INTERNALMODEL4)
        }
        case 
2:
        {
            if(
pev(idpev_weapons) & (1<<CSW_C4))
            {
                
engclient_cmd(id"drop""weapon_c4")
            }
            
set_pdata_int(idOFFSET_TEAM2)
            
set_pdata_int(idOFFSET_INTERNALMODEL6)
        }
    }

    
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid))

    static const 
szTeamNames[][] = {"TERRORIST""CT"}
    
message_begin(MSG_BROADCASTg_msgidTeamInfo)
    
write_byte(id)
    
write_string(szTeamNames[team-1])
    
message_end()

hi, i'm trying to get this to work, but no luck, it doesn't do its job, can you tell me what can be wrong? )= (i think it doesn't properly hook "team is full" message and takes no action
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Reply


Thread Tools
Display Modes

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 08:59.


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