Raised This Month: $51 Target: $400
 12% 

Creating Menus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Toco123
Junior Member
Join Date: Apr 2010
Old 05-10-2010 , 08:51   Creating Menus
Reply With Quote #1

Hello, I'm currently creating a Resident Evil Mod for ZombieSurvivalists.co.uk .
However, I've become a bit stuck when it comes to menus as Ive never looked into them.

For a start, I want to make something similarly basic to the Admin Buy menu plugin, or use it as a base.
However, rather than limiting it to VIP/Admin flags, I wish for it to disable the Normal Buy Menu and to show this new menu on spawn (which is the start of a round).
The reason for this is I've edited the .CTX files to create weapons with similar statistics to Resident Evil and blocked those that didnt fit into the game and have increased the prices on all weapons.
I already use the Admin Buy menu for VIPs to purchase the chicago typewriter, a galil with a thompson world model. However it wouldnt be a problem to set this to !VIP or the new menu to !guns or something.


The second menu I need is rather than this, where I check if the person has VIP to see if they can use the Wesker model, and if not set them to the hunk model instead:

PHP Code:
 {
  case 
:
  {
    if (
GetAdminFlag(aid,Admin_Custom1,Access_Effective))
   {
   
SetEntityHealth(indx,150);
   
SetEntityModel(indx,"models/player/pil/re1/wesker/wesker_pil.mdl");
   }
    else
   {
   
SetEntityModel(indx,"models/player/toco/hunk.mdl");
   
SetEntityHealth(indx,100);
   
SetEntityGravity(indx,1.0);
   
SetEntPropFloat(indxProp_Data"m_flLaggedMovementValue"1.0);
   }
  } 

The script sets all survivors to 0 and >1 to zombie classes which is done on a cycle. How would I go about creating a menu for VIPs to provide a choice between 3 or 4 skins rather than been forced to use one that they may not like. However, it cannot provide this option to T's as they are zombie classes.
Toco123 is offline
Toco123
Junior Member
Join Date: Apr 2010
Old 05-10-2010 , 22:14   Re: Creating Menus
Reply With Quote #2

Any pointers?
Toco123 is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-13-2010 , 17:29   Re: Creating Menus
Reply With Quote #3

em. maybe try something like this.

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
Toco123
Junior Member
Join Date: Apr 2010
Old 05-14-2010 , 19:46   Re: Creating Menus
Reply With Quote #4

Thanks for the tips <3

Gonna wait till CSS Beta comes out before updating the gamemode.
Bit worried of what it could screw up.
Toco123 is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-15-2010 , 07:57   Re: Creating Menus
Reply With Quote #5

the script above works on any source game/mod

Last edited by Master53; 05-15-2010 at 08:03.
Master53 is offline
Toco123
Junior Member
Join Date: Apr 2010
Old 05-18-2010 , 20:49   Re: Creating Menus
Reply With Quote #6

Yeah, I gathered, but I don't know if my gamemode will still work on the new CSS, so I'd rather wait than work on the menus to find out it was wasted energy.
If it works, it will be the first thing I'll be doing
Toco123 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 22:41.


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