Raised This Month: $ Target: $400
 0% 

help wiht menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oei
Junior Member
Join Date: Nov 2011
Old 11-04-2011 , 01:36   help wiht menu
Reply With Quote #1

i need help if this menu this is menu for teror and i wont ct can open the menu but do not choose something from the menu if is choose say to hem : "you can use on this menu you must be teror"
thx


PHP Code:
 Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() 
{
register_clcmd("say /help""MenuHelp")
register_clcmd("say_team /help""MenuHelp")
}
public 
MenuHelp(id)
{
if (
cs_get_user_team(id) == CS_TEAM_T)
{
HelpMenu(id)
return 
PLUGIN_HANDLED
}
else if(
get_user_team(id) != 1)
{
return 
PLUGIN_HANDLED
}
return 
PLUGIN_HANDLED
}
public 
HelpMenu(id
{
new 
menu menu_create("Help Menu""menu_handler");

menu_additem(menu"Show Admin""1");
menu_additem(menu"Show Help Motd""2");
menu_setprop(menuMPROP_EXITMEXIT_ALL);
menu_display(idmenu);
}
public 
menu_handler(idmenuitem)

if(
item == MENU_EXIT)
{
menu_destroy(menu);
return 
PLUGIN_HANDLED;
}

new 
data[6], szName[64];
new 
accesscallback;

menu_item_getinfo(menuitemaccessdata,5szName63callback);
new 
key str_to_num(data);
switch(
key)
{
case 
1:
{
client_cmd(id,"say /admin")
}

case 
2:
{
client_cmd(id,"say /motd")
}
}
return 
PLUGIN_HANDLED

oei is offline
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-04-2011 , 04:59   Re: help wiht menu
Reply With Quote #2

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

public plugin_init() 
{
    
register_clcmd("say /help""MenuHelp")
    
register_clcmd("say_team /help""MenuHelp")
}

public 
MenuHelp(id)
{
    if (!(
cs_get_user_team(id) == CS_TEAM_T) )
    {
        
client_print(id,print_chat"[SERVER] For Only [Terrosist] !");
        return 
PLUGIN_HANDLED;
    }

    
HelpMenu(id

    return 
PLUGIN_CONTINUE;

}

public 
HelpMenu(id
{
    new 
menu menu_create("Help Menu""menu_handler");
    
    
menu_additem(menu"Show Admin""1");
    
menu_additem(menu"Show Help Motd""2");
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu);
}
public 
menu_handler(idmenuitem)

    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], szName[64];
    new 
accesscallback;
    
    
menu_item_getinfo(menuitemaccessdata,5szName63callback);
    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1client_cmd(id,"say /admin")
        case 
2client_cmd(id,"say /motd")
    }

    return 
PLUGIN_HANDLED


Last edited by The Inhabitant Of Heavens; 11-04-2011 at 05:00.
The Inhabitant Of Heavens is offline
oei
Junior Member
Join Date: Nov 2011
Old 11-04-2011 , 06:30   Re: help wiht menu
Reply With Quote #3

Quote:
Originally Posted by The Inhabitant Of Heavens View Post
PHP Code:
#include <amxmodx>
#include <cstrike>
 
public plugin_init() 
{
    
register_clcmd("say /help""MenuHelp")
    
register_clcmd("say_team /help""MenuHelp")
}
 
public 
MenuHelp(id)
{
    if (!(
cs_get_user_team(id) == CS_TEAM_T) )
    {
        
client_print(id,print_chat"[SERVER] For Only [Terrosist] !");
        return 
PLUGIN_HANDLED;
    }
 
    
HelpMenu(id
 
    return 
PLUGIN_CONTINUE;
 
}
 
public 
HelpMenu(id
{
    new 
menu menu_create("Help Menu""menu_handler");
 
    
menu_additem(menu"Show Admin""1");
    
menu_additem(menu"Show Help Motd""2");
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu);
}
public 
menu_handler(idmenuitem)

    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
 
    new 
data[6], szName[64];
    new 
accesscallback;
 
    
menu_item_getinfo(menuitemaccessdata,5szName63callback);
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1client_cmd(id,"say /admin")
        case 
2client_cmd(id,"say /motd")
    }
 
    return 
PLUGIN_HANDLED


not work
oei is offline
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-04-2011 , 06:50   Re: help wiht menu
Reply With Quote #4

if (!(cs_get_user_team(id) == CS_TEAM_T) )

-->

if(cs_get_user_team(id) != CS_TEAM_T)
The Inhabitant Of Heavens is offline
Old 11-04-2011, 07:35
oei
This message has been deleted by oei.
oei
Junior Member
Join Date: Nov 2011
Old 11-04-2011 , 13:57   Re: help wiht menu
Reply With Quote #5

help is not work?
oei is offline
Gooogle
Member
Join Date: Aug 2011
Old 11-04-2011 , 20:51   Re: help wiht menu
Reply With Quote #6

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

public plugin_init( )
{
    
register_clcmd"say /help""Help" );
    
register_clcmd"say_team /help""Help" );
}

public 
Helpid )
{
    if( 
cs_get_user_teamid ) != CS_TEAM_T )
    {
        
client_printidprint_chat"[AMXX] Sorry! Only Terrorist may use this menu!" );
        return 
PLUGIN_HANDLED;
    }
    
    
HelpMenuid );
    
    return 
PLUGIN_HANDLED;
}

public 
HelpMenuid )
{
    new 
MainMenu menu_create"Help Menu""sub_HelpMenu" );
    
    
menu_additemMainMenu"Show Admins""1");
    
menu_additemMainMenu"Show MOTD""2");
    
    
menu_displayidMainMenu);
}         

public 
sub_HelpMenuidMainMenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroyMainMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
Data[7], Name[64];
    new 
AccessCallback;
    
menu_item_getinfoMainMenuitemAccessData,5Name63Callback );
    
    new 
Key str_to_numData );
    
    switch( 
Key )
    {
        case 
1client_cmdid"say /admin" );
        case 
2client_cmdid"say /motd" );
    }
    
    
menu_destroyMainMenu );
    return 
PLUGIN_HANDLED;

Gooogle is offline
oei
Junior Member
Join Date: Nov 2011
Old 11-05-2011 , 03:04   Re: help wiht menu
Reply With Quote #7

Quote:
Originally Posted by Gooogle View Post
PHP Code:
#include < amxmodx >
#include < cstrike >
 
public plugin_init( )
{
    
register_clcmd"say /help""Help" );
    
register_clcmd"say_team /help""Help" );
}
 
public 
Helpid )
{
    if( 
cs_get_user_teamid ) != CS_TEAM_T )
    {
        
client_printidprint_chat"[AMXX] Sorry! Only Terrorist may use this menu!" );
        return 
PLUGIN_HANDLED;
    }
 
    
HelpMenuid );
 
    return 
PLUGIN_HANDLED;
}
 
public 
HelpMenuid )
{
    new 
MainMenu menu_create"Help Menu""sub_HelpMenu" );
 
    
menu_additemMainMenu"Show Admins""1");
    
menu_additemMainMenu"Show MOTD""2");
 
    
menu_displayidMainMenu);
}         
 
public 
sub_HelpMenuidMainMenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroyMainMenu );
        return 
PLUGIN_HANDLED;
    }
 
    new 
Data[7], Name[64];
    new 
AccessCallback;
    
menu_item_getinfoMainMenuitemAccessData,5Name63Callback );
 
    new 
Key str_to_numData );
 
    switch( 
Key )
    {
        case 
1client_cmdid"say /admin" );
        case 
2client_cmdid"say /motd" );
    }
 
    
menu_destroyMainMenu );
    return 
PLUGIN_HANDLED;


dont work men /:
oei is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-05-2011 , 04:51   Re: help wiht menu
Reply With Quote #8

Quote:
Originally Posted by oei View Post
dont work men /:
What doesn't work?
Does it compile?
Is the plugin running successfully?
Are you getting any errors?
If you are not terrorist do you see the message?

You need to give us more information.
__________________
fysiks is offline
oei
Junior Member
Join Date: Nov 2011
Old 11-05-2011 , 05:05   Re: help wiht menu
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
What doesn't work?
Does it compile?
Is the plugin running successfully?
Are you getting any errors?
If you are not terrorist do you see the message?

You need to give us more information.
yes is compile but the menu need to be if ct say /menu is open the menu But can not choose something from the menu and if is choose somthing is show to hem message "is only for terorr" and close the menu
oei is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-05-2011 , 05:20   Re: help wiht menu
Reply With Quote #10

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

public plugin_init() 
{
    
register_plugin("Help menu""0.1""Whatever")
    
register_clcmd("say /help""HelpMenu")
    
register_clcmd("say_team /help""HelpMenu")
}

public 
HelpMenu(id
{
    static 
menu = -1
    
if( menu == -)
    {
        
menu menu_create("Help Menu""menu_handler")
        
menu_additem(menu"Show Admin")
        
menu_additem(menu"Show Help Motd")
    }
    
menu_display(idmenu)
}

public 
menu_handler(idmenuitem)
{
    if( 
item != MENU_EXIT )
    {
        if( 
cs_get_user_team(id) == CS_TEAM_T )
        {
            switch( 
item )
            {
                case 
0:
                {
                    
client_cmd(id,"say /admin")
                }
                case 
1:
                {
                    
client_cmd(id,"say /motd")
                }
            }
        }
        else
        {
            
client_print(idprint_chat"Sorry, only Terrorists can use this menu.")
        }
    }

    return 
PLUGIN_HANDLED


Last edited by ConnorMcLeod; 11-05-2011 at 05:22.
ConnorMcLeod 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 14:26.


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