Raised This Month: $ Target: $400
 0% 

[HOW]Create Menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
McChillerDomi
Member
Join Date: Jun 2014
Location: United Kingdom
Old 07-18-2014 , 13:43   Re: [HOW]Create Menu?
Reply With Quote #1

Ohman Help me pls!
McChillerDomi is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2014 , 14:05   Re: [HOW]Create Menu?
Reply With Quote #2

register_clcmd()

Dude, search!


After reading again: Not sure what you want. Explain again please.

Last edited by mottzi; 07-18-2014 at 14:05.
mottzi is offline
Send a message via MSN to mottzi
McChillerDomi
Member
Join Date: Jun 2014
Location: United Kingdom
Old 07-18-2014 , 14:35   Re: [HOW]Create Menu?
Reply With Quote #3

Only add this and then? ...

Found this but dont Understand .....
McChillerDomi is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-18-2014 , 14:50   Re: [HOW]Create Menu?
Reply With Quote #4

You'll need to better explain what you actually want to do.
__________________
fysiks is offline
McChillerDomi
Member
Join Date: Jun 2014
Location: United Kingdom
Old 07-19-2014 , 08:22   Re: [HOW]Create Menu?
Reply With Quote #5

Uff....


I have The code(page 1)

So....

Player type /plugins

So then comes my List

Press player 1 for Roll-the dice

Then comes in the chat Player: rtd

so better?
McChillerDomi is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-19-2014 , 14:05   Re: [HOW]Create Menu?
Reply With Quote #6

Ahh, he is talking about the menu handler. Dude, that's how you EXECUTE a command on player
PHP Code:
client_cmd(id"say /rtd"
. Do it in the handler, in case player chose "Roll The Dice" item. That's all.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
McChillerDomi
Member
Join Date: Jun 2014
Location: United Kingdom
Old 07-19-2014 , 14:42   Re: [HOW]Create Menu?
Reply With Quote #7

i Try!

Last edited by McChillerDomi; 07-19-2014 at 14:43. Reason: WTF?
McChillerDomi is offline
McChillerDomi
Member
Join Date: Jun 2014
Location: United Kingdom
Old 07-19-2014 , 14:52   Re: [HOW]Create Menu?
Reply With Quote #8

Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
    register_plugin("My Menu", "1.0", "Me");
    register_clcmd("say /test", "ShowMenu", _, "");
}

public ShowMenu(id)
{
    new menu = menu_create("Plugin_Show", "mh_MyMenu");

    menu_additem(menu, "Test", "", 0); // case 0

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

    menu_display(id, menu, 0);

    return PLUGIN_HANDLED;
}

public mh_MyMenu(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_print(id, print_chat, "You have selected Test");
        case 0: client_cmd(id, "say /Test")  
    }

    menu_destroy(menu);

    return PLUGIN_HANDLED;
}
ERROR :/

Code:
//// Test.sma
// C:\Programme\Steam\SteamApps\common\Half-Life\czero\addons\amxmodx\scripting\
Test.sma(39) : error 040: duplicate "case" label (value 0)
//
// 1 Error.
// Could not locate output file compiled\Test.amx (compile failed).
//
// Compilation Time: 0,14 sec
// ----------------------------------------

Last edited by McChillerDomi; 07-19-2014 at 14:53.
McChillerDomi is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-19-2014 , 15:12   Re: [HOW]Create Menu?
Reply With Quote #9

Dude, dafuq?! Two same cases. What the hell...
Just open some brackets in case 0: and do the both things...
case 0:
{
client_print....
client_cmd....
}
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
McChillerDomi
Member
Join Date: Jun 2014
Location: United Kingdom
Old 07-19-2014 , 15:18   Re: [HOW]Create Menu?
Reply With Quote #10

Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>

public plugin_init()
{
    register_plugin("My Menu", "1.0", "Me");
    register_clcmd("say /Plugins", "ShowMenu", _, "");
}

public ShowMenu(id)
{
    new menu = menu_create("Plugin_Show", "mh_MyMenu");

    menu_additem(menu, "ResetScore", "", 0); // case 0

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

    menu_display(id, menu, 0);

    return PLUGIN_HANDLED;
}

public mh_MyMenu(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_print(id, print_chat, "You have selected ResetScore");
        client_cmd(ic, "say /rs");
    }

    menu_destroy(menu);

    return PLUGIN_HANDLED;
}
...... Error

Last edited by McChillerDomi; 07-19-2014 at 15:18.
McChillerDomi 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 13:18.


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