Mixselection BUG
#1
Alguien me puede ayudar? tengo un problema cuando yo eleji un CT para mi equipo funciona bien pero al TT que es "capitan" no le sale el menu para elegir a un TT

Código PHP:
// Official post: http://forums.alliedmods.net/showthread.php?t=154943


#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

#define PLUGIN "Mix Selection"
#define VERSION "1.0"
#define AUTHOR "Neeeeeeeeeel.-"

// Original idea: Marcelo12
// Player list by meTaLiCroSS
// Thanks shinoda for the loop to open the menu to the other capitan
// Thanks lucas_7_94, some fixs and cvar to show servers running this plugin

// Vars
new CapitanCT[33], CapitanTT[33], MS_tag[20], SelectionON,
RoundKnifeCTsCountTTsCountg_iMaxplayersg_iMsgMoney

// Pcvars
new cvar_tagcvar_ms_enabledcvar_MinPlayers

public plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR)

    register_clcmd("say /cut""sayCut")
    register_clcmd("say /public""sayPublic")
    register_clcmd("say /cortar""sayCut")
    register_clcmd("say /publico""sayPublic")
    
    register_concmd
("jointeam""BlockFuction")
    
    register_dictionary
("MixSelection.txt")
    
    register_event
"Money""EventMoney""b" )
    
    RegisterHam
(Ham_Spawn"player""fw_playerspawn"1)
    RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
    register_cvar
("MixSelection 1.0" AUTHOR FCVAR_SERVER FCVAR_PROTECTED)
    
    cvar_tag 
register_cvar("ms_tag""Server")
    cvar_ms_enabled register_cvar("ms_enable""1")
    cvar_MinPlayers register_cvar("ms_min_players""10")
    
    get_pcvar_string
(cvar_tagMS_tagcharsmax(MS_tag))
    
    g_iMaxplayers 
get_maxplayers()
    g_iMsgMoney get_user_msgid("Money")
}

public 
sayPublic(id)
{
    if(!SelectionON)
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_ALREADYPUBLIC")
        return PLUGIN_HANDLED
    
}
    
    
if(get_user_flags(id) & ADMIN_KICK)
    {
        new players[32], pnumtempid
        
        get_players
(playerspnum)
        
        
for( new ii<pnumi++ )
        {
            tempid players[i]
            CapitanCT[tempid] = false
            CapitanTT
[tempid] = false
        
}
        
        RoundKnife 
0
        SelectionON 
0
        server_cmd
("sv_restart 1")
        
        ChatColor
(0"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_PUBLIC")
    }
    
    
else
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_NOT_ACCES")
        return PLUGIN_HANDLED
    
}
    
    
return PLUGIN_HANDLED    
}

public 
sayCut(id)
{
    
    
if(!get_pcvar_num(cvar_ms_enabled))
    {
        ChatColor(id"!g[%s] !y%s %L"MS_tagPLUGINLANG_PLAYER"MS_NOT_ENABLED")
        return PLUGIN_HANDLED
    
}
    
    
new PlayersON
    
    
for(new 1<= g_iMaxplayersi++)
    {
        if(is_user_connected(i))
        PlayersON++
    }
    
    
if(PlayersON get_pcvar_num(cvar_MinPlayers))
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_MIN_PLAYERS"get_pcvar_num(cvar_MinPlayers))
        return PLUGIN_HANDLED
    
}
    
    
if(get_user_flags(id) & ADMIN_KICK)
    {
        if(SelectionON)
        {
            ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_ALREADYON"PLUGINVERSION)
            return PLUGIN_HANDLED
        
}
        
        
new players[32], num
        get_players
(playersnum)
        
        
new player
        
for(new 0numi++)
        {
            player players[i]
                
            user_kill
(player1)
            cs_set_user_team(playerCS_TEAM_SPECTATOR)
        }
        
        ChatColor
(0"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_SELECT_CAPITAN")
        
        set_task
(3.0"menuCapCT"id)
        SelectionON 1
    
}
    
    
else
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_NOT_ACCES")
        return PLUGIN_HANDLED
    
}
    
    
return PLUGIN_HANDLED
}

public 
client_putinserver(id)
{
    if(SelectionON)
        set_task(5.0"TranferSpect"id)
        
    CapitanCT
[id] = false
    CapitanTT
[id] = false
    
}

public 
TranferSpect(id)
{
    user_kill(id1)
    cs_set_user_team(idCS_TEAM_SPECTATOR)
}


public 
menuCapCT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_CAP_CT")
    new Menu menu_create(data"Show_CapCT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        get_user_name
(tempidszNamecharsmax(szName))
        num_to_str(tempidszTempidcharsmax(szTempid))
        menu_additem(MenuszNameszTempid0)
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_CapCT(idMenuitem)
{
    new data[6], iName[64]
    new accesscallback
    menu_item_getinfo
(Menuitemaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)

    
    cs_set_user_team
(tempidCS_TEAM_CT)
    CapitanCT[tempid] = true
    ChatColor
(0"!g[%s] !team%s %L"MS_tagiNameLANG_PLAYER"MS_CAPCT_SELECTED")
    menuCapTT(id)
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
menuCapTT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_CAP_TT")
    new Menu menu_create(data"Show_CapTT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        
if(!CapitanCT[tempid])
        {
            get_user_name(tempidszNamecharsmax(szName))    
            num_to_str
(tempidszTempidcharsmax(szTempid))
            menu_additem(MenuszNameszTempid0)
        }
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_CapTT(idMenuitem)
{
    new data[6], iName[64]
    new accesscallback
    menu_item_getinfo
(Menuitemaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)
    new uName[33]
    get_user_name(tempiduNamecharsmax(uName))
    
    
if(cs_get_user_team(tempid) == CS_TEAM_CT)
    {
        ChatColor(id"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_SELECT_OTHER")
        menuCapTT(id)
    }
    
    
else
    {
        cs_set_user_team(tempidCS_TEAM_T)
        CapitanTT[tempid] = true
        ChatColor
(0"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_CAPTT_SELECTED")
        server_cmd("sv_restart 5")
        set_task(4.0"StartRoundKnife")
    }
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
StartRoundKnife()
{
    ChatColor(0"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_KNIFE_START")
    RoundKnife 1
}

public 
fw_playerspawn(id)
{
    if(RoundKnife && is_user_alive(id))
    {
        fm_strip_user_weapons(id)
        give_item(id"weapon_knife")
    }
}

public 
EventMoney(id)
{
    if(RoundKnife && is_user_alive(id))
    {
        set_pdata_int(id1150)
        message_beginMSG_ONE_UNRELIABLEg_iMsgMoney_id )
        write_long (0)
        write_byte (1)
        message_end()
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    if(RoundKnife && is_user_alive(attacker))
    {
        new CapitanAttacker get_user_team(attacker)
        new CapitanVictim get_user_team(victim)
        
        
new atName[33]
        get_user_name(attackeratNamecharsmax(atName))
        
        
if(CapitanAttacker == && CapitanVictim == 1)
        {
            ChatColor(0"!g[%s] !team%s %L"MS_tagatNameLANG_PLAYER"MS_CAPCT_WIN")
            set_task(5.0"SelectCT"attacker)
        }
        
        
else if(CapitanAttacker == && CapitanVictim == 2)
        {
            ChatColor(0"!g[%s] !team%s %L"MS_tagatNameLANG_PLAYER"MS_CAPTT_WIN")
            set_task(5.0"SelectTT"attacker)
        }
        
        RoundKnife 
0
    
}
}

public 
SelectTT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_TEAMMATES")
    new Menu menu_create(data"Show_PlayersTT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        
if(get_user_team(tempid) == 3)
        {
            get_user_name(tempidszNamecharsmax(szName))
            num_to_str(tempidszTempidcharsmax(szTempid))
            menu_additem(MenuszNameszTempid0)
        }
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_PlayersTT(idMenuitem)
{
    new data[6], iName[64]
    new iaccesscallback
    menu_item_getinfo
(Menuitemiaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)
    new uName[33]
    get_user_name(tempiduNamecharsmax(uName))
    
    
    
if(CapitanTT[id])
    {
        cs_set_user_team(tempidCS_TEAM_T)
        ChatColor(0"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_TT_SELECTED")
        TTsCount++
        
        
for(new i=1i<=g_iMaxplayersi++)
        {
            if(CapitanCT[i])
            {
                if((CTsCount TTsCount) < 10)
                {
                    SelectCT(i)
                    break
                }
            }
        }
    }
    
    SelectionFinish
()
        
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
SelectCT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_TEAMMATES")
    new Menu menu_create(data"Show_PlayersCT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        
if(get_user_team(tempid) == 3)
        {
            get_user_name(tempidszNamecharsmax(szName))
            num_to_str(tempidszTempidcharsmax(szTempid))
            menu_additem(MenuszNameszTempid0)
        }
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_PlayersCT(idMenuitem)
{
    new data[6], iName[64]
    new accesscallback
    menu_item_getinfo
(Menuitemaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)
    new uName[33]
    get_user_name(tempiduNamecharsmax(uName))
    
    
if(CapitanCT[id])
    {
        cs_set_user_team(tempidCS_TEAM_CT)
        ChatColor(0"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_CT_SELECTED")
        CTsCount++
        
        
for(new i=1i<=g_iMaxplayersi++)
        {
            if( CapitanTT[i] )
            {
                if((CTsCount TTsCount) < 10)
                {
                    SelectCT(i)
                    break
                }
            }
        }
    }
    
    SelectionFinish
()
        
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
SelectionFinish()
{
    if((CTsCount TTsCount) == 8)
    {
        ChatColor(0"!g[%s] %L"MS_tagLANG_PLAYER"MS_END")
        SelectionON 0
        server_cmd
("sv_restart 5")
    }
}

public 
BlockFuction(id)
{
    if(cs_get_user_team(id) == CS_TEAM_SPECTATOR && SelectionON)
    {
        cs_set_user_team(idCS_TEAM_SPECTATOR)
        return PLUGIN_HANDLED
    
}
    
    
return PLUGIN_CONTINUE
}

stock fm_strip_user_weapons(id)
{
    static ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"player_weaponstrip"))
    if (!pev_valid(ent)) return;
    
    dllfunc
(DLLFunc_Spawnent)
    dllfunc(DLLFunc_Useentid)
    engfunc(EngFunc_RemoveEntityent)
}

stock ChatColor(id, const input[], any:...)
{
    static szMsg[191], msgSayText;
    
    
if (!msgSayText)
        msgSayText get_user_msgid("SayText");
    
    vformat
(szMsg190input3);

    replace_all(szMsg190"!g""^4");
    replace_all(szMsg190"!y""^1");
    replace_all(szMsg190"!team""^3");
    
    message_begin
(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id);
    write_byte(id id 33);
    write_string(szMsg);
    message_end();

Responder
#2
Proba y avisame!

Código PHP:
// Official post: http://forums.alliedmods.net/showthread.php?t=154943


#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

#define PLUGIN "Mix Selection"
#define VERSION "1.0"
#define AUTHOR "Neeeeeeeeeel.-"

// Original idea: Marcelo12
// Player list by meTaLiCroSS
// Thanks shinoda for the loop to open the menu to the other capitan
// Thanks lucas_7_94, some fixs and cvar to show servers running this plugin

// Vars
new CapitanCT[33], CapitanTT[33], MS_tag[20], SelectionON,
RoundKnifeCTsCountTTsCountg_iMaxplayersg_iMsgMoney

// Pcvars
new cvar_tagcvar_ms_enabledcvar_MinPlayers

public plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR)

    register_clcmd("say /cut""sayCut")
    register_clcmd("say /public""sayPublic")
    register_clcmd("say /cortar""sayCut")
    register_clcmd("say /publico""sayPublic")
    
    register_concmd
("jointeam""BlockFuction")
    
    register_dictionary
("MixSelection.txt")
    
    register_event
"Money""EventMoney""b" )
    
    RegisterHam
(Ham_Spawn"player""fw_playerspawn"1)
    RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
    register_cvar
("MixSelection 1.0" AUTHOR FCVAR_SERVER FCVAR_PROTECTED)
    
    cvar_tag 
register_cvar("ms_tag""Server")
    cvar_ms_enabled register_cvar("ms_enable""1")
    cvar_MinPlayers register_cvar("ms_min_players""10")
    
    get_pcvar_string
(cvar_tagMS_tagcharsmax(MS_tag))
    
    g_iMaxplayers 
get_maxplayers()
    g_iMsgMoney get_user_msgid("Money")
}

public 
sayPublic(id)
{
    if(!SelectionON)
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_ALREADYPUBLIC")
        return PLUGIN_HANDLED
    
}
    
    
if(get_user_flags(id) & ADMIN_KICK)
    {
        new players[32], pnumtempid
        
        get_players
(playerspnum)
        
        
for( new ii<pnumi++ )
        {
            tempid players[i]
            CapitanCT[tempid] = false
            CapitanTT
[tempid] = false
        
}
        
        RoundKnife 
0
        SelectionON 
0
        server_cmd
("sv_restart 1")
        
        ChatColor
(0"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_PUBLIC")
    }
    
    
else
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_NOT_ACCES")
        return PLUGIN_HANDLED
    
}
    
    
return PLUGIN_HANDLED    
}

public 
sayCut(id)
{
    
    
if(!get_pcvar_num(cvar_ms_enabled))
    {
        ChatColor(id"!g[%s] !y%s %L"MS_tagPLUGINLANG_PLAYER"MS_NOT_ENABLED")
        return PLUGIN_HANDLED
    
}
    
    
new PlayersON
    
    
for(new 1<= g_iMaxplayersi++)
    {
        if(is_user_connected(i))
        PlayersON++
    }
    
    
if(PlayersON get_pcvar_num(cvar_MinPlayers))
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_MIN_PLAYERS"get_pcvar_num(cvar_MinPlayers))
        return PLUGIN_HANDLED
    
}
    
    
if(get_user_flags(id) & ADMIN_KICK)
    {
        if(SelectionON)
        {
            ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_ALREADYON"PLUGINVERSION)
            return PLUGIN_HANDLED
        
}
        
        
new players[32], num
        get_players
(playersnum)
        
        
new player
        
for(new 0numi++)
        {
            player players[i]
                
            user_kill
(player1)
            cs_set_user_team(playerCS_TEAM_SPECTATOR)
        }
        
        ChatColor
(0"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_SELECT_CAPITAN")
        
        set_task
(3.0"menuCapCT"id)
        SelectionON 1
    
}
    
    
else
    {
        ChatColor(id"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_NOT_ACCES")
        return PLUGIN_HANDLED
    
}
    
    
return PLUGIN_HANDLED
}

public 
client_putinserver(id)
{
    if(SelectionON)
        set_task(5.0"TranferSpect"id)
        
    CapitanCT
[id] = false
    CapitanTT
[id] = false
    
}

public 
TranferSpect(id)
{
    user_kill(id1)
    cs_set_user_team(idCS_TEAM_SPECTATOR)
}


public 
menuCapCT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_CAP_CT")
    new Menu menu_create(data"Show_CapCT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        get_user_name
(tempidszNamecharsmax(szName))
        num_to_str(tempidszTempidcharsmax(szTempid))
        menu_additem(MenuszNameszTempid0)
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_CapCT(idMenuitem)
{
    new data[6], iName[64]
    new accesscallback
    menu_item_getinfo
(Menuitemaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)

    
    cs_set_user_team
(tempidCS_TEAM_CT)
    CapitanCT[tempid] = true
    ChatColor
(0"!g[%s] !team%s %L"MS_tagiNameLANG_PLAYER"MS_CAPCT_SELECTED")
    menuCapTT(id)
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
menuCapTT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_CAP_TT")
    new Menu menu_create(data"Show_CapTT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        
if(!CapitanCT[tempid])
        {
            get_user_name(tempidszNamecharsmax(szName))    
            num_to_str
(tempidszTempidcharsmax(szTempid))
            menu_additem(MenuszNameszTempid0)
        }
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_CapTT(idMenuitem)
{
    new data[6], iName[64]
    new accesscallback
    menu_item_getinfo
(Menuitemaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)
    new uName[33]
    get_user_name(tempiduNamecharsmax(uName))
    
    
if(cs_get_user_team(tempid) == CS_TEAM_CT)
    {
        ChatColor(id"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_SELECT_OTHER")
        menuCapTT(id)
    }
    
    
else
    {
        cs_set_user_team(tempidCS_TEAM_T)
        CapitanTT[tempid] = true
        ChatColor
(0"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_CAPTT_SELECTED")
        server_cmd("sv_restart 5")
        set_task(4.0"StartRoundKnife")
    }
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
StartRoundKnife()
{
    ChatColor(0"!g[%s] !y%L"MS_tagLANG_PLAYER"MS_KNIFE_START")
    RoundKnife 1
}

public 
fw_playerspawn(id)
{
    if(RoundKnife && is_user_alive(id))
    {
        fm_strip_user_weapons(id)
        give_item(id"weapon_knife")
    }
}

public 
EventMoney(id)
{
    if(RoundKnife && is_user_alive(id))
    {
        set_pdata_int(id1150)
        message_beginMSG_ONE_UNRELIABLEg_iMsgMoney_id )
        write_long (0)
        write_byte (1)
        message_end()
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    if(RoundKnife && is_user_alive(attacker))
    {
        new CapitanAttacker get_user_team(attacker)
        new CapitanVictim get_user_team(victim)
        
        
new atName[33]
        get_user_name(attackeratNamecharsmax(atName))
        
        
if(CapitanAttacker == && CapitanVictim == 1)
        {
            ChatColor(0"!g[%s] !team%s %L"MS_tagatNameLANG_PLAYER"MS_CAPCT_WIN")
            set_task(5.0"SelectCT"attacker)
        }
        
        
else if(CapitanAttacker == && CapitanVictim == 2)
        {
            ChatColor(0"!g[%s] !team%s %L"MS_tagatNameLANG_PLAYER"MS_CAPTT_WIN")
            set_task(5.0"SelectTT"attacker)
        }
        
        RoundKnife 
0
    
}
}

public 
SelectTT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_TEAMMATES")
    new Menu menu_create(data"Show_PlayersTT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        
if(get_user_team(tempid) == 3)
        {
            get_user_name(tempidszNamecharsmax(szName))
            num_to_str(tempidszTempidcharsmax(szTempid))
            menu_additem(MenuszNameszTempid0)
        }
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_PlayersTT(idMenuitem)
{
    new data[6], iName[64]
    new iaccesscallback
    menu_item_getinfo
(Menuitemiaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)
    new uName[33]
    get_user_name(tempiduNamecharsmax(uName))
    
    
    
if(CapitanTT[id])
    {
        cs_set_user_team(tempidCS_TEAM_T)
        ChatColor(0"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_TT_SELECTED")
        TTsCount++
        
        
for(new i=1i<=g_iMaxplayersi++)
        {
            if(CapitanCT[i])
            {
                if((CTsCount TTsCount) < 10)
                {
                    SelectCT(i)
                    break
                }
            }
        }
    }
    
    SelectionFinish
()
        
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
SelectCT(id)
{
    new data[128], players[32], pnumtempidszName[33], szTempid[10]
    
    formatex
(datacharsmax(data), "\y%s^n\wVersion: \r%s^n^n\w%L"PLUGINVERSIONLANG_PLAYER"MS_SELECT_TEAMMATES")
    new Menu menu_create(data"Show_PlayersCT")
    
    get_players
(playerspnum)
    
    
for( new ii<pnumi++ )
    {
        tempid players[i]
        
        
if(get_user_team(tempid) == 3)
        {
            get_user_name(tempidszNamecharsmax(szName))
            num_to_str(tempidszTempidcharsmax(szTempid))
            menu_additem(MenuszNameszTempid0)
        }
    }
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_NEXT_PAGE")
    menu_setprop(Menu,MPROP_NEXTNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_BACK_PAGE")
    menu_setprop(Menu,MPROP_BACKNAMEdata)
    
    formatex
(datacharsmax(data), "%L"LANG_PLAYER"MS_EXIT")
    menu_setprop(Menu,MPROP_EXITNAMEdata)
    menu_display(idMenu0)
}

public 
Show_PlayersCT(idMenuitem)
{
    new data[6], iName[64]
    new accesscallback
    menu_item_getinfo
(Menuitemaccessdata,5iName63callback)
    
    
new tempid str_to_num(data)
    new uName[33]
    get_user_name(tempiduNamecharsmax(uName))
    
    
if(CapitanCT[id])
    {
        cs_set_user_team(tempidCS_TEAM_CT)
        ChatColor(0"!g[%s] !team%s %L"MS_taguNameLANG_PLAYER"MS_CT_SELECTED")
        CTsCount++
        
        
for(new i=1i<=g_iMaxplayersi++)
        {
            if( CapitanTT[i] )
            {
                if((CTsCount TTsCount) < 10)
                {
                    SelectTT(i)
                    break
                }
            }
        }
    }
    
    SelectionFinish
()
        
    
    menu_destroy
(Menu)
    return PLUGIN_HANDLED
}

public 
SelectionFinish()
{
    if((CTsCount TTsCount) == 8)
    {
        ChatColor(0"!g[%s] %L"MS_tagLANG_PLAYER"MS_END")
        SelectionON 0
        server_cmd
("sv_restart 5")
    }
}

public 
BlockFuction(id)
{
    if(cs_get_user_team(id) == CS_TEAM_SPECTATOR && SelectionON)
    {
        cs_set_user_team(idCS_TEAM_SPECTATOR)
        return PLUGIN_HANDLED
    
}
    
    
return PLUGIN_CONTINUE
}

stock fm_strip_user_weapons(id)
{
    static ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"player_weaponstrip"))
    if (!pev_valid(ent)) return;
    
    dllfunc
(DLLFunc_Spawnent)
    dllfunc(DLLFunc_Useentid)
    engfunc(EngFunc_RemoveEntityent)
}

stock ChatColor(id, const input[], any:...)
{
    static szMsg[191], msgSayText;
    
    
if (!msgSayText)
        msgSayText get_user_msgid("SayText");
    
    vformat
(szMsg190input3);

    replace_all(szMsg190"!g""^4");
    replace_all(szMsg190"!y""^1");
    replace_all(szMsg190"!team""^3");
    
    message_begin
(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id);
    write_byte(id id 33);
    write_string(szMsg);
    message_end();

(12/03/2014, 08:11 PM)roccoxx escribió: jajajajajajajajajajajajajajajaajajajajajaajajajajajajajajajajajajajajajajajajajajajajajajajjajajjajajajajaja

todo eso elevado a la quinta potencia.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)