|
楼主 |
发表于 2014-12-20 01:27:27
|
显示全部楼层
来自 中国–天津–天津
[mw_shl_code=pawn,true]//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Handles Multi-Page Players Menu
/*public PlayerMenuCmd( id, key )
{
switch( key )
{
case 8:
{
// User Selected "More..." Option
ShowPlayerMenu( id, ++g_nMenuPosition[id-1] )
}
case 9:
{
// User Chose to go Back to Previous Menu
if( g_nMenuPosition[id-1] )
{
ShowPlayerMenu( id, --g_nMenuPosition[id-1] )
}else
{
ShowMainMenu( id )
}
}
default:
{
// Find which Player was chosen
new nPlayerID = g_nMenuPlayers[id-1][g_nMenuPosition[id-1] * MAX_DISPLAY + key]
// Give Player Selected Item
GiveMenuItem( id, nPlayerID )
// Check which Menu to Re-Open (if any)
switch( clamp(get_cvar_num("sv_weaponmenu_state"), 0, 2) )
{
case 1: ShowPlayerMenu( id, g_nMenuPosition[id-1] ) // Players Menu (At Last Position)
case 2: ShowMainMenu( id ) // Weapons Menu
}
}
}
return PLUGIN_HANDLED
}*/
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Handles Multi-Page Extras Menu
public ExtraMenuCmd( id, key )
{
// Track which Option was chosen
g_nMenuOption[id-1] = g_nMenuPosition[id-1] * MAX_DISPLAY + key
switch( key )
{
case 8:
{
// User Selected "More..." Option
ShowExtraMenu( id, ++g_nMenuPosition[id-1] )
}
case 9:
{
// User Chose to go Back to Previous Menu
if( g_nMenuPosition[id-1] )
{
ShowExtraMenu( id, --g_nMenuPosition[id-1] )
}else
{
ShowMainMenu( id )
}
}
//default: ShowPlayerMenu( id, g_nMenuPosition[id-1] = 0 )
default: GiveMenuItem( id, id )
}
return PLUGIN_HANDLED
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
//
// Menu Building Code Below
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Main Menu Section
public ShowMainMenu( id )
{
new i, nLen, nKeys = (1<<9)
new szMenuBody[256]
nLen = format( szMenuBody, 255, "\y武器菜单:\w^n" )
for( i = 0; i < MO_MAX_MAIN; i++ )
{
nKeys |= (1<<i)
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szMainMenuTxt )
}
format( szMenuBody[nLen], (255-nLen), "^n0. tui chu" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Pistol Menu Section
public ShowPistolMenu( id )
{
new i, nLen, nKeys = (1<<9)
new szMenuBody[256]
nLen = format( szMenuBody, 255, "\y手枪:\w^n" )
for( i = 0; i < MO_MAX_PISTOL; i++ )
{
nKeys |= (1<<i)
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szPistolMenuTxt )
}
format( szMenuBody[nLen], (255-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Shotgun Menu Section
public ShowShotgunMenu( id )
{
new i, nLen, nKeys = (1<<9)
new szMenuBody[256]
nLen = format( szMenuBody, 255, "\y霰弹枪:\w^n" )
for( i = 0; i < MO_MAX_SHOTGUN; i++ )
{
nKeys |= (1<<i)
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szShotgunMenuTxt )
}
format( szMenuBody[nLen], (255-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build SMG Menu Section
public ShowSmgMenu( id )
{
new i, nLen, nKeys = (1<<9)
new szMenuBody[2256]
nLen = format( szMenuBody, 255, "\y冲锋枪:\w^n" )
for( i = 0; i < MO_MAX_SMG; i++ )
{
nKeys |= (1<<i)
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szSmgMenuTxt )
}
format( szMenuBody[nLen], (255-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Rifle Menu Section
public ShowRifleMenu( id, pos )
{
if( pos < 0 ) return
new i, j = 0, nStart, nEnd, nLen, nKeys = (1<<9)
new szMenuBody[512]
nStart = pos * MAX_DISPLAY
if( nStart >= MO_MAX_RIFLE )
nStart = pos = g_nMenuPosition[id-1] = 0
nLen = format( szMenuBody, 511, "\y突击步枪 狙击步枪:\R%d/2^n\w^n", pos + 1 )
nEnd = nStart + MAX_DISPLAY
if( nEnd > MO_MAX_RIFLE ) nEnd = MO_MAX_RIFLE
for( i = nStart; i < nEnd; i++ )
{
nKeys |= (1<<j++)
nLen += format( szMenuBody[nLen], (511-nLen), "%d. %s^n", j, g_szRifleMenuTxt )
}
if( nEnd != MO_MAX_RIFLE )
{
format( szMenuBody[nLen], (511-nLen), "^n9. 更多...^n0. fan hui" )
nKeys |= (1<<8)
}
else format( szMenuBody[nLen], (511-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Machine Gun Menu Section
public ShowMachineMenu( id )
{
new nLen, nKeys = (1<<0|1<<9)
new szMenuBody[256]
nLen = format( szMenuBody, 255, "\y班用机枪:\w^n" )
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", 1, g_szMachineMenuTxt )
format( szMenuBody[nLen], (255-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Equipment Menu Section
public ShowEquipMenu( id )
{
new i, nLen, nKeys = (1<<9)
new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yOp zhuang bei:\w^n" )
for( i = 0; i < MO_MAX_EQUIP; i++ )
{
nKeys |= (1<<i)
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szEquipMenuTxt )
}
format( szMenuBody[nLen], (255-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
//
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// Build Extras Menu Section
/*
public ShowExtraMenu( id )
{
new i, nLen, nKeys = (1<<9)
new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yOp Wu Qi:\w^n" )
for( i = 0; i < MO_MAX_EXTRA; i++ )
{
nKeys |= (1<<i)
nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szExtraMenuTxt )
}
format( szMenuBody[nLen], (255-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}*/
public ShowExtraMenu( id, pos )
{
if( pos < 0 ) return
new i, j = 0, nStart, nEnd, nLen, nKeys = (1<<9)
new szMenuBody[512]
nStart = pos * MAX_DISPLAY
if( nStart >= MO_MAX_EXTRA )
nStart = pos = g_nMenuPosition[id-1] = 0
nLen = format( szMenuBody, 511, "\yOp Wu Qi:\R%d/2^n\w^n", pos + 1 )
nEnd = nStart + MAX_DISPLAY
if( nEnd > MO_MAX_EXTRA ) nEnd = MO_MAX_EXTRA
for( i = nStart; i < nEnd; i++ )
{
nKeys |= (1<<j++)
nLen += format( szMenuBody[nLen], (511-nLen), "%d. %s^n", j, g_szExtraMenuTxt )
}
if( nEnd != MO_MAX_EXTRA )
{
format( szMenuBody[nLen], (511-nLen), "^n9. 更多...^n0. fan hui" )
nKeys |= (1<<8)
}
else format( szMenuBody[nLen], (511-nLen), "^n0. fan hui" )
show_menu( id, nKeys, szMenuBody, -1 )
return
}
[/mw_shl_code] |
|