Raised This Month: $ Target: $400
 0% 

Making A Menu Of Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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 #2

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