Raised This Month: $ Target: $400
 0% 

Making A Menu Of Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OmgHi
Junior Member
Join Date: Jan 2007
Old 01-24-2007 , 13:40   Making A Menu Of Players
Reply With Quote #1

Hello, i was wondering how to create a menu with a list of players in the server.

Like so..

When you go in-game and type the command /playermenu

A menu would pop up and say...

Player Menu
1. Bob
2. Santos
3. Edward
4. Hector
5. Ben
6. Ken
7. John
9. Next Page
0. Close Menu
OmgHi is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 01-24-2007 , 14:01   Re: Making A Menu Of Players
Reply With Quote #2

Using the old or the new menu functions?
__________________
Brad is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 01-24-2007 , 15:29   Re: Making A Menu Of Players
Reply With Quote #3

Hmm, i don't know...

Maybe the new ones because i use amxx 1.76?

Could you list both ways please?

If not, atleast list one?

Thanks!
OmgHi is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 01-24-2007 , 17:49   Re: Making A Menu Of Players
Reply With Quote #4

Old way:
http://forums.alliedmods.net/showpos...31&postcount=5
stupok is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 01-24-2007 , 18:52   Re: Making A Menu Of Players
Reply With Quote #5

Ok, thanks, By anychance does anybody know the "New" way to do that?

Any help would be greatly appriciated.
OmgHi is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 01-24-2007 , 22:45   Re: Making A Menu Of Players
Reply With Quote #6

Code:
#define MAX_CNT_PLAYER 32 #define MAX_LEN_PLAYER_NAME 32 menu_player_display() {     new menu = menu_create("Select Player:", "menu_player_handler");         new players[MAX_CNT_PLAYER], playerCnt;     get_players(players, playerCnt);     new command[3], name[MAX_LEN_PLAYER_NAME + 1];     for (new playerIdx = 0; playerIdx < playerCnt; playerIdx++)     {         formatex(command, 2, "%i", playerIdx + 1);         get_user_username(id, name, MAX_LEN_PLAYER_NAME);         menu_additem(menu, name, command);     } } public menu_player_handler(id, menu, item) {     new cmd[3], name[MAX_LEN_PLAYER_NAME + 1], access;         menu_item_getinfo(menu, item, access, cmd, 2, name, MAX_LEN_PLAYER_NAME, access);         client_print(id, print_chat, "Menu resolved to: %s (%s)", name, cmd);         menu_destroy(menu);     return PLUGIN_HANDLED; }
__________________
Brad is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 01-25-2007 , 00:02   Re: Making A Menu Of Players
Reply With Quote #7

Woot! Thanks brad!

Im going to go try this now!
OmgHi 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:23.


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