Raised This Month: $ Target: $400
 0% 

[Datas Dump][Cstrike] m_iMenu : Menu IDs


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-26-2010 , 17:33   [Datas Dump][Cstrike] m_iMenu : Menu IDs
Reply With Quote #1

Menus index that m_iMenu players private data takes, and corresponding keys.

m_iMenu is 205 (linux diff = 5 as any other player pdata offsets) and has been founded by VEN.


Code:
|----------------------------------------------------------------|
|                                  |       |                     |
|       Menu Name                  | PData |         Keys        |
|                                  |       |                     |
|----------------------------------------------------------------|
| #Team_Select_Spect               |     1 | 1 2     5 6         |
| #IG_Team_Select_Spect            |     1 | 1 2     5 6       0 |
| #IG_Team_Select                  |     1 | 1 2     5         0 |
| #IG_VIP_Team_Select              |     1 | 1 2 3   5         0 |
| #IG_VIP_Team_Select_Spect        |     1 | 1 2 3   5 6       0 |
|----------------------------------------------------------------|
| #Terrorist_Select                |     3 | 1 2 3 4 5           |
| #CT_Select                       |     3 | 1 2 3 4 5           |
|----------------------------------------------------------------|
| #Buy                             |     4 | 1 2 3 4 5 6 7 8   0 |
|----------------------------------------------------------------|
| #T_BuyPistol                     |     5 | 1 2 3 4 5         0 |
| #CT_BuyPistol                    |     5 | 1 2 3 4 5         0 |
|----------------------------------------------------------------|
| #T_BuyRifle                      |     6 | 1 2 3 4 5 6       0 |
| #CT_BuyRifle                     |     6 | 1 2 3 4 5 6       0 |
| #AS_T_BuyRifle                   |     6 | 1 2     5         0 |
| #AS_CT_BuyRifle                  |     6 | 1   3 4 5         0 |
|----------------------------------------------------------------|
| #BuyMachineGun                   |     7 | 1                 0 |
| #AS_T_BuyMachineGun              |     7 |                   0 |
|----------------------------------------------------------------|
| #BuyShotgun                      |     8 | 1 2               0 |
| #AS_BuyShotgun                   |     8 |                   0 |
|----------------------------------------------------------------|
| #T_BuySubMachineGun              |     9 | 1 2 3 4           0 |
| #CT_BuySubMachineGun             |     9 | 1 2 3 4           0 |
| #AS_T_BuySubMachineGun           |     9 | 1   3             0 |
| #AS_CT_BuySubMachineGun          |     9 | 1 2 3 4           0 |
|----------------------------------------------------------------|
| #DCT_BuyItem                     |    10 | 1 2 3 4 5 6 7 8   0 |
| #DT_BuyItem                      |    10 | 1 2 3 4 5 6       0 |
| #T_BuyItem                       |    10 | 1 2 3 4 5 6       0 |
| #CT_BuyItem                      |    10 | 1 2 3 4 5 6   8   0 |
|----------------------------------------------------------------|
| #RadioA                          |    11 | 1 2 3 4 5 6       0 |
|----------------------------------------------------------------|
| #RadioB                          |    12 | 1 2 3 4 5 6       0 |
|----------------------------------------------------------------|
| #RadioC                          |    13 | 1 2 3 4 5 6 7 8 9 0 |
|----------------------------------------------------------------|

Plugin used (don't pay attention at aweful code, arkshine asked me to post it):
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"

#define MAX_PLAYERS    32

#define XO_PLAYER    5
#define m_iMenu    205
#define cs_get_user_menu(%1)    get_pdata_int(%1, m_iMenu, XO_PLAYER)

enum _:ShowMenuDatas {
    
iKeysBitSum,
    
szText[32]
}

new 
Trie:g_tMenus

new g_szDataFile[128]

new 
g_mLastMenuDatas[MAX_PLAYERS+1][ShowMenuDatas]

public 
plugin_init()
{
    
register_plugin("Players Menu Logger"VERSION"ConnorMcLeod")

    
g_tMenus TrieCreate()

    
get_localinfo("amxx_logs"g_szDataFilecharsmax(g_szDataFile))
    
add(g_szDataFilecharsmax(g_szDataFile), "/Menus.log")

    
Read_StoredMenus_File()

    
register_event("ShowMenu""Event_ShowMenu""b""1>0")

    
register_clcmd("menuselect""menuselect")
}

Read_StoredMenus_File()
{
    new 
iFile fopen(g_szDataFile"r")
    if( 
iFile )
    {
        new 
szDatas[255], szMenu[128]
        while( !
feof(iFile) )
        {
            
fgets(iFileszDatascharsmax(szDatas))
            
trim(szDatas)
            
parse(szDatasszMenucharsmax(szMenu))
            
TrieSetCell(g_tMenusszMenu1)
        }
        
fclose(iFile)
    }

    
iFile fopen(g_szDataFile"a")
    
fprintf(iFile"|----------------------------------------------------------------|^n")
    
fprintf(iFile"|                                  |       |                     |^n")
    
fprintf(iFile"|       Menu Name                  | PData |         Keys        |^n")
    
fprintf(iFile"|                                  |       |                     |^n")
    
fprintf(iFile"|----------------------------------------------------------------|^n")
    
fclose(iFile)
}

/*Name:      ShowMenu
Structure:     
short     KeysBitSum
char     Time
byte     Multipart
string     Text */
public Event_ShowMenuid )
{
    
g_mLastMenuDatas[id][iKeysBitSum] = read_data(1)
    
read_data(4g_mLastMenuDatas[id][szText], charsmax(g_mLastMenuDatas[][szText]))
}

public 
menuselectid )
{
    if( 
pev_valid(id) < )
    {
        return
    }

    new 
szMenu[32]
    
copy(szMenucharsmax(szMenu), g_mLastMenuDatas[id][szText])

    if( !
TrieKeyExists(g_tMenusszMenu) )
    {
        
TrieSetCell(g_tMenusszMenu1)

        new 
szKeys[20], iKeys g_mLastMenuDatas[id][iKeysBitSum], nk
        
for(new i=0i<=9i++)
        {
            
i+1
            
if( == 10 )
            {
                
0
            
}
            
+= formatex(szKeys[n], charsmax(szKeys)-n, (iKeys & (1<<i)) ? "%d " "  "k)
        }

        new 
iFile fopen(g_szDataFile"a")
        
fprintf(iFile"| %32s | %5d | %19s |^n"szMenucs_get_user_menu(id), szKeys)
        
fclose(iFile)
    }
}

public 
plugin_end()
{
    
TrieDestroyg_tMenus )

    new 
iFile fopen(g_szDataFile"a")
    
fprintf(iFile"|----------------------------------------------------------------|^n^n")
    
fclose(iFile)

Thanks to new IDA version, menu indexes names are now known :
PHP Code:
const m_iMenu 205;

enum Menu
{
    
Menu_OFF,
    
Menu_ChooseTeam,
    
Menu_IGChooseTeam,
    
Menu_ChooseAppearance,
    
Menu_Buy,
    
Menu_BuyPistol,
    
Menu_BuyRifle,
    
Menu_BuyMachineGun,
    
Menu_BuyShotgun,
    
Menu_BuySubMachineGun,
    
Menu_BuyItem,
    
Menu_Radio1,
    
Menu_Radio2,
    
Menu_Radio3,
    
Menu_ClientBuy
}

stock Menu:cs_get_user_menu(id)
{
    return 
Menu:get_pdata_int(idm_iMenu);
}

stock cs_set_user_menu(id, {_,Menu}:menu _:Menu_OFF)
{
    
set_pdata_int(idm_iMenumenu);

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-04-2013 at 12:11.
ConnorMcLeod 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 19:18.


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