AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making A Menu Of Players (https://forums.alliedmods.net/showthread.php?t=50349)

OmgHi 01-24-2007 13:40

Making A Menu Of Players
 
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

Brad 01-24-2007 14:01

Re: Making A Menu Of Players
 
Using the old or the new menu functions?

OmgHi 01-24-2007 15:29

Re: Making A Menu Of Players
 
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!

stupok 01-24-2007 17:49

Re: Making A Menu Of Players
 
Old way:
http://forums.alliedmods.net/showpos...31&postcount=5

OmgHi 01-24-2007 18:52

Re: Making A Menu Of Players
 
Ok, thanks, By anychance does anybody know the "New" way to do that?

Any help would be greatly appriciated.

Brad 01-24-2007 22:45

Re: Making A Menu Of Players
 
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; }

OmgHi 01-25-2007 00:02

Re: Making A Menu Of Players
 
Woot! Thanks brad!

Im going to go try this now!


All times are GMT -4. The time now is 22:23.

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