Raised This Month: $ Target: $400
 0% 

Problem with menu "CS 1.6"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DaemonGen
New Member
Join Date: Mar 2011
Old 03-28-2011 , 00:13   Problem with menu "CS 1.6"
Reply With Quote #1

I am making a menu to show other players who do not have a team selected then do an action with them.

The problem I have is that after 10 or more players have been selected it then acts weird and selects a different player and applies the action.

Code:
public menu_pTeam( id )
{
    new MSG[ 2 ];
    new menu = menu_create( "\rChoose A Player:", "menu_handler" );

    for ( new i = 1; i <= g_iMaxPlayers; i++ )
    {
        // Ignore player ID if not connected
        if ( !is_user_connected( i ) || g_pTeam[ i ] > 0 || pid == i )
            continue;

        formatex( MSG, 1, "%i", i )
        menu_additem( menu, P_NAME[ i ], MSG );
    }
    
    menu_setprop( menu, MPROP_EXIT, MEXIT_NEVER );

    menu_id[ id ] = 2;
    
    menu_display( id, menu, 0 );
}
The action is used on a player using "data" to get the chosen player ID
Code:
    new data[ 6 ], pName[ 64 ];
    new access, callback;

    menu_item_getinfo( menu, item, access, data, 5, pName, 63, callback );

    new key = str_to_num( data );
Any suggestions for a different way to make the player menu or an error in code?
P_NAME[ id ] is the players name when they connect to the server.

Thanks

Last edited by DaemonGen; 03-28-2011 at 00:16.
DaemonGen is offline
 


Thread Tools
Display Modes

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 14:32.


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