Raised This Month: $ Target: $400
 0% 

[MENU]Loop thru players and get info about them


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BlackRaven
Member
Join Date: Jun 2012
Location: Latvia
Old 02-05-2013 , 17:59   [MENU]Loop thru players and get info about them
Reply With Quote #1

Hello.
I want to get info about players from the loop list. (like ip,rank and stuff)
So when you select player from the list,opens another menu in which is info about player.
I made everything,but info in menu about the player is wrong.
Looped thru players:
PHP Code:
    new players[32], pnumtempid;
    new 
szName[32], szTempid[10];
    
    
get_players(playerspnum);
    
    for( new 
ii<pnumi++ )
    {
    
tempid players[i];

    
get_user_name(tempidszNamecharsmax(szName));
    
num_to_str(tempidszTempidcharsmax(szTempid));

    
menu_additem(menunameszNameszTempid0); 
Made that when selects player opens menu:
PHP Code:
    new data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(stmenuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
.. 32:
        {
            
MenuName(id);
        }
    } 
PHP Code:
MenuName(id)
{
                
// making menu for info,blah blah.
                // and in the end get info from the player that was selected


So i need to get id from the player that was selected,but can someone tell me how?

Last edited by BlackRaven; 02-05-2013 at 19:07.
BlackRaven is offline
 



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 20:34.


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