Raised This Month: $ Target: $400
 0% 

Create a ESC Menu with Input


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dordnung
Veteran Member
Join Date: Apr 2010
Old 05-09-2010 , 16:27   Create a ESC Menu with Input
Reply With Quote #1

Hey,

in a Python addon, i have a ESC Menu, where i have a input box.

Today I tryed it in Sourcepawn, but didn't have luck.

Is this generally possible?

If so, can someone please make me an example?

greez

Popo
__________________
dordnung is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 05-13-2010 , 06:07   Re: Create a ESC Menu with Input
Reply With Quote #2

no one?
__________________
dordnung is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 05-14-2010 , 14:04   Re: Create a ESC Menu with Input
Reply With Quote #3

woh, CSS can have so cool Menu's, look here:

http://developer.valvesoftware.com/w..._Documentation

Why can't Sourcemod that
__________________
dordnung is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-14-2010 , 15:25   Re: Create a ESC Menu with Input
Reply With Quote #4

maybe this would help

Code:
static NextKey[33];

        NextKey[Client] = 0;


    decl Handle:Panel;
    Panel = CreatePanel();

    if(NextKey[Client] == 0)
    {
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "Next");
    }
    else if(NextKey[Client] == 1)
    {
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "Next");
    }
    else if(NextKey[Client] == 2)
    {
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "");
        DrawPanelItem(Panel, "Next");
    }
Code:
    decl String:Buffer[64];
    decl String:Buffer2[64];

    if(!IsClientInGame(Client) || !IsClientConnected(Client) || !IsPlayerAlive(Client))
        return;

    GetClientModel(Client, Buffer, 64); 

    if(HandleAction == MenuAction_Select)
    {
        if((Parameter < 1) || (Parameter > 7))
            return;

        if(NextKey[Client] == 0)
        {
            if(Parameter == 1)
            {
            }
            else if(Parameter == 2)
            {
            }
            else if(Parameter == 3)
            {
            }
            else if(Parameter == 4)
            {
            }
            else if(Parameter == 5)
            {
            }
            else if(Parameter == 6)
            {
            }
            else if(Parameter == 7)
            {
                NextKey[Client]++;
                YourMainMenu... for code 1;
            }
        }
        else if(NextKey[Client] == 1)
        {
            if(Parameter == 1)
            {
            }
            else if(Parameter == 2)
            {
            }
            else if(Parameter == 3)
            {
            }
            else if(Parameter == 4)
            {
            }
            else if(Parameter == 5)
            {
            }
            else if(Parameter == 6)
            {
            }
            else if(Parameter == 7)
            {
                NextKey[Client]++;
                YourMainMenu... for code 1;
            }
        }
        else if(NextKey[Client] == 2)
        {
            if(Parameter == 1)
            {
            }
            else if(Parameter == 2)
            {
            }
            else if(Parameter == 3)
            {
            }
            else if(Parameter == 4)
            {
            }
            else if(Parameter == 5)
            {
            }
            else if(Parameter == 6)
            {
            }
            else if(Parameter == 7)
            {
                NextKey[Client]++;
                YourMainMenu... for code 1;
            }
        }
Master53 is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 05-14-2010 , 16:59   Re: Create a ESC Menu with Input
Reply With Quote #5

I don't get the code, can you please describe it?
__________________
dordnung is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-15-2010 , 08:21   Re: Create a ESC Menu with Input
Reply With Quote #6

ill give two examples

Code:
public HandleMainMenu(Handle:Menu, MenuAction:HandleAction, Client,   Parameter)
{
     new Ent = MenuTarget[Client];
     if(HandleAction == MenuAction_Select)
     {
         if(Parameter == 1)
         {
         }
    }
}
this is where you add the actual physics for the menu.

Code:
public Action:MenuStats(Client)
{
     //Declare:
decl Ent;
decl Handle:Panel;

//Initialize:
Ent = MenuTarget[Client];
Panel = CreatePanel();

DrawPanelItem(Panel, "");

SetPanelTitle(Panel, "Stastics:");
SendPanelToClient(Panel, Client, HandleMainMenu, 15);
}
do you see this part thats where you add the menu.

How much more clear do you want this to be?
Master53 is offline
dordnung
Veteran Member
Join Date: Apr 2010
Old 05-15-2010 , 09:08   Re: Create a ESC Menu with Input
Reply With Quote #7

But that isn't a ESC menu with a Input box
__________________
dordnung is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-15-2010 , 12:41   Re: Create a ESC Menu with Input
Reply With Quote #8

i think you will find that it is. you add the inputs hear

if(Parameter == 1)
{
}
Master53 is offline
TerroriZe
Member
Join Date: Dec 2009
Old 05-15-2010 , 13:11   Re: Create a ESC Menu with Input
Reply With Quote #9

@Master: I doubt that you know what an input box is...

That is what he meant (took the pic from http://addons.eventscripts.com/addons/view/liladmin):
(guess you meant that python plugin)...


Last edited by TerroriZe; 05-15-2010 at 13:52.
TerroriZe is offline
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 05-15-2010 , 19:25   Re: Create a ESC Menu with Input
Reply With Quote #10

I think its defiantly possible to do in hl2 but sourcemod hasnt incorporated it yet , hope they will *hint hint*
Samantha 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 23:21.


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