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

[ReQ/Help] need help in menu cs 1.6


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 10-06-2016 , 12:06   [ReQ/Help] need help in menu cs 1.6
Reply With Quote #1

i want to add welcome player name above menu
so plzz add codes

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

public plugin_init()
{
    
register_plugin("PlayerHelp""2.3.0""SANJAY");
    
register_clcmd("say /sin""ShowMenu"_"/sin");
        
register_clcmd"say_team /sin""ShowMenu"_"/sin");
}

public 
ShowMenu(id)
{    
    new 
menu menu_create("\rPlayer Help \yMy Menu \rBy XYZ""mh_MyMenu");

    
menu_additem(menu"Contat server owner"""0); // case 0
    
menu_additem(menu"Server ip"""0); // case 1
    
menu_additem(menu"He Grenade"""0); // case 2
    
menu_additem(menu"Score Reset"""0); // case 3

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_MyMenu(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
        {
            
ColorChat0print_chat"^4XYZ ^3Server Owner :^4 XYZ");
        }
        case 
1
        {
            
ColorChat0print_chat"^4XYZ ^3Server Test ip :^4 sinmix2.ddns.net:27395 ");
        }
        case 
2
        {
            
client_cmd(id"hegren");
            
ColorChat(idprint_chat"^4You have successfully bought nade :)");
        }
        case 
3:  client_cmd(id"^"say /rs^"");
        }
    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;

__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 10-06-2016 , 12:49   Re: [ReQ/Help] need help in menu cs 1.6
Reply With Quote #2

Whenever he opens menu ? Or permanent hud ?
Btw instead using this you can use cs_set_user_death and set_user_frags and print a message that will be better .
PHP Code:
case 3:  client_cmd(id"^"say /rs^""); 
tousif is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-06-2016 , 16:33   Re: [ReQ/Help] need help in menu cs 1.6
Reply With Quote #3

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

public plugin_init()
{
    
register_plugin("PlayerHelp""2.3.0""SANJAY");
    
register_clcmd("say /sin""ShowMenu"_"/sin");
    
register_clcmd"say_team /sin""ShowMenu"_"/sin");
}

public 
ShowMenu(id)
{   
    new 
szTemp[50], szName[33]; get_user_name(idszNamecharsmax(szName))
    
formatex(szTempcharsmax(szTemp), "Welcome %s!^n\rPlayer Help \yMy Menu \rBy XYZ"szName)
    
    new 
menu menu_create(szTemp"mh_MyMenu");
    
    
menu_additem(menu"Contact server owner"""0); // case 0
    
menu_additem(menu"Server ip"""0); // case 1
    
menu_additem(menu"He Grenade"""0); // case 2
    
menu_additem(menu"Score Reset"""0); // case 3
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}

public 
mh_MyMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
command[6], name[64], accesscallback;
    
    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    switch(
item)
    {
        case 
0
        {
            
ColorChat0print_chat"^4XYZ ^3Server Owner :^4 XYZ");
        }
        case 
1
        {
            
ColorChat0print_chat"^4XYZ ^3Server Test ip :^4 sinmix2.ddns.net:27395 ");
        }
        case 
2
        {
            
client_cmd(id"hegren");
            
ColorChat(idprint_chat"^4You have successfully bought nade :)");
        }
        case 
3:  client_cmd(id"^"say /rs^"");
        }
    
menu_destroy(menu);
    
    return 
PLUGIN_HANDLED;

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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:16.


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