Raised This Month: $32 Target: $400
 8% 

Solved ChooseTeam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-26-2020 , 16:39   ChooseTeam
Reply With Quote #1

Hi. What up. Well I need a small plugin but is hard to make it. I want a choose team menu like this:
Quote:
1- Terrorist Team [Terrorist Numbers]
2- CT Team [Ct Team Nubmers]



6-spector
I dont want user choose a player,i just want when user select Tr or Ct become on it.
I Set a Menu On M Key in my server, So I want This Menu work with
another Cmd. Because When i add chooseteam option in my [M] Menu, it Open same Menu(it open[M] Menu Not Choose Team) Again.
I search and found 2 choose team plugin, But Have lot of bug and not work.

Thanks Guys, Please Make it For me. And Sorry For my Bad english.

Last edited by ho83; 11-27-2020 at 14:58.
ho83 is offline
Old 11-26-2020, 17:06
redivcram
This message has been deleted by redivcram.
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-27-2020 , 07:37   Re: ChooseTeam
Reply With Quote #2

didn't work bro. I Want somthing like that:
Attached Thumbnails
Click image for larger version

Name:	Screenshot (20).png
Views:	65
Size:	22.4 KB
ID:	185187  
ho83 is offline
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-27-2020 , 07:42   Re: ChooseTeam
Reply With Quote #3

and also how can solve this problem?
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

#define PLUGIN "jbmenu"
#define AUTHOR "Mamad"
#define VERSION "1.0"

new ChooseTeamOverrideActive[33];

public 
plugin_init()
{
    
register_pluginPLUGINVERSION,  AUTHOR);
    
register_clcmd("say /jb_menu""jbmenu");
    
register_clcmd("chooseteam""ChooseTeam");    
}

public 
ChooseTeam(id) {
    if (
ChooseTeamOverrideActive[id]) {
        
jbmenu(id)
        return 
PLUGIN_HANDLED;
    }
    
ChooseTeamOverrideActive[id] = true
    
return PLUGIN_CONTINUE;
}

public 
client_putinserver(id)
ChooseTeamOverrideActive[id] = true

public jbmenu(id)
{
            new 
menu menu_create("\r[M] \wMenu""jbmenu_handler");
        
            
menu_additem(menu"\wShop^n""1"0);
            
menu_additem(menu"\wSleep\y[\r/sleep\y]""2"0);
            
menu_additem(menu"\wWakeUp\y[\r/wakeup\y]^n""3"0);
       
menu_additem(menu"\yChange Team""4"0); 
        
            
menu_setprop(menuMPROP_EXITMEXIT_ALL);
            
menu_display(idmenu0);
            return 
PLUGIN_HANDLED
}

public 
jbmenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
Player(id);     
        }
        case 
2:
        {
            
client_cmd(id,"say /sleep");            
        }
        case 
3:
        {
            
client_cmd(id,"say /wakeup");            
        }
        case 
4:
        {
       
client_cmd(id"chooseteam");
        }
     }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
Player(id)
{
            new 
menu menu_create("\yShop Menu""Shop_handler");
        
            
menu_additem(menu"\wShop \y[Money]""1"0);
            
menu_additem(menu"\wShop \rExd Items\y[coin]""2"0);
            
menu_additem(menu"\wShop \rExd Knife\y[coin]""3"0);
            
menu_additem(menu"\wSuperVip \rShop \y[Vip]""4"0);        
        
            
menu_setprop(menuMPROP_EXITMEXIT_ALL);
            
menu_display(idmenu0);
            return 
PLUGIN_HANDLED
}

public 
Shop_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
client_cmd(id,"say /shopitem")     
        }
        case 
2:
        {
            
client_cmd(id,"say /shop")            
        }
        case 
3:
        {
            
client_cmd(id,"say /knifeshop")            
        }
        case 
4:
        {
            
client_cmd(id,"say /smshop")            
        }    
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

I can't Change my team from this menu. Tried
Quote:
Jointeam
But didn't work. My Mod Is Something like thismod:https://forums.alliedmods.net/showthread.php?t=120991

Last edited by ho83; 11-27-2020 at 07:44.
ho83 is offline
Old 11-27-2020, 08:35
iceeedr
This message has been deleted by iceeedr.
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-27-2020 , 08:49   Re: ChooseTeam
Reply With Quote #4

Quote:
// D:\cstest\cstrike\addons\amxmodx\scripting\j1 .sma(3 : warning 217: loose in
dentation
// D:\cstest\cstrike\addons\amxmodx\scripting\j1 .sma(40) : warning 217: loose in
dentation
// D:\cstest\cstrike\addons\amxmodx\scripting\j1 .sma(75) : error 017: undefined
symbol "fmt"
// D:\cstest\cstrike\addons\amxmodx\scripting\j1 .sma(77) : warning 217: loose in
dentation
// D:\cstest\cstrike\addons\amxmodx\scripting\j1 .sma(119) : error 017: undefined
symbol "set_ent_data"
This errors Bro.
ho83 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-27-2020 , 09:55   Re: ChooseTeam
Reply With Quote #5

Quote:
Originally Posted by ho83 View Post
This errors Bro.
I'm sorry I use amxx 1.10 and its new native ones and I end up forgetting that here you use the stable version, below is a new version that I believe works.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "jbmenu"
#define AUTHOR "Mamad"
#define VERSION "1.0"

#define m_iMenuCode 205
new const CS_STATE_GET_INTO_GAME2 5
new const m_iJoiningState 121;

public 
plugin_init()
{
        
register_pluginPLUGINVERSION,  AUTHOR);
        
register_message(get_user_msgid("ShowMenu"), "MessageShowMenu");
        
register_message(get_user_msgid("VGUIMenu"), "MessageVGUIMenu")
}

public 
MessageShowMenu(iMsgIDiDestiReceiver)
{
        new const 
Team_Select[] = "#Team_Select";
        new 
szMenu[sizeof(Team_Select)];
    
        
get_msg_arg_string(4szMenucharsmax(szMenu));

        if(!
equal(szMenuTeam_Select))
        {
            return 
PLUGIN_CONTINUE;
        }

        
// reset CS menu code
       
set_pdata_int(iReceiverm_iMenuCode0);

        
jbmenu(iReceiver)

        return 
PLUGIN_HANDLED;
}

public 
MessageVGUIMenu(iMsgIDiDestiReceiver)
{
        if(
get_msg_arg_int(1) != 2)
        {
            return 
PLUGIN_CONTINUE;
        }

        
jbmenu(iReceiver)

        return 
PLUGIN_HANDLED;
}

public 
jbmenu(id)
{
        new 
menu menu_create("\r[M] \wMenu""jbmenu_handler");
        
        
menu_additem(menu"\wShop^n""1"0);
        
menu_additem(menu"\wSleep\y[\r/sleep\y]""2"0);
        
menu_additem(menu"\wWakeUp\y[\r/wakeup\y]^n""3"0);
        
menu_additem(menu"\yChange Team""4"0); 
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu0);
        return 
PLUGIN_HANDLED
}

public 
jbmenu_handler(idmenuitem)
{
        if( 
item == MENU_EXIT )
        {
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        
        new 
data[6], iName[64];
        new 
accesscallback;
        
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
        new 
key str_to_num(data);
    
        switch(
key)
        {
            case 
1:
            {
                    
Player(id);     
            }
            case 
2:
            {
                    
client_cmd(id,"say /sleep");            
            }
            case 
3:
            {
                    
client_cmd(id,"say /wakeup");            
            }
            case 
4:
            {    
                new 
Menu menu_create("CHOOSE TEAM""ActionTeamMenuHandle")
                new 
szBuffer[32]
                
                
formatex(szBuffercharsmax(szBuffer), "\rTEAM 1 [%i]"GetPlayersNumberByTeam(CS_TEAM_T));
                
menu_additem(Menu,szBuffer,"1")
                
formatex(szBuffercharsmax(szBuffer), "\wTEAM 2 [%i]"GetPlayersNumberByTeam(CS_TEAM_CT));
                
menu_additem(Menu,szBuffer,"2")
                
menu_additem(Menu,"\rTEAM SPEC","3")

                
menu_setprop(MenuMPROP_EXITNAME"Sair")
                
menu_display(idMenu)
                return 
PLUGIN_HANDLED
            
}
         }
    
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
}

public 
ActionTeamMenuHandle(id,Menu,Key)
{
        if(
Key != MENU_EXIT)
        {
            switch(
Key)
            {
                    case 
01:
                    {
                        new 
TeamKey Key 1

                        setUserJoin
(idCsTeams:TeamKey)
                        return 
PLUGIN_CONTINUE
                    
}

                    case 
2:
                    {
                        
setUserJoin(idCS_TEAM_SPECTATOR)
                        return 
PLUGIN_CONTINUE
                    
}
            }
        }

        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
}

setUserJoin(idCsTeams:szTeam)
{
        
set_pdata_int(idm_iJoiningStateCS_STATE_GET_INTO_GAME2)
        
//set_ent_data(id, "CBasePlayer", "m_iJoiningState", CS_STATE_GET_INTO_GAME)
        
cs_set_user_team(idszTeam)
}

public 
Player(id)
{
        new 
menu menu_create("\yShop Menu""Shop_handler");
        
        
menu_additem(menu"\wShop \y[Money]""1"0);
        
menu_additem(menu"\wShop \rExd Items\y[coin]""2"0);
        
menu_additem(menu"\wShop \rExd Knife\y[coin]""3"0);
        
menu_additem(menu"\wSuperVip \rShop \y[Vip]""4"0);        
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu0)
        return 
PLUGIN_HANDLED
}

public 
Shop_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
client_cmd(id,"say /shopitem")     
        }
        case 
2:
        {
            
client_cmd(id,"say /shop")            
        }
        case 
3:
        {
            
client_cmd(id,"say /knifeshop")            
        }
        case 
4:
        {
            
client_cmd(id,"say /smshop")            
        }    
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

GetPlayersNumberByTeam(CsTeams:Team)
{
    new 
iPlayers[32], iNumTeamNumber
    get_players
(iPlayersiNum"e"Team == CS_TEAM_T "TERRORIST" "CT")
    for(new 
iiNumi++)
    {
        
TeamNumber++
    }
    return 
TeamNumber

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 11-27-2020 at 10:39.
iceeedr is offline
Send a message via Skype™ to iceeedr
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-27-2020 , 10:08   Re: ChooseTeam
Reply With Quote #6

Thanks Bro . Sorry But have i a small problem, Right Now I can't open this menu, I mean is not Set On [M] (Not Open when press M Why?).
ho83 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-27-2020 , 10:20   Re: ChooseTeam
Reply With Quote #7

Quote:
Originally Posted by ho83 View Post
Thanks Bro . Sorry But have i a small problem, Right Now I can't open this menu, I mean is not Set On [M] (Not Open when press M Why?).
With the plugin in half there was no way to work even HAHAHA, updated post.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-27-2020 , 10:34   Re: ChooseTeam
Reply With Quote #8

Holyshit! i Set on M And It Work! Im Very Sorry But Can You Help Me How Change Menu Like The Picture I Send? Thank You Very Much Sir! good luck And Thanks Again My dear @Iceeedr.

Last edited by ho83; 11-27-2020 at 10:36.
ho83 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-27-2020 , 10:39   Re: ChooseTeam
Reply With Quote #9

Quote:
Originally Posted by ho83 View Post
Holyshit! i Set on M And It Work! Im Very Sorry But Can You Help Me How Change Menu Like The Picture I Send? Thank You Very Much Sir! good luck And Thanks Again My dear @Iceeedr.
Use the new version to show the numbers as you asked for team 1 [number] etc
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-27-2020 , 10:41   Re: ChooseTeam
Reply With Quote #10

You Mean New Amxx version? What version? 1.9?
ho83 is offline
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 17:22.


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