mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
using MENU_KEY defines
This commit is contained in:
parent
5874a313e4
commit
9a88c0e240
@ -55,12 +55,12 @@ new Float:g_voteRatio
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("Admin Votes","0.20","AMXX Dev Team")
|
||||
register_menucmd(register_menuid("Change map to ") ,(1<<0)|(1<<1),"voteCount")
|
||||
register_menucmd(register_menuid("Choose map: ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"voteCount")
|
||||
register_menucmd(register_menuid("Kick ") ,(1<<0)|(1<<1),"voteCount")
|
||||
register_menucmd(register_menuid("Ban ") ,(1<<0)|(1<<1),"voteCount")
|
||||
register_menucmd(register_menuid("Vote: ") ,(1<<0)|(1<<1),"voteCount")
|
||||
register_menucmd(register_menuid("The result: ") ,(1<<0)|(1<<1),"actionResult")
|
||||
register_menucmd(register_menuid("Change map to ") ,MENU_KEY_1|MENU_KEY_2,"voteCount")
|
||||
register_menucmd(register_menuid("Choose map: ") ,MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4,"voteCount")
|
||||
register_menucmd(register_menuid("Kick ") ,MENU_KEY_1|MENU_KEY_2,"voteCount")
|
||||
register_menucmd(register_menuid("Ban ") ,MENU_KEY_1|MENU_KEY_2,"voteCount")
|
||||
register_menucmd(register_menuid("Vote: ") ,MENU_KEY_1|MENU_KEY_2,"voteCount")
|
||||
register_menucmd(register_menuid("The result: ") ,MENU_KEY_1|MENU_KEY_2,"actionResult")
|
||||
register_concmd("amx_votemap","cmdVoteMap",ADMIN_VOTE,"<map> [map] [map] [map]")
|
||||
register_concmd("amx_votekick","cmdVoteKickBan",ADMIN_VOTE,"<name or #userid>")
|
||||
register_concmd("amx_voteban","cmdVoteKickBan",ADMIN_VOTE,"<name or #userid>")
|
||||
@ -198,7 +198,7 @@ public cmdVoteMap(id,level,cid) {
|
||||
new menu_msg[256]
|
||||
new keys = 0
|
||||
if (g_validMaps > 1){
|
||||
keys = (1<<9)
|
||||
keys = MENU_KEY_0
|
||||
copy(menu_msg,255,g_coloredMenus ? "\yChoose map: \w^n^n" : "Choose map: ^n^n")
|
||||
new temp[128]
|
||||
for(new a = 0; a < g_validMaps; ++a){
|
||||
@ -212,7 +212,7 @@ public cmdVoteMap(id,level,cid) {
|
||||
else{
|
||||
format(menu_msg,255,g_coloredMenus ? "\yChange map to %s?\w^n^n1. Yes^n2. No"
|
||||
: "Change map to %s?^n^n1. Yes^n2. No",g_optionName[0])
|
||||
keys = (1<<0)|(1<<1)
|
||||
keys = MENU_KEY_1|MENU_KEY_2
|
||||
g_yesNoVote = 1
|
||||
}
|
||||
new authid[32],name[32]
|
||||
@ -281,7 +281,7 @@ public cmdVote(id,level,cid) {
|
||||
}
|
||||
|
||||
new menu_msg[256]
|
||||
new keys = (1<<0)|(1<<1)
|
||||
new keys = MENU_KEY_1|MENU_KEY_2
|
||||
format(menu_msg,255, g_coloredMenus ? "\yVote: %s\w^n^n1. %s^n2. %s"
|
||||
: "Vote: %s^n^n1. %s^n2. %s",quest,g_optionName[0],g_optionName[1])
|
||||
g_execResult = false
|
||||
@ -324,7 +324,7 @@ public cmdVoteKickBan(id,level,cid) {
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
new keys = (1<<0)|(1<<1)
|
||||
new keys = MENU_KEY_1|MENU_KEY_2
|
||||
new menu_msg[256]
|
||||
get_user_name(player,arg,31)
|
||||
format(menu_msg,255,g_coloredMenus ? "\y%s %s?\w^n^n1. Yes^n2. No"
|
||||
|
@ -149,7 +149,7 @@ displayCmdMenu(id,pos){
|
||||
pos+1,( g_menuSelectNum[id] / 8 + ((g_menuSelectNum[id] % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
new keys = (1<<9)
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > g_menuSelectNum[id])
|
||||
end = g_menuSelectNum[id]
|
||||
@ -173,7 +173,7 @@ displayCmdMenu(id,pos){
|
||||
|
||||
if (end != g_menuSelectNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit" )
|
||||
show_menu(id,keys,menuBody)
|
||||
@ -315,7 +315,7 @@ displayCvarMenu(id,pos){
|
||||
pos+1,( g_menuSelectNum[id] / 8 + ((g_menuSelectNum[id] % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
new keys = (1<<9)
|
||||
new keys = MENU_KEY_0
|
||||
new szValue[64]
|
||||
|
||||
if (end > g_menuSelectNum[id])
|
||||
@ -334,7 +334,7 @@ displayCvarMenu(id,pos){
|
||||
|
||||
if (end != g_menuSelectNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
show_menu(id,keys,menuBody)
|
||||
|
@ -176,7 +176,7 @@ displayVoteMapsMenu(id,pos)
|
||||
"\yVotemap Menu\R%d/%d^n\w^n" : "Votemap Menu %d/%d^n^n",
|
||||
pos+1,( g_mapNums / 7 + (( g_mapNums % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7, keys = (1<<9)
|
||||
new end = start + 7, keys = MENU_KEY_0
|
||||
|
||||
if (end > g_mapNums)
|
||||
end = g_mapNums
|
||||
@ -200,7 +200,7 @@ displayVoteMapsMenu(id,pos)
|
||||
|
||||
if ( g_voteSelectedNum[id] )
|
||||
{
|
||||
keys |= (1<<7)
|
||||
keys |= MENU_KEY_8
|
||||
len += format(menuBody[len],511-len,"^n8. Start Voting^n")
|
||||
}
|
||||
else
|
||||
@ -210,7 +210,7 @@ displayVoteMapsMenu(id,pos)
|
||||
if (end != g_mapNums)
|
||||
{
|
||||
len += format(menuBody[len],511-len,"^n9. More...^n0. %s^n", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else
|
||||
len += format(menuBody[len],511-len,"^n0. %s^n", pos ? "Back" : "Exit")
|
||||
@ -323,7 +323,7 @@ public actionVoteMapMenu(id,key)
|
||||
{
|
||||
len = format(menuBody,511, g_coloredMenus ? "\yChange map to^n%s?^n\w^n1. Yes^n2. No^n"
|
||||
: "Change map to^n%s?^n^n1. Yes^n2. No^n" , g_mapName[ g_voteSelected[id][ 0 ] ] )
|
||||
keys = (1<<0) | (1<<1)
|
||||
keys = MENU_KEY_1|MENU_KEY_2
|
||||
}
|
||||
|
||||
for(new b = 0; b < pnum; ++b)
|
||||
@ -331,7 +331,7 @@ public actionVoteMapMenu(id,key)
|
||||
show_menu(players[b],keys,menuBody, iVoteTime)
|
||||
|
||||
format(menuBody[len],511,"^n0. Cancel Vote")
|
||||
keys |= (1<<9)
|
||||
keys |= MENU_KEY_0
|
||||
show_menu(id,keys,menuBody, iVoteTime)
|
||||
|
||||
new authid[32],name[32]
|
||||
@ -413,7 +413,7 @@ displayMapsMenu(id,pos)
|
||||
pos+1,( g_mapNums / 8 + (( g_mapNums % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
new keys = (1<<9)
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > g_mapNums)
|
||||
end = g_mapNums
|
||||
@ -427,7 +427,7 @@ displayMapsMenu(id,pos)
|
||||
if (end != g_mapNums)
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
|
@ -158,7 +158,7 @@ displayMenu(id,pos){
|
||||
g_coloredMenus ? "\yAMX Mod X Menu\R%d/%d^n\w^n" : "AMX Mod X Menu %d/%d^n^n" , pos+1, 2 )
|
||||
|
||||
new end = start + 8
|
||||
new keys = (1<<9)
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > MENUS_NUMBER )
|
||||
end = MENUS_NUMBER
|
||||
@ -189,7 +189,7 @@ displayMenu(id,pos){
|
||||
if (end != MENUS_NUMBER )
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
|
@ -175,7 +175,7 @@ displayMenu(id, pos) {
|
||||
new len = format(menu_body,511,
|
||||
g_coloredMenus ? "\yPause/Unpause Plugins\R%d/%d^n\w^n" : "Pause/Unpause Plugins %d/%d^n^n" ,
|
||||
pos + 1,((datanum/6)+((datanum%6)?1:0)))
|
||||
new end = start + 6, keys = (1<<9)|(1<<7)|(1<<6)
|
||||
new end = start + 6, keys = MENU_KEY_0|MENU_KEY_8|MENU_KEY_7
|
||||
if (end > datanum) end = datanum
|
||||
for(new a = start; a < end; ++a){
|
||||
get_plugin(a,filename,31,title,31,status,0,status,0,status,1)
|
||||
@ -199,7 +199,7 @@ displayMenu(id, pos) {
|
||||
: "8. Save stopped %s^n" ,g_Modified ? "*" : "")
|
||||
if (end != datanum){
|
||||
format(menu_body[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menu_body[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
show_menu(id,keys,menu_body)
|
||||
|
@ -150,7 +150,7 @@ displayBanMenu(id,pos){
|
||||
pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = (1<<9)|(1<<7)
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
@ -184,7 +184,7 @@ displayBanMenu(id,pos){
|
||||
if (end != g_menuPlayersNum[id])
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
@ -287,7 +287,7 @@ displaySlapMenu(id,pos){
|
||||
pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = (1<<9)|(1<<7)
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
@ -324,7 +324,7 @@ displaySlapMenu(id,pos){
|
||||
if (end != g_menuPlayersNum[id])
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
@ -398,7 +398,7 @@ displayKickMenu(id,pos){
|
||||
pos+1,( g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
new keys = (1<<9)
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
@ -427,7 +427,7 @@ displayKickMenu(id,pos){
|
||||
if (end != g_menuPlayersNum[id])
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
@ -505,7 +505,7 @@ displayTeamMenu(id,pos){
|
||||
pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = (1<<9)|(1<<7)
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
@ -538,7 +538,7 @@ displayTeamMenu(id,pos){
|
||||
if (end != g_menuPlayersNum[id])
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
@ -616,7 +616,7 @@ displayClcmdMenu(id,pos){
|
||||
pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = (1<<9)|(1<<7)
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
@ -650,7 +650,7 @@ displayClcmdMenu(id,pos){
|
||||
if (end != g_menuPlayersNum[id])
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
||||
|
@ -435,7 +435,7 @@ displayMenu(id,pos){
|
||||
new menubody[512], start = pos * 7
|
||||
if (start >= MAXMENUPOS) start = pos = g_Position[id] = 0
|
||||
new len = format(menubody,511,"\yRestrict Weapons\R%d/5^n\w^n",pos+1)
|
||||
new end = start + 7, keys = (1<<9)|(1<<7), k = 0
|
||||
new end = start + 7, keys = MENU_KEY_0|MENU_KEY_8, k = 0
|
||||
if (end > MAXMENUPOS) end = MAXMENUPOS
|
||||
for(new a = start; a < end; ++a){
|
||||
keys |= (1<<k)
|
||||
@ -445,7 +445,7 @@ displayMenu(id,pos){
|
||||
len += format(menubody[len],511-len,"^n8. Save settings \y\R%s^n\w",g_Modified?"*":"")
|
||||
if (end != MAXMENUPOS){
|
||||
format(menubody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menubody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
show_menu(id,keys,menubody)
|
||||
|
@ -160,7 +160,7 @@ displayCfgMenu(id,pos){
|
||||
if (start >= g_menuDataNum) start = pos = g_menuPosition[id] = 0
|
||||
new len = format(menu_body,511,"\yStats Configuration\R%d/%d^n\w^n",
|
||||
pos + 1,((g_menuDataNum/7)+((g_menuDataNum%7)?1:0)))
|
||||
new end = start + 7, keys = (1<<9)|(1<<7), k = 0
|
||||
new end = start + 7, keys = MENU_KEY_0|MENU_KEY_8, k = 0
|
||||
if (end > g_menuDataNum) end = g_menuDataNum
|
||||
for(new a = start; a < end; ++a){
|
||||
keys |= (1<<k)
|
||||
@ -172,7 +172,7 @@ displayCfgMenu(id,pos){
|
||||
len += format(menu_body[len],511-len,"^n8. Save configuration\y\R%s^n\w",g_modified ? "*" : "")
|
||||
if (end != g_menuDataNum){
|
||||
format(menu_body[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menu_body[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
show_menu(id,keys,menu_body)
|
||||
|
@ -1391,12 +1391,12 @@ showStatsMenu( id, iMenuPos ) {
|
||||
iLen += format( g_sBuffer[iLen], MAX_BUFFER_LENGTH - iLen,
|
||||
"%d. %s^n\w", iMenuOption + 1, t_sName );
|
||||
}
|
||||
iKeyMask |= (1<<7)|(1<<9);
|
||||
iKeyMask |= MENU_KEY_8|MENU_KEY_0;
|
||||
iLen += format( g_sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "^n8. %s^n\w",
|
||||
g_izUserMenuActionText[ g_izUserMenuAction[id] ] );
|
||||
if( iPlayers > iUserIndex ) {
|
||||
iLen += copy( g_sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "^n9. More..." );
|
||||
iKeyMask |= (1<<8);
|
||||
iKeyMask |= MENU_KEY_9;
|
||||
}
|
||||
if( iMenuPos > 0 )
|
||||
iLen += copy( g_sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "^n0. Back" );
|
||||
|
@ -127,7 +127,7 @@ displayTelMenu(id,pos) {
|
||||
pos+1,( g_menuPlayersNum[id] / 6 + ((g_menuPlayersNum[id] % 6) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 6
|
||||
new keys = (1<<9)|(1<<7)
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
@ -150,7 +150,7 @@ displayTelMenu(id,pos) {
|
||||
}
|
||||
|
||||
if ( g_menuOption[id] > 0 ) { // 1
|
||||
keys |= (1<<6)
|
||||
keys |= MENU_KEY_7
|
||||
len += format(menuBody[len],511-len,"^n7. To location: %d %d %d^n",
|
||||
g_menuOrgin[id][0],g_menuOrgin[id][1] ,g_menuOrgin[id][2])
|
||||
}
|
||||
@ -161,7 +161,7 @@ displayTelMenu(id,pos) {
|
||||
len += format(menuBody[len],511-len,"^n#. Current Location^n")
|
||||
}
|
||||
else { // 0
|
||||
keys |= (1<<6)
|
||||
keys |= MENU_KEY_7
|
||||
len += format(menuBody[len],511-len,"^n7. Current Location^n")
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ displayTelMenu(id,pos) {
|
||||
|
||||
if (end != g_menuPlayersNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
keys |= (1<<8)
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else
|
||||
format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
|
Loading…
Reference in New Issue
Block a user