Raised This Month: $ Target: $400
 0% 

Doesnt compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nixh
Member
Join Date: Nov 2013
Old 05-31-2014 , 13:43   Doesnt compile
Reply With Quote #1

Hey forum members, got this thing and it doesnt compile can you help me fix this problem?


Code:
#include <amxmodx>


new g_szTitle[] = "JailBreak Menu";
 
public plugin_init()
{

             register_plugin("JbMenu", "1.1", "whocares");
             register_clcmd( "chooseteam" , "ShowMenu" );
        
         
    
       
}
public ShowMenu(id)
{
       
         new iNum
         
         new iMinutes
         
         new CurrentMap[33]
         
        new szMenuTitle[150]
         
        iMinutes = get_timeleft( ) / 60
         // gets the amount of players on server and saves it into iNum
        iNum = get_playersnum( )
         
         get_mapname(CurrentMap, charsmax(CurrentMap));
         
        formatex(szMenuTitle, charsmax(szMenuTitle), "\r\y%s^n\rCurrent Map:\w%s^n\w%d \yPlayers Online\r| \w%d \yMinutes left\r| \yYou have \w%i$\yJbCash",g_szTitle, CurrentMap, iNum, iMinutes);
        new menu = menu_create(szMenuTitle, "Jb_Menu");
         
         
        menu_additem(menu, "VIP Menu", "", 0); // case 0
        menu_additem(menu, "JbShop", "", 0); // case 1
        menu_additem(menu, "Achievements", "", 0); // case 2
        menu_additem(menu, "Playtime", "", 0); // case 3
        menu_additem(menu, "CashTop", "", 0); // case 4
        menu_additem(menu, "Rules", "", 0); // case 5
        menu_additem(menu, "Change Team", "", 0); // case 6
        
 
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
 
        menu_display(id, menu, 0);
 
        return PLUGIN_HANDLED;
}
public Jb_Menu(id, menu, item)
{
        if(item == MENU_EXIT)
        {
                menu_cancel(id);
                return PLUGIN_HANDLED;
        }
 
        new command[6], name[64], access, callback;
 
        menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
 
        switch(item)
        {
                case 0:
                {
                         client_cmd(id, "say /menu")
                        client_print(id, print_chat, "You have selected the VIP Menu");
                }
                case 1:
                {
                        client_cmd(id, "say /jbshop")
                        client_print(id, print_chat, "You have selected The JailBreakShop");
                }
                case 2:
                {
                        client_cmd(id, "say /ac")
                        client_print(id, print_chat, "You have selected The Achievements Menu");
                }
                case 3:
                {
                        client_cmd(id, "say /playtime")
                        client_print(id, print_chat, "You have selected Playtime Menu");
                }
                case 4:
                {
                        client_cmd(id, "say /cashtop")
                        client_print(id, print_chat, "You have selected Cashtop");
                }
                case 5:
                {
                        client_cmd(id, "say /rules")
                        client_print(id, print_chat, "You have selected Rules");
                }
           case 6:
           {
           show_menu_team(id)
           }
        }
 
        menu_destroy(menu);
 
        return PLUGIN_HANDLED;
}

Last edited by nixh; 05-31-2014 at 13:43.
nixh is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 05-31-2014 , 13:46   Re: Doesnt compile
Reply With Quote #2

The compiler says it itself - Undefined symbol "show_menu_team". Looks like you haven't put that function anywhere in your code and the compiler can't find it.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
nixh
Member
Join Date: Nov 2013
Old 05-31-2014 , 13:57   Re: Doesnt compile
Reply With Quote #3

so i need to remove this?
show_menu_team(id)
nixh is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 05-31-2014 , 14:04   Re: Doesnt compile
Reply With Quote #4

It all depend of what are you trying to do? I can see this is not the whole code. You can share the whole, so we can see it and help you. Otherwise remove that sixth function from the menu and make it with only 5. But as I can see, the sixth function is a team choose. So you can easily hook client_cmd chooseteam and make the player choose a team.
__________________

Last edited by Flick3rR; 05-31-2014 at 14:05.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
nixh
Member
Join Date: Nov 2013
Old 05-31-2014 , 14:10   Re: Doesnt compile
Reply With Quote #5

Idk its the whole code i think i took it from https://forums.alliedmods.net/showthread.php?t=228667, or maybie you could code something like this? it would be helpfull.

Last edited by nixh; 05-31-2014 at 14:10.
nixh is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 05-31-2014 , 14:20   Re: Doesnt compile
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <cstrike>

new g_szTitle[] = "JailBreak Menu";

public 
plugin_init()
{
    
register_plugin("JbMenu""1.1""whocares");
    
register_clcmd"chooseteam" "ShowMenu" );
}
public 
ShowMenu(id)
{
    
    new 
iNum,CurrentMap[33],szMenuTitle[150]
    
    new 
iMinutes get_timeleft( ) / 60
    iNum 
get_playersnum( )
    
    
get_mapname(CurrentMapcharsmax(CurrentMap));
    
    
formatex(szMenuTitlecharsmax(szMenuTitle), "\r\y%s^n\rCurrent Map:\w%s^n\w%d \yPlayers Online\r| \w%d \yMinutes left\r| \yYou have \w%i$\yJbCash",g_szTitleCurrentMapiNumiMinutes);
    new 
menu menu_create(szMenuTitle"Jb_Menu");
    
    
    
menu_additem(menu"VIP Menu"""0); // case 0
    
menu_additem(menu"JbShop"""0); // case 1
    
menu_additem(menu"Achievements"""0); // case 2
    
menu_additem(menu"Playtime"""0); // case 3
    
menu_additem(menu"CashTop"""0); // case 4
    
menu_additem(menu"Rules"""0); // case 5
    
menu_additem(menu"Change Team"""0); // case 6
    
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}
public 
Jb_Menu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
command[6], name[64], accesscallback;
    
    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    switch(
item)
    {
        case 
0:
        {
            
client_cmd(id"say /menu")
            
client_print(idprint_chat"You have selected the VIP Menu");
        }
        case 
1:
        {
            
client_cmd(id"say /jbshop")
            
client_print(idprint_chat"You have selected The JailBreakShop");
        }
        case 
2:
        {
            
client_cmd(id"say /ac")
            
client_print(idprint_chat"You have selected The Achievements Menu");
        }
        case 
3:
        {
            
client_cmd(id"say /playtime")
            
client_print(idprint_chat"You have selected Playtime Menu");
        }
        case 
4:
        {
            
client_cmd(id"say /cashtop")
            
client_print(idprint_chat"You have selected Cashtop");
        }
        case 
5:
        {
            
client_cmd(id"say /rules")
            
client_print(idprint_chat"You have selected Rules");
        }
        case 
6:
        {
            
show_menu_team(id)
        }
    }
    
    
menu_destroy(menu);
    
    return 
PLUGIN_HANDLED;
}
public 
show_menu_team(id)
{
    
    new 
Menu menu_create("\yTeam menu""Main")
    
    
menu_additem(Menu"Go To Ct""1"0)
    
menu_additem(Menu"Go to Terro""2"0)
    
menu_additem(Menu"Go to Spec""3"0)
    
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL );
    
menu_setprop(MenuMPROP_EXITNAME"\dClose" )
    
menu_setprop(MenuMPROP_NUMBER_COLOR"\r" )
    
menu_display(idMenu0)
    
}

public 
Main(idMenuitem)
{      
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(Menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(Menuitemaccessdata6iName63callback)
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            if (
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
client_print(id,print_chat,"You are already Ct")
            }
            else
            {
                
cs_set_user_team(id,CS_TEAM_CT)    
            }
        }
        case 
2:
        {
            if (
cs_get_user_team(id) == CS_TEAM_T)
            {
                
client_print(id,print_chat,"You are already Terro")
            }
            else
            {
                
cs_set_user_team(id,CS_TEAM_T)    
            }
        }
        case 
3:
        {
            if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
            {
                
client_print(id,print_chat,"You are already Spec")
            }
            else
            {
                
cs_set_user_team(id,CS_TEAM_SPECTATOR)    
            }
        }
    }
    
menu_destroy(Menu);
    return 
PLUGIN_HANDLED;


Last edited by Freezo Begin; 05-31-2014 at 14:23.
Freezo Begin is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-31-2014 , 14:23   Re: Doesnt compile
Reply With Quote #7

Check:
Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >

new g_szTitle[] = "JailBreak Menu";
 
public plugin_init()
{
    register_plugin("JbMenu", "1.1", "whocares");
    register_clcmd( "chooseteam" , "ShowMenu" );
}

public ShowMenu(id)
{
    if ( !is_user_connected( id ) )
        return 1;

    new iNum,iMinutes,CurrentMap[33]
    new szMenuTitle[150]
         
    iMinutes = get_timeleft( ) / 60
         // gets the amount of players on server and saves it into iNum
    iNum = get_playersnum( )
         
    get_mapname(CurrentMap, charsmax(CurrentMap));
         
    formatex(szMenuTitle, charsmax(szMenuTitle), "\r\y%s^n\rCurrent Map:\w%s^n\w%d \yPlayers Online\r| \w%d \yMinutes left\r| \yYou have \w%i$\yJbCash",g_szTitle, CurrentMap, iNum, iMinutes);
    new menu = menu_create(szMenuTitle, "Jb_Menu");
         
         
    menu_additem(menu, "VIP Menu", "", 0); // case 0
    menu_additem(menu, "JbShop", "", 0); // case 1
    menu_additem(menu, "Achievements", "", 0); // case 2
    menu_additem(menu, "Playtime", "", 0); // case 3
    menu_additem(menu, "CashTop", "", 0); // case 4
    menu_additem(menu, "Rules", "", 0); // case 5
    menu_additem(menu, "Change Team", "", 0); // case 6
 
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);

    return PLUGIN_HANDLED;
}

public Jb_Menu(id, menu, item)
{
        if(item == MENU_EXIT)
        {
                menu_cancel(id);
                return PLUGIN_HANDLED;
        }
 
        new command[6], name[64], access, callback;
 
        menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
 
        switch(item)
        {
                case 0:
                {
            client_cmd(id, "say /menu")
            client_print(id, print_chat, "You have selected the VIP Menu");
                }
                case 1:
                {
            client_cmd(id, "say /jbshop")
            client_print(id, print_chat, "You have selected The JailBreakShop");
                }
                case 2:
                {
            client_cmd(id, "say /ac")
            client_print(id, print_chat, "You have selected The Achievements Menu");
                }
                case 3:
                {
            client_cmd(id, "say /playtime")
            client_print(id, print_chat, "You have selected Playtime Menu");
                }
                case 4:
                {
            client_cmd(id, "say /cashtop")
            client_print(id, print_chat, "You have selected Cashtop");
                }
                case 5:
                {
            client_cmd(id, "say /rules")
            client_print(id, print_chat, "You have selected Rules");
                }
           case 6:
           {
            // public of your menu changeteam
                }
    }
    menu_destroy(menu);
    
    return PLUGIN_HANDLED;
}

Last edited by Fuck For Fun; 05-31-2014 at 14:27.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Spawner30
BANNED
Join Date: Dec 2013
Location: I Don't Know Yet
Old 05-31-2014 , 14:28   Re: Doesnt compile
Reply With Quote #8

if this plugin for JB better to switch 2 team Terro + Spec
PHP Code:
#include <amxmodx>
#include <cstrike>

new g_szTitle[] = "JailBreak Menu";

public 
plugin_init()
{
    
register_plugin("JbMenu""1.1""whocares");
    
register_clcmd"chooseteam" "ShowMenu" );
}
public 
ShowMenu(id)
{
    
    new 
iNum,CurrentMap[33],szMenuTitle[150]
    
    new 
iMinutes get_timeleft( ) / 60
    iNum 
get_playersnum( )
    
    
get_mapname(CurrentMapcharsmax(CurrentMap));
    
    
formatex(szMenuTitlecharsmax(szMenuTitle), "\r\y%s^n\rCurrent Map:\w%s^n\w%d \yPlayers Online\r| \w%d \yMinutes left\r| \yYou have \w%i$\yJbCash",g_szTitleCurrentMapiNumiMinutes);
    new 
menu menu_create(szMenuTitle"Jb_Menu");
    
    
    
menu_additem(menu"VIP Menu"""0); // case 0
    
menu_additem(menu"JbShop"""0); // case 1
    
menu_additem(menu"Achievements"""0); // case 2
    
menu_additem(menu"Playtime"""0); // case 3
    
menu_additem(menu"CashTop"""0); // case 4
    
menu_additem(menu"Rules"""0); // case 5
    
menu_additem(menu"Change Team"""0); // case 6
    
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}
public 
Jb_Menu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
command[6], name[64], accesscallback;
    
    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    switch(
item)
    {
        case 
0:
        {
            
client_cmd(id"say /menu")
            
client_print(idprint_chat"You have selected the VIP Menu");
        }
        case 
1:
        {
            
client_cmd(id"say /jbshop")
            
client_print(idprint_chat"You have selected The JailBreakShop");
        }
        case 
2:
        {
            
client_cmd(id"say /ac")
            
client_print(idprint_chat"You have selected The Achievements Menu");
        }
        case 
3:
        {
            
client_cmd(id"say /playtime")
            
client_print(idprint_chat"You have selected Playtime Menu");
        }
        case 
4:
        {
            
client_cmd(id"say /cashtop")
            
client_print(idprint_chat"You have selected Cashtop");
        }
        case 
5:
        {
            
client_cmd(id"say /rules")
            
client_print(idprint_chat"You have selected Rules");
        }
        case 
6:
        {
            
show_menu_team(id)
        }
    }
    
    
menu_destroy(menu);
    
    return 
PLUGIN_HANDLED;
}
public 
show_menu_team(id)
{
    
    new 
Menu menu_create("\yTeam menu""Main")
    
    
menu_additem(Menu"Go to Terro""1"0)
    
menu_additem(Menu"Go to Spec""2"0)
    
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL );
    
menu_setprop(MenuMPROP_EXITNAME"\dClose" )
    
menu_setprop(MenuMPROP_NUMBER_COLOR"\r" )
    
menu_display(idMenu0)
    
}

public 
Main(idMenuitem)
{      
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(Menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(Menuitemaccessdata6iName63callback)
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            if (
cs_get_user_team(id) == CS_TEAM_T)
            {
                
client_print(id,print_chat,"You are already Terro")
            }
            else
            {
                
cs_set_user_team(id,CS_TEAM_T)    
            }
        }
        case 
2:
        {
            if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
            {
                
client_print(id,print_chat,"You are already Spec")
            }
            else
            {
                
cs_set_user_team(id,CS_TEAM_SPECTATOR)    
            }
        }
    }
    
menu_destroy(Menu);
    return 
PLUGIN_HANDLED;


Last edited by Spawner30; 05-31-2014 at 14:30.
Spawner30 is offline
Send a message via Skype™ to Spawner30
nixh
Member
Join Date: Nov 2013
Old 05-31-2014 , 14:35   Re: Doesnt compile
Reply With Quote #9

Thanks guys, but non of them worked when i press M(chooseteam) the menu doest show.

Last edited by nixh; 05-31-2014 at 14:41.
nixh is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-31-2014 , 14:51   Re: Doesnt compile
Reply With Quote #10

Quote:
Originally Posted by nixh View Post
Thanks guys, but non of them worked when i press M(chooseteam) the menu doest show.
Put the Plugins first, after all the Plugins you put in plugins.ini
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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 23:25.


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