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

New AMXX Menu System


Post New Thread Reply   
 
Thread Tools Display Modes
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 09-25-2008 , 19:07   Re: New AMXX Menu System
Reply With Quote #61

See newmenus.inc

PHP Code:
#define MPROP_BACKNAME    2        /* Name of the back button (param1 = string) */
#define MPROP_NEXTNAME    3        /* Name of the next button (param1 = string) */
#define MPROP_EXITNAME    4        /* Name of the exit button (param1 = string) */ 
I Think that this was the method to change that names:

PHP Code:
menu_setprop(MenuMPROP_NEXTNAME"Name"
PHP Code:
menu_setprop(MenuMPROP_EXITNAME"Exit Button name"
If i'm wrong, correct me please.
__________________
IneedHelp is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 09-25-2008 , 19:15   Re: New AMXX Menu System
Reply With Quote #62

that sounds about right to me
__________________
minimiller is offline
Send a message via MSN to minimiller
emsu66
Junior Member
Join Date: Apr 2008
Location: Under Your Bed
Old 11-04-2008 , 00:10   Re: New AMXX Menu System
Reply With Quote #63

Okay so, I have TWO problems!

1) Basically what I'm trying to do is create a system where Player A would say killchance in chat and has a chance (lets say 1/10) for a menu to come up. Would someone please provide an example on how I could make the odds (1/10) happen?

2) The point of my plugin is to get a chance at basically slaying someone of your choice through the effects of chance. I would like to add a menu of all the players in the current server to this one command that you may or may not win. How could I link an actual PLAYER to the menu instead of an item?

Basic Layout (What I'm Shooting For) :
1) Player B consistently kills player A.
2) Player A says killchance in chat and wins the 1/10 chance that he gets to slay him for a round!
3) Player A looks over the list and finds Player B so he hits his menu key (lets say 2)
4) Player B drops dead.
5) Player A has a good round =)

+Karma and credit in my plugin to whoever can give the slightest bit of help, thanks!

-Plugin will be called Random Kill Chance v1.0 if approved!
__________________


Get a LiFe? I'm a GAMER... I have TONS of lives!!!
emsu66 is offline
Send a message via AIM to emsu66
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 11-04-2008 , 10:52   Re: New AMXX Menu System
Reply With Quote #64

Quote:
Originally Posted by emsu66
1) Basically what I'm trying to do is create a system where Player A would say killchance in chat and has a chance (lets say 1/10) for a menu to come up. Would someone please provide an example on how I could make the odds (1/10) happen?
PHP Code:
register_clcmd("say killchance""killchance")

[...]

public 
killchance(id)
{
         if (
random_num(010) == 7)
         {
                  
// Display menu here
         
}
         return 
PLUGIN_CONTINUE

You can do that menu with this tut..
__________________
IneedHelp is offline
emsu66
Junior Member
Join Date: Apr 2008
Location: Under Your Bed
Old 11-12-2008 , 16:00   Re: New AMXX Menu System
Reply With Quote #65

Yes that is very helpful and I will definately use that but that's not what I'm ultimately having trouble with. What I'm trying to do is instead of ITEMS coming up on the menu I would like players' names to come up so that they can slay that selected player.

Thanks,
emsu66

+Credit to you and Emp too!
+Karma if you and/or anyone can help me figure this one out!
__________________


Get a LiFe? I'm a GAMER... I have TONS of lives!!!
emsu66 is offline
Send a message via AIM to emsu66
Old 11-12-2008, 16:06
IneedHelp
This message has been deleted by IneedHelp. Reason: nvM
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-13-2008 , 01:00   Re: New AMXX Menu System
Reply With Quote #66

for the second param of menu_additem, use a string that has the players name (with get_user_name)

pass the players id within data (with num_to_str) then read the data (with str_to_num)

so total example would be:
Code:
function(id)
{
    new menu = menu_create("\rPlayer Menu:", "menu_handler");

    new name[32], id_string[5];
    new players[32], pnum, i, pid;
    get_players(players, pnum);
    for( i=0; i<pnum; i++ ){
        pid = players[i];
        get_user_name(pid, name, 31);
        num_to_str(pid, id_string, 4);
        menu_additem(menu, name, id_string);
    }

    menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

    new pid = str_to_num(data);
    // slay pid

    menu_destroy(menu);
    return PLUGIN_HANDLED;
}

Last edited by Emp`; 11-13-2008 at 01:04.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 11-13-2008, 18:16
AntiBots
This message has been deleted by AntiBots. Reason: solved
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 11-19-2008 , 09:42   Re: New AMXX Menu System
Reply With Quote #67

how i can remove the num of page?
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-19-2008 , 11:22   Re: New AMXX Menu System
Reply With Quote #68

You have to use Old Style.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
pro_on_0
Member
Join Date: Nov 2008
Old 11-25-2008 , 07:23   Re: New AMXX Menu System
Reply With Quote #69

O......very helpful....Thank you very much!
pro_on_0 is offline
Particlman
Member
Join Date: Nov 2005
Old 12-21-2008 , 20:05   Re: New AMXX Menu System
Reply With Quote #70

I'm probably going to hit myself when you tell me what I did wrong but here.

I want the text of the item in the menu to not be defined there. I want it to be taken from outside. It kinda works right now but not really.

This is what I have.

Code:
new const BRANCH[] = {
	"None",
	"Army",
	"Marines"
}
Code:
public ChangeBranch(id)
{
	new branchmenu = menu_create("Branch Menu", "Branch_Handle");
	menu_additem(branchmenu, BRANCH[1], "1", 0);
	menu_additem(branchmenu, BRANCH[2], "2", 0);
	menu_setprop(branchmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, branchmenu, 0);
	return PLUGIN_CONTINUE;
}
The basis for the menu is taken from the XP tutorial but the only thing I really changed was the second param in menu_additem.
If there is a better way the menu should be done tell me please.

/changebranch opens ChangeBranch()

The way it works now is when I type /changebranch in game it gives me
Quote:
1. None
2. one
Have another similar problem but knowing how to fix this will fix that too.
Particlman 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 19:28.


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