Raised This Month: $ Target: $400
 0% 

Plmenu [teammenu]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ish12321
Veteran Member
Join Date: May 2016
Old 04-08-2017 , 05:31   Plmenu [teammenu]
Reply With Quote #1

PHP Code:
    switch (key)
    {
        case 
6
        {
            
g_silent[id] = !g_silent[id];
            
displayTeamMenu(idg_menuPosition[id]);
        }
        case 
7:
        {
            
g_menuOption[id] = (g_menuOption[id] + 1) % 3;
            
displayTeamMenu(idg_menuPosition[id]);
        }
        case 
8:
        {
            
displayTeamMenu(id, ++g_menuPosition[id]);
        }
        case 
9:
        {
            
displayTeamMenu(id, --g_menuPosition[id]);
        }
        default:
        {
            new 
player g_menuPlayers[id][g_menuPosition[id] * key];
            if (!
is_user_connected(player)) // dunno why this check hasn't be implemented in the past
            
{
                
displayTeamMenu(idg_menuPosition[id]);
                return 
PLUGIN_HANDLED;
            }

            
g_transferingAdmin id;

            new 
authid[32], authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH];

            
get_user_name(playername2charsmax(name2));
            
get_user_authid(idauthidcharsmax(authid));
            
get_user_authid(playerauthid2charsmax(authid2));
            
get_user_name(idnamecharsmax(name));

            
// This modulo math just aligns the option to the CsTeams-corresponding number
            
new destTeamSlot = (g_menuOption[id] % 3);

            
log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")"nameget_user_userid(id), authidname2get_user_userid(player), authid2g_CSTeamNames[destTeamSlot]);

            
show_activity_key("ADMIN_TRANSF_1""ADMIN_TRANSF_2"namename2g_CSTeamNames[destTeamSlot]);

            if (
destTeamSlot == 2)
            {
                if (
g_fakemeta)
                {
                    if (
get_pdata_int(playerm_iMenu) == Menu_ChooseAppearance)
                    {
                        
// works for both vgui and old style menus, and send menuselect could close other menus (and since get_user_menu fails to return VGUI and old style classes menus...)
                        
engclient_cmd(player"joinclass""6");
                    }
                }
                else 
// force
                
{
                    
engclient_cmd(player"joinclass""6");
                }
            }

            if (
g_CSPlayerCanSwitchFromSpec[player] && g_cstrike && (CS_TEAM_T <= cs_get_user_team(player) <= CS_TEAM_CT))
            {
                if (
is_user_alive(player) && (!g_silent[id] || destTeamSlot == 2))
                {
                    new 
deaths cs_get_user_deaths(player);
                    
user_kill(player1);
                    
cs_set_user_deaths(playerdeaths);
                }

                
cs_set_user_team(playerdestTeamSlot 1);

            }
            else
            {
                if (
is_user_alive(player) && (!g_silent[id] || destTeamSlot == 2))
                {
                    
user_kill(player1);
                }
                if (
g_fakemeta)
                {
                    
set_pdata_bool(playerm_bTeamChangedtrue);
                }
                new 
limit_setting;
                if (
mp_limitteams)
                {
                    
limit_setting get_pcvar_num(mp_limitteams);

                    
set_pcvar_num(mp_limitteams0);
                }

                if (
destTeamSlot == 2)
                {
                    new 
Float:allow_spectators_setting;
                    if (
allow_spectators)
                    {
                        
allow_spectators_setting get_pcvar_float(allow_spectators);
                        if (
allow_spectators_setting != 1.0)
                        {
                            
set_pcvar_float(allow_spectators1.0);
                        }
                    }
                    
engclient_cmd(player"jointeam"g_CSTeamNumbers[destTeamSlot]);
                    if (
allow_spectators && allow_spectators_setting != 1.0)
                    {
                        
set_pcvar_float(allow_spectatorsallow_spectators_setting);
                    }
                }
                else
                {
                    
engclient_cmd(player"jointeam"g_CSTeamNumbers[destTeamSlot]);
                    
engclient_cmd(player"joinclass""1");
                }
                if (
mp_limitteams && limit_setting != 0)
                {
                    
set_pcvar_num(mp_limitteamslimit_setting);
                }
            }
            if (
g_cstrike)
            {
                
cs_reset_user_model(player);
            }
            if (
g_fakemeta)
            {
                
set_pdata_bool(playerm_bTeamChangedtrue);
            }

            
g_transferingAdmin 0;
            
displayTeamMenu(idg_menuPosition[id]);
        }
    }

    return 
PLUGIN_HANDLED
This is the action teammenu part of plmenu of reamxmodx
In this on trasnferring to spec is going well (player kills and transferred) , transfer to ct and t is not going like this
please someone edit it to work like that
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 04-08-2017 , 12:06   Re: Plmenu [teammenu]
Reply With Quote #2

Why complicate things? Why not just use a simple menu system and natives for transferring?
redivcram is offline
ish12321
Veteran Member
Join Date: May 2016
Old 04-08-2017 , 12:35   Re: Plmenu [teammenu]
Reply With Quote #3

This is default AMXX plugin ..
If I use a simple menu since this has all other menu's i will have to make all others too
Hence, that would be complicating and just modifying a single thing wouldn't be complicating things
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 04-08-2017 , 12:50   Re: Plmenu [teammenu]
Reply With Quote #4

In that case... making a new plugin for managing the menu with the new menu system would be another solution, but you'd have to make and call natives in plmenu from the menu manager and vice versa.
redivcram is offline
ish12321
Veteran Member
Join Date: May 2016
Old 04-09-2017 , 06:54   Re: Plmenu [teammenu]
Reply With Quote #5

Quote:
Originally Posted by redivcram View Post
In that case... making a new plugin for managing the menu with the new menu system would be another solution, but you'd have to make and call natives in plmenu from the menu manager and vice versa.
Yes, that would be an option but would be a long time work ?
Please could you if possible help me with me issue
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 04-11-2017 , 15:31   Re: Plmenu [teammenu]
Reply With Quote #6

BUMP
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-11-2017 , 16:17   Re: Plmenu [teammenu]
Reply With Quote #7

If you mean the "silent" mode, yes, it's not going to do what you expect (It's just a straight team change and doing nothing else). Not sure why we have this because it's quite specific. It's planned to add an option to fully and properly transfer an alive player in AMXX.
__________________
Arkshine is offline
ish12321
Veteran Member
Join Date: May 2016
Old 04-11-2017 , 17:49   Re: Plmenu [teammenu]
Reply With Quote #8

Edit : Solved
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here

Last edited by ish12321; 04-11-2017 at 17:55.
ish12321 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 18:03.


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