mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
updated to use the multi-lingual system | better code style
This commit is contained in:
parent
9276dbb086
commit
89b4ef92b5
@ -40,9 +40,9 @@
|
||||
#define MAX_CMDS_LAYERS 3
|
||||
|
||||
new g_cmdMenuName[ MAX_CMDS_LAYERS ][] = {
|
||||
"Commands Menu",
|
||||
"Configs Menu",
|
||||
"Speech Menu"
|
||||
"CMD_MENU",
|
||||
"CONF_MENU",
|
||||
"SPE_MENU"
|
||||
}
|
||||
|
||||
new g_cmdMenuCmd[ MAX_CMDS_LAYERS ][] = {
|
||||
@ -86,15 +86,17 @@ new g_menuLayer[33]
|
||||
|
||||
new g_coloredMenus
|
||||
|
||||
public plugin_init()
|
||||
{
|
||||
public plugin_init() {
|
||||
register_plugin("Commands Menu",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("cmdmenu.txt")
|
||||
register_dictionary("common.txt")
|
||||
|
||||
new configsDir[64];
|
||||
get_configsdir(configsDir, 63);
|
||||
new config[64]
|
||||
new configsDir[64],config[64]
|
||||
get_configsdir(configsDir, 63)
|
||||
for (new a = 0; a < MAX_CMDS_LAYERS; ++a) {
|
||||
register_menucmd(register_menuid( g_cmdMenuName[ a ] ),1023,"actionCmdMenu")
|
||||
new MenuName[64]
|
||||
format(MenuName,63,"%L","en",g_cmdMenuName[a])
|
||||
register_menucmd(register_menuid( MenuName ),1023,"actionCmdMenu")
|
||||
register_clcmd( g_cmdMenuCmd[ a ] ,"cmdCmdMenu",ADMIN_MENU, g_cmdMenuHelp[ a ] )
|
||||
format(config,63,"%s/%s",configsDir,g_cmdMenuCfg[a])
|
||||
loadCmdSettings(config,a)
|
||||
@ -112,8 +114,7 @@ public plugin_init()
|
||||
|
||||
/* Commands menu */
|
||||
|
||||
public actionCmdMenu(id,key)
|
||||
{
|
||||
public actionCmdMenu(id,key) {
|
||||
switch (key) {
|
||||
case 8: displayCmdMenu(id,++g_menuPosition[id])
|
||||
case 9: displayCmdMenu(id,--g_menuPosition[id])
|
||||
@ -134,7 +135,6 @@ public actionCmdMenu(id,key)
|
||||
|
||||
|
||||
displayCmdMenu(id,pos) {
|
||||
|
||||
if (pos < 0) return
|
||||
|
||||
new menuBody[512]
|
||||
@ -145,7 +145,7 @@ displayCmdMenu(id,pos){
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511,g_coloredMenus ?
|
||||
"\y%s\R%d/%d^n\w^n" : "%s %d/%d^n^n" , g_cmdMenuName[ g_menuLayer[id] ],
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n" , id, g_cmdMenuName[ g_menuLayer[id] ],
|
||||
pos+1,( g_menuSelectNum[id] / 8 + ((g_menuSelectNum[id] % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
@ -154,33 +154,31 @@ displayCmdMenu(id,pos){
|
||||
if (end > g_menuSelectNum[id])
|
||||
end = g_menuSelectNum[id]
|
||||
|
||||
for(new a = start; a < end; ++a)
|
||||
{
|
||||
if ( g_cmdCmd[ g_menuSelect[id][ a ] ][0] == '-' )
|
||||
{
|
||||
for(new a = start; a < end; ++a) {
|
||||
if ( g_cmdCmd[ g_menuSelect[id][ a ] ][0] == '-' ) {
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len,"\d%s^n\w",g_cmdName[ g_menuSelect[id][ a ] ] )
|
||||
else
|
||||
len += format(menuBody[len],511-len,"%s^n",g_cmdName[ g_menuSelect[id][ a ] ] )
|
||||
++b
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n",++b, g_cmdName[ g_menuSelect[id][ a ] ] )
|
||||
}
|
||||
}
|
||||
|
||||
if (end != g_menuSelectNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT" )
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit" )
|
||||
show_menu(id,keys,menuBody)
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT" )
|
||||
new MenuName[64]
|
||||
format(MenuName,63,"%L","en",g_cmdMenuName[g_menuLayer[id]])
|
||||
show_menu(id,keys,menuBody,-1,MenuName)
|
||||
}
|
||||
|
||||
public cmdCmdMenu(id,level,cid)
|
||||
{
|
||||
public cmdCmdMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
|
||||
|
||||
new szCmd[32]
|
||||
@ -188,8 +186,7 @@ public cmdCmdMenu(id,level,cid)
|
||||
|
||||
new lvl = 0
|
||||
|
||||
while( lvl < MAX_CMDS_LAYERS )
|
||||
{
|
||||
while( lvl < MAX_CMDS_LAYERS ) {
|
||||
if ( equal( g_cmdMenuCmd[ lvl ], szCmd ) )
|
||||
break
|
||||
|
||||
@ -205,12 +202,10 @@ public cmdCmdMenu(id,level,cid)
|
||||
new a = lvl * MAX_CMDS
|
||||
new d , c = 0
|
||||
|
||||
while( c < g_cmdNum[ lvl ] )
|
||||
{
|
||||
while( c < g_cmdNum[ lvl ] ) {
|
||||
d = a + c
|
||||
|
||||
if ( g_cmdMisc[ d ][0] & flags )
|
||||
{
|
||||
if ( g_cmdMisc[ d ][0] & flags ) {
|
||||
g_menuSelect[id][ g_menuSelectNum[id]++ ] = d
|
||||
}
|
||||
|
||||
@ -223,23 +218,20 @@ public cmdCmdMenu(id,level,cid)
|
||||
}
|
||||
|
||||
|
||||
loadCmdSettings( szFilename[], level )
|
||||
{
|
||||
loadCmdSettings( szFilename[], level ) {
|
||||
if ( !file_exists ( szFilename ) )
|
||||
return 0
|
||||
|
||||
new text[256], szFlags[32], szAccess[32]
|
||||
new a, pos = 0, c, d = level * MAX_CMDS
|
||||
|
||||
while ( g_cmdNum[ level ] < MAX_CMDS && read_file (szFilename,pos++,text,255,a) )
|
||||
{
|
||||
while ( g_cmdNum[ level ] < MAX_CMDS && read_file (szFilename,pos++,text,255,a) ) {
|
||||
if ( text[0] == ';' ) continue
|
||||
|
||||
c = d + g_cmdNum[ level ]
|
||||
|
||||
if ( parse( text , g_cmdName[ c ] , 31 ,
|
||||
g_cmdCmd[ c ] ,63,szFlags,31,szAccess,31 ) > 3 )
|
||||
{
|
||||
g_cmdCmd[ c ] ,63,szFlags,31,szAccess,31 ) > 3 ) {
|
||||
while ( replace( g_cmdCmd[ c ] ,63,"\'","^"") ) {
|
||||
// do nothing
|
||||
}
|
||||
@ -256,13 +248,11 @@ loadCmdSettings( szFilename[], level )
|
||||
|
||||
/* Cvars menu */
|
||||
|
||||
public actionCvarMenu(id,key)
|
||||
{
|
||||
public actionCvarMenu(id,key) {
|
||||
switch (key){
|
||||
case 8: displayCvarMenu(id,++g_menuPosition[id])
|
||||
case 9: displayCvarMenu(id,--g_menuPosition[id])
|
||||
default: {
|
||||
|
||||
new option = g_menuSelect[ id ][ g_menuPosition[id] * 8 + key ]
|
||||
|
||||
new szValue[32]
|
||||
@ -271,10 +261,8 @@ public actionCvarMenu(id,key)
|
||||
new end = g_cvarMisc[ option ][ 2 ]
|
||||
new start = g_cvarMisc[ option ][ 1 ]
|
||||
|
||||
for(new i = start ; ; ++i )
|
||||
{
|
||||
if ( i < end )
|
||||
{
|
||||
for (new i = start ; ; ++i ) {
|
||||
if ( i < end ) {
|
||||
if ( equal( szValue , g_cvarCmd[ i ] ) )
|
||||
{
|
||||
if (++i >= end)
|
||||
@ -285,8 +273,7 @@ public actionCvarMenu(id,key)
|
||||
break
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
set_cvar_string( g_cvarNames[ option ], g_cvarCmd[ start ] )
|
||||
break
|
||||
}
|
||||
@ -300,7 +287,6 @@ public actionCvarMenu(id,key)
|
||||
|
||||
|
||||
displayCvarMenu(id,pos) {
|
||||
|
||||
if (pos < 0) return
|
||||
|
||||
new menuBody[512]
|
||||
@ -321,8 +307,7 @@ displayCvarMenu(id,pos){
|
||||
if (end > g_menuSelectNum[id])
|
||||
end = g_menuSelectNum[id]
|
||||
|
||||
for(new a = start; a < end; ++a)
|
||||
{
|
||||
for(new a = start; a < end; ++a) {
|
||||
get_cvar_string( g_cvarNames[ g_menuSelect[id][ a ] ],szValue,31)
|
||||
keys |= (1<<b)
|
||||
++b
|
||||
@ -333,15 +318,14 @@ displayCvarMenu(id,pos){
|
||||
}
|
||||
|
||||
if (end != g_menuSelectNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L",id,"MORE",id,pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||
show_menu(id,keys,menuBody)
|
||||
}
|
||||
|
||||
public cmdCvarMenu(id,level,cid)
|
||||
{
|
||||
public cmdCvarMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
|
||||
|
||||
new flags = get_user_flags(id)
|
||||
@ -357,8 +341,7 @@ public cmdCvarMenu(id,level,cid)
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
loadCvarSettings( szFilename[] )
|
||||
{
|
||||
loadCvarSettings( szFilename[] ) {
|
||||
if ( !file_exists ( szFilename ) )
|
||||
return 0
|
||||
|
||||
@ -366,8 +349,7 @@ loadCvarSettings( szFilename[] )
|
||||
new inum , a, pos = 0
|
||||
new cvar_values = MAX_CVARS * 5
|
||||
// a b c d
|
||||
while ( g_cvarNum < MAX_CVARS && read_file (szFilename,pos++,text,255,a) )
|
||||
{
|
||||
while ( g_cvarNum < MAX_CVARS && read_file (szFilename,pos++,text,255,a) ) {
|
||||
if ( text[0] == ';' ) continue
|
||||
|
||||
inum = parse( text , g_cvarNames[ g_cvarNum ] , 31 ,
|
||||
@ -382,8 +364,7 @@ loadCvarSettings( szFilename[] )
|
||||
|
||||
g_cvarMisc[ g_cvarNum ][1] = g_cvarCmdNum
|
||||
|
||||
for( a = 0 ; a < inum && g_cvarCmdNum < cvar_values ; ++a )
|
||||
{
|
||||
for ( a = 0 ; a < inum && g_cvarCmdNum < cvar_values ; ++a ) {
|
||||
while ( replace( szValues[ a ] ,31 , "\'" , "^"" ) ) {
|
||||
// do nothing
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ new g_Current
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("Info. Messages",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("imessage.txt")
|
||||
register_srvcmd("amx_imessage","setMessage")
|
||||
register_cvar("amx_freq_imessage","10")
|
||||
new lastinfo[8]
|
||||
@ -67,11 +68,9 @@ public infoMessage(){
|
||||
if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
|
||||
}
|
||||
|
||||
public setMessage(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,3))
|
||||
return PLUGIN_HANDLED
|
||||
public setMessage() {
|
||||
if (g_MessagesNum >= MAX_MESSAGES) {
|
||||
console_print(id,"Information Messages limit reached!")
|
||||
server_print("%L",LANG_SERVER,"INF_REACH")
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
remove_task(12345)
|
||||
|
@ -50,10 +50,13 @@ new g_lastMap[32]
|
||||
new g_coloredMenus
|
||||
new bool:g_selected = false
|
||||
|
||||
public plugin_init()
|
||||
{
|
||||
public plugin_init() {
|
||||
register_plugin("Nextmap Chooser",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_menucmd(register_menuid("AMX Choose nextmap:"),(-1^(-1<<(SELECTMAPS+2))),"countVote")
|
||||
register_dictionary("mapchooser.txt")
|
||||
register_dictionary("common.txt")
|
||||
new MenuName[64]
|
||||
format(MenuName,63,"%L","en","CHOOSE_NEXTM")
|
||||
register_menucmd(register_menuid(MenuName),(-1^(-1<<(SELECTMAPS+2))),"countVote")
|
||||
register_cvar("amx_extendmap_max","90")
|
||||
register_cvar("amx_extendmap_step","15")
|
||||
|
||||
@ -63,7 +66,7 @@ public plugin_init()
|
||||
get_localinfo("lastMap",g_lastMap,31)
|
||||
set_localinfo("lastMap","")
|
||||
|
||||
new maps_ini_file[64];
|
||||
new maps_ini_file[64]
|
||||
get_configsdir(maps_ini_file, 63);
|
||||
format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);
|
||||
if (!file_exists(maps_ini_file))
|
||||
@ -84,7 +87,7 @@ public checkVotes(){
|
||||
get_mapname(mapname,31)
|
||||
new Float:steptime = get_cvar_float("amx_extendmap_step")
|
||||
set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + steptime )
|
||||
client_print(0,print_chat,"Choosing finished. Current map will be extended to next %.0f minutes", steptime )
|
||||
client_print(0,print_chat,"%L", LANG_PLAYER, "CHO_FIN_EXT", steptime )
|
||||
log_amx("Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes",
|
||||
mapname , steptime )
|
||||
return
|
||||
@ -93,7 +96,7 @@ public checkVotes(){
|
||||
set_cvar_string("amx_nextmap", g_mapName[g_nextName[b]] )
|
||||
new smap[32]
|
||||
get_cvar_string("amx_nextmap",smap,31)
|
||||
client_print(0,print_chat,"Choosing finished. The nextmap will be %s", smap )
|
||||
client_print(0,print_chat,"%L", LANG_PLAYER, "CHO_FIN_NEXT", smap )
|
||||
log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
|
||||
}
|
||||
|
||||
@ -102,9 +105,9 @@ public countVote(id,key){
|
||||
new name[32]
|
||||
get_user_name(id,name,31)
|
||||
if ( key == SELECTMAPS )
|
||||
client_print(0,print_chat,"%s chose map extending", name )
|
||||
client_print(0,print_chat,"%L", LANG_PLAYER, "CHOSE_EXT", name )
|
||||
else if ( key < SELECTMAPS )
|
||||
client_print(0,print_chat,"%s chose %s", name, g_mapName[g_nextName[key]] )
|
||||
client_print(0,print_chat,"%L", LANG_PLAYER, "X_CHOSE_X", name, g_mapName[g_nextName[key]] )
|
||||
}
|
||||
++g_voteCount[key]
|
||||
return PLUGIN_HANDLED
|
||||
@ -144,7 +147,7 @@ public voteNextmap(){
|
||||
return
|
||||
g_selected = true
|
||||
new menu[512], a, mkeys = (1<<SELECTMAPS+1)
|
||||
new pos = copy(menu,511,g_coloredMenus ? "\yAMX Choose nextmap:\w^n^n" : "AMX Choose nextmap:^n^n")
|
||||
new pos = copy(menu,511,g_coloredMenus ? "\y%L:\w^n^n" : "%L:^n^n", LANG_SERVER, "CHOOSE_NEXTM")
|
||||
new dmax = (g_mapNums > SELECTMAPS) ? SELECTMAPS : g_mapNums
|
||||
for(g_mapVoteNum = 0;g_mapVoteNum<dmax;++g_mapVoteNum){
|
||||
a=random_num(0,g_mapNums-1)
|
||||
@ -162,20 +165,21 @@ public voteNextmap(){
|
||||
get_mapname(mapname,31)
|
||||
|
||||
if ( (winlimit + maxrounds)==0 && (get_cvar_float("mp_timelimit") < get_cvar_float("amx_extendmap_max"))) {
|
||||
pos += format(menu[pos],511,"%d. Extend map %s^n",SELECTMAPS+1,mapname)
|
||||
pos += format(menu[pos],511,"%d. %L^n",SELECTMAPS+1,LANG_SERVER,"EXTED_MAP",mapname)
|
||||
mkeys |= (1<<SELECTMAPS)
|
||||
}
|
||||
|
||||
format(menu[pos],511,"%d. None",SELECTMAPS+2)
|
||||
show_menu(0,mkeys,menu,15)
|
||||
format(menu[pos],511,"%d. %L",SELECTMAPS+2,LANG_SERVER,"NONE")
|
||||
new MenuName[64]
|
||||
format(MenuName,63,"%L","en","CHOOSE_NEXTM")
|
||||
show_menu(0,mkeys,menu,15,MenuName)
|
||||
set_task(15.0,"checkVotes")
|
||||
client_print(0,print_chat,"It's time to choose the nextmap...")
|
||||
client_print(0,print_chat,"%L",LANG_SERVER,"TIME_CHOOSE")
|
||||
client_cmd(0,"spk Gman/Gman_Choose2")
|
||||
log_amx("Vote: Voting for the nextmap started")
|
||||
}
|
||||
|
||||
loadSettings(filename[])
|
||||
{
|
||||
loadSettings(filename[]) {
|
||||
if (!file_exists(filename)) return 0
|
||||
|
||||
new szText[32]
|
||||
@ -183,8 +187,7 @@ loadSettings(filename[])
|
||||
new currentMap[32]
|
||||
get_mapname(currentMap,31)
|
||||
|
||||
while ( (g_mapNums < MAX_MAPS) && read_file(filename,pos++,szText,31,a) )
|
||||
{
|
||||
while ( (g_mapNums < MAX_MAPS) && read_file(filename,pos++,szText,31,a) ) {
|
||||
if ( szText[0] != ';'
|
||||
&& parse(szText, g_mapName[g_mapNums] ,31 )
|
||||
&& is_map_valid( g_mapName[g_mapNums] )
|
||||
|
@ -50,9 +50,10 @@ new g_coloredMenus
|
||||
|
||||
new g_choosed
|
||||
|
||||
public plugin_init()
|
||||
{
|
||||
public plugin_init() {
|
||||
register_plugin("Maps Menu",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("mapsmenu.txt")
|
||||
register_dictionary("common.txt")
|
||||
register_clcmd("amx_mapmenu","cmdMapsMenu",ADMIN_MAP,"- displays changelevel menu")
|
||||
register_clcmd("amx_votemapmenu","cmdVoteMapMenu",ADMIN_MAP,"- displays votemap menu")
|
||||
|
||||
@ -72,12 +73,9 @@ public plugin_init()
|
||||
g_coloredMenus = colored_menus()
|
||||
}
|
||||
|
||||
new g_resultAck[] = "Result accepted"
|
||||
new g_resultRef[] = "Result refused"
|
||||
|
||||
public autoRefuse() {
|
||||
log_amx("Vote: %s" , g_resultRef)
|
||||
client_print(0,print_chat, g_resultRef )
|
||||
log_amx("Vote: %L" , "en", "RESULT_REF")
|
||||
client_print(0,print_chat, "%L", LANG_PLAYER, "RESULT_REF")
|
||||
}
|
||||
|
||||
public actionResult(id,key) {
|
||||
@ -87,19 +85,15 @@ public actionResult(id,key) {
|
||||
message_begin(MSG_ALL, SVC_INTERMISSION)
|
||||
message_end()
|
||||
set_task(2.0,"delayedChange",0, g_mapName[ g_choosed ] , strlen(g_mapName[ g_choosed ]) + 1 )
|
||||
log_amx("Vote: %s" , g_resultAck )
|
||||
client_print(0,print_chat, g_resultAck)
|
||||
log_amx("Vote: %L" , "en", "RESULT_ACC")
|
||||
client_print(0,print_chat, "%L", LANG_PLAYER, "RESULT_ACC")
|
||||
}
|
||||
case 1: autoRefuse()
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
new g_voteSuccess[] = "Voting successful. Map will be changed to"
|
||||
new g_VoteFailed[] = "Voting failed"
|
||||
|
||||
public checkVotes( id )
|
||||
{
|
||||
public checkVotes( id ) {
|
||||
id -= 34567
|
||||
new num, ppl[32],a = 0
|
||||
get_players(ppl,num,"c")
|
||||
@ -110,16 +104,18 @@ public checkVotes( id )
|
||||
a = i
|
||||
if ( 100 * g_voteCount[a] / num > 50 ) {
|
||||
g_choosed = g_voteSelected[id][a]
|
||||
client_print(0,print_chat, "%s %s" , g_voteSuccess , g_mapName[ g_choosed ] )
|
||||
log_amx("Vote: %s %s" , g_voteSuccess , g_mapName[ g_choosed ] )
|
||||
client_print(0,print_chat, "%L %s", LANG_PLAYER, "VOTE_SUCCESS", g_mapName[ g_choosed ] )
|
||||
log_amx("Vote: %L %s", "en", "VOTE_SUCCESS", g_mapName[ g_choosed ] )
|
||||
}
|
||||
if ( g_choosed != -1 ) {
|
||||
if ( is_user_connected( id ) ) {
|
||||
new menuBody[512]
|
||||
new len = format(menuBody,511,g_coloredMenus ? "\yThe winner: \w%s^n^n" : "The winner: %s^n^n", g_mapName[ g_choosed ] )
|
||||
len += copy( menuBody[len] ,511 - len, g_coloredMenus ? "\yDo you want to continue?^n\w" : "Do you want to continue?^n" )
|
||||
copy( menuBody[len] ,511 - len, "^n1. Yes^n2. No")
|
||||
show_menu( id ,0x03 ,menuBody, 10 )
|
||||
new len = format(menuBody,511,g_coloredMenus ? "\y%L: \w%s^n^n" : "%L: %s^n^n", id, "THE_WINNER", g_mapName[ g_choosed ] )
|
||||
len += format( menuBody[len] ,511 - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", id, "WANT_CONT" )
|
||||
format( menuBody[len], 511-len, "^n1. %L^n2. %L",id,"YES",id,"NO")
|
||||
new menuName[64]
|
||||
format(menuName,63,"%L","en","THE_WINNER")
|
||||
show_menu( id, 0x03, menuBody, 10, menuName )
|
||||
set_task(10.0,"autoRefuse",4545454)
|
||||
}
|
||||
else {
|
||||
@ -129,16 +125,15 @@ public checkVotes( id )
|
||||
}
|
||||
}
|
||||
else {
|
||||
client_print(0,print_chat, g_VoteFailed )
|
||||
log_amx("Vote: %s" , g_VoteFailed)
|
||||
client_print(0,print_chat, "%L", LANG_PLAYER, "VOTE_FAILED" )
|
||||
log_amx("Vote: %L", "en", "VOTE_FAILED")
|
||||
}
|
||||
remove_task(34567 + id)
|
||||
}
|
||||
|
||||
public voteCount(id,key)
|
||||
{
|
||||
public voteCount(id,key) {
|
||||
if (key > 3) {
|
||||
client_print(0,print_chat,"Voting has been canceled")
|
||||
client_print(0,print_chat,"%L",LANG_PLAYER,"VOT_CANC")
|
||||
remove_task(34567 + id)
|
||||
set_cvar_float( "amx_last_voting" , get_gametime() )
|
||||
log_amx("Vote: Cancel vote session")
|
||||
@ -147,23 +142,20 @@ public voteCount(id,key)
|
||||
if (get_cvar_float("amx_vote_answers")) {
|
||||
new name[32]
|
||||
get_user_name(id,name,31)
|
||||
client_print(0,print_chat,"%s voted for option #%d", name , key + 1 )
|
||||
client_print(0,print_chat,"%L", LANG_PLAYER, "X_VOTED_FOR", name , key + 1 )
|
||||
}
|
||||
++g_voteCount[key]
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
isMapSelected( id , pos )
|
||||
{
|
||||
isMapSelected( id , pos ) {
|
||||
for ( new a = 0 ; a < g_voteSelectedNum[ id ]; ++a )
|
||||
if ( g_voteSelected[ id ][ a ] == pos )
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
displayVoteMapsMenu(id,pos)
|
||||
{
|
||||
|
||||
displayVoteMapsMenu(id,pos) {
|
||||
if (pos < 0)
|
||||
return
|
||||
|
||||
@ -173,102 +165,94 @@ displayVoteMapsMenu(id,pos)
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\yVotemap Menu\R%d/%d^n\w^n" : "Votemap Menu %d/%d^n^n",
|
||||
pos+1,( g_mapNums / 7 + (( g_mapNums % 7) ? 1 : 0 )) )
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id,"VOTEMAP_MENU",pos+1,( g_mapNums / 7 + (( g_mapNums % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7, keys = MENU_KEY_0
|
||||
|
||||
if (end > g_mapNums)
|
||||
end = g_mapNums
|
||||
|
||||
for(new a = start; a < end; ++a)
|
||||
{
|
||||
if ( g_voteSelectedNum[id]==4 || isMapSelected( id , pos * 7 + b ) )
|
||||
{
|
||||
for (new a = start; a < end; ++a) {
|
||||
if ( g_voteSelectedNum[id]==4 || isMapSelected( id , pos * 7 + b ) ) {
|
||||
++b
|
||||
if ( g_coloredMenus)
|
||||
len += format(menuBody[len],511-len,"\d%d. %s^n\w", b ,g_mapName[ a ])
|
||||
else
|
||||
len += format(menuBody[len],511-len,"#. %s^n", g_mapName[ a ])
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n", ++b ,g_mapName[ a ])
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_voteSelectedNum[id] )
|
||||
{
|
||||
if ( g_voteSelectedNum[id] ) {
|
||||
keys |= MENU_KEY_8
|
||||
len += format(menuBody[len],511-len,"^n8. Start Voting^n")
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n",id,"START_VOT")
|
||||
}
|
||||
else
|
||||
len += format(menuBody[len],511-len, g_coloredMenus ?
|
||||
"^n\d8. Start Voting^n\w" : "^n#. Start Voting^n")
|
||||
"^n\d8. %L^n\w" : "^n#. %L^n",id,"START_VOT")
|
||||
|
||||
if (end != g_mapNums)
|
||||
{
|
||||
len += format(menuBody[len],511-len,"^n9. More...^n0. %s^n", pos ? "Back" : "Exit")
|
||||
if (end != g_mapNums) {
|
||||
len += format(menuBody[len],511-len,"^n9. %L...^n0. %L^n", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else
|
||||
len += format(menuBody[len],511-len,"^n0. %s^n", pos ? "Back" : "Exit")
|
||||
len += format(menuBody[len],511-len,"^n0. %L^n", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
len += format(menuBody[len],511-len, g_voteSelectedNum[id] ?
|
||||
( g_coloredMenus ? "^n\ySelected Maps:^n\w" : "^nSelected Maps:^n") : "^n^n")
|
||||
if (g_voteSelectedNum[id])
|
||||
len += format(menuBody[len],511-len, g_coloredMenus ? "^n\y%L:^n\w" : "^n%L:^n",id,"SEL_MAPS")
|
||||
else
|
||||
len += format(menuBody[len],511-len, "^n^n")
|
||||
|
||||
for(new c = 0; c < 4; c++)
|
||||
{
|
||||
for (new c = 0; c < 4; c++) {
|
||||
if ( c < g_voteSelectedNum[id] )
|
||||
len += format(menuBody[len],511-len,"%s^n", g_mapName[ g_voteSelected[id][ c ] ] )
|
||||
else
|
||||
len += format(menuBody[len],511-len,"^n" )
|
||||
}
|
||||
|
||||
show_menu(id,keys,menuBody)
|
||||
new menuName[64]
|
||||
format(menuName,63,"%L","en","VOTEMAP_MENU")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,menuName)
|
||||
}
|
||||
|
||||
|
||||
public cmdVoteMapMenu(id,level,cid)
|
||||
{
|
||||
public cmdVoteMapMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1))
|
||||
return PLUGIN_HANDLED
|
||||
|
||||
if ( get_cvar_float("amx_last_voting") > get_gametime() )
|
||||
{
|
||||
client_print(id,print_chat,"There is already one voting...")
|
||||
if ( get_cvar_float("amx_last_voting") > get_gametime() ) {
|
||||
client_print(id,print_chat,"%L",id,"ALREADY_VOT")
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
g_voteSelectedNum[id] = 0
|
||||
|
||||
if ( g_mapNums )
|
||||
{
|
||||
if ( g_mapNums ) {
|
||||
displayVoteMapsMenu(id,g_menuPosition[id] = 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
console_print(id,"There are no maps in menu")
|
||||
client_print(id,print_chat,"There are no maps in menu")
|
||||
else {
|
||||
console_print(id,"%L",id,"NO_MAPS_MENU")
|
||||
client_print(id,print_chat,"%L",id,"NO_MAPS_MENU")
|
||||
}
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
public cmdMapsMenu(id,level,cid)
|
||||
{
|
||||
public cmdMapsMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1))
|
||||
return PLUGIN_HANDLED
|
||||
|
||||
if ( g_mapNums )
|
||||
{
|
||||
if ( g_mapNums ) {
|
||||
displayMapsMenu(id,g_menuPosition[id] = 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
console_print(id,"There are no maps in menu")
|
||||
client_print(id,print_chat,"There are no maps in menu")
|
||||
else {
|
||||
console_print(id,"%L",id,"NO_MAPS_MENU")
|
||||
client_print(id,print_chat,"%L",id,"NO_MAPS_MENU")
|
||||
}
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
@ -278,18 +262,16 @@ public delayedChange(mapname[])
|
||||
server_cmd("changelevel %s",mapname)
|
||||
|
||||
|
||||
public actionVoteMapMenu(id,key)
|
||||
{
|
||||
public actionVoteMapMenu(id,key) {
|
||||
switch (key) {
|
||||
case 7: {
|
||||
|
||||
new Float:voting = get_cvar_float("amx_last_voting")
|
||||
if ( voting > get_gametime() ) {
|
||||
client_print(id,print_chat,"There is already one voting...")
|
||||
client_print(id,print_chat,"%L",id,"ALREADY_VOT")
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {
|
||||
client_print(id,print_chat,"Voting not allowed at this time")
|
||||
client_print(id,print_chat,"%L",id,"VOT_NOW_ALLOW")
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
@ -307,40 +289,41 @@ public actionVoteMapMenu(id,key)
|
||||
|
||||
get_players(players,pnum)
|
||||
|
||||
if ( g_voteSelectedNum[id] > 1 )
|
||||
{
|
||||
if ( g_voteSelectedNum[id] > 1 ) {
|
||||
len = format(menuBody,511,g_coloredMenus ?
|
||||
"\yWhich map do you want?^n\w^n" : "Which map do you want?^n^n")
|
||||
for(new c = 0; c < g_voteSelectedNum[id] ; ++c)
|
||||
{
|
||||
"\y%L^n\w^n" : "%L^n^n", id, "WHICH_MAP")
|
||||
for (new c = 0; c < g_voteSelectedNum[id] ; ++c) {
|
||||
len += format(menuBody[len],511,"%d. %s^n", c + 1 , g_mapName[ g_voteSelected[id][ c ] ] )
|
||||
keys |= (1<<c)
|
||||
}
|
||||
keys |= (1<<8)
|
||||
len += format(menuBody[len],511,"^n9. None^n")
|
||||
}
|
||||
else
|
||||
{
|
||||
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 ] ] )
|
||||
else {
|
||||
len = format(menuBody,511, g_coloredMenus ? "\y%L^n%s?^n\w^n1. %L^n2. %L^n"
|
||||
: "%L^n%s?^n^n1. %L^n2. %L^n", id, "CHANGE_MAP_TO", g_mapName[ g_voteSelected[id][ 0 ] ],
|
||||
id, "YES", id, "NO")
|
||||
keys = MENU_KEY_1|MENU_KEY_2
|
||||
}
|
||||
|
||||
new menuName[64]
|
||||
format(menuName,63,"%L","en","WHICH_MAP")
|
||||
|
||||
for (new b = 0; b < pnum; ++b)
|
||||
if ( players[b] != id )
|
||||
show_menu(players[b],keys,menuBody, iVoteTime)
|
||||
show_menu(players[b],keys,menuBody, iVoteTime, menuName)
|
||||
|
||||
format(menuBody[len],511,"^n0. Cancel Vote")
|
||||
format(menuBody[len],511,"^n0. %L",id,"CANC_VOTE")
|
||||
keys |= MENU_KEY_0
|
||||
show_menu(id,keys,menuBody, iVoteTime)
|
||||
show_menu(id,keys,menuBody, iVoteTime, menuName)
|
||||
|
||||
new authid[32],name[32]
|
||||
get_user_authid(id,authid,31)
|
||||
get_user_name(id,name,31)
|
||||
|
||||
switch (get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"ADMIN %s: vote map(s)",name)
|
||||
case 1: client_print(0,print_chat,"ADMIN: vote map(s)")
|
||||
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_V_MAP_2",name)
|
||||
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_V_MAP_1")
|
||||
}
|
||||
|
||||
log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")",
|
||||
@ -352,8 +335,7 @@ public actionVoteMapMenu(id,key)
|
||||
}
|
||||
case 8: displayVoteMapsMenu(id,++g_menuPosition[id])
|
||||
case 9: displayVoteMapsMenu(id,--g_menuPosition[id])
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
g_voteSelected[id][ g_voteSelectedNum[id]++ ] = g_menuPosition[id] * 7 + key
|
||||
|
||||
displayVoteMapsMenu(id,g_menuPosition[id])
|
||||
@ -363,8 +345,7 @@ public actionVoteMapMenu(id,key)
|
||||
}
|
||||
|
||||
|
||||
public actionMapsMenu(id,key)
|
||||
{
|
||||
public actionMapsMenu(id,key) {
|
||||
switch (key) {
|
||||
case 8: displayMapsMenu(id,++g_menuPosition[id])
|
||||
case 9: displayMapsMenu(id,--g_menuPosition[id])
|
||||
@ -380,8 +361,8 @@ public actionMapsMenu(id,key)
|
||||
get_user_name(id,name,31)
|
||||
|
||||
switch (get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"ADMIN %s: changelevel %s",name,g_mapName[ a ])
|
||||
case 1: client_print(0,print_chat,"ADMIN: changelevel %s",g_mapName[ a ])
|
||||
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_CHANGEL_2",name,g_mapName[ a ])
|
||||
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_CHANGEL_2",g_mapName[ a ])
|
||||
}
|
||||
|
||||
log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"",
|
||||
@ -395,9 +376,7 @@ public actionMapsMenu(id,key)
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayMapsMenu(id,pos)
|
||||
{
|
||||
|
||||
displayMapsMenu(id,pos) {
|
||||
if (pos < 0)
|
||||
return
|
||||
|
||||
@ -409,8 +388,8 @@ displayMapsMenu(id,pos)
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\yChangelevel Menu\R%d/%d^n\w^n" : "Changelevel Menu %d/%d^n^n",
|
||||
pos+1,( g_mapNums / 8 + (( g_mapNums % 8) ? 1 : 0 )) )
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id,"CHANGLE_MENU",pos+1,( g_mapNums / 8 + (( g_mapNums % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
new keys = MENU_KEY_0
|
||||
@ -418,32 +397,31 @@ displayMapsMenu(id,pos)
|
||||
if (end > g_mapNums)
|
||||
end = g_mapNums
|
||||
|
||||
for(new a = start; a < end; ++a)
|
||||
{
|
||||
for (new a = start; a < end; ++a) {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n",++b,g_mapName[ a ])
|
||||
}
|
||||
|
||||
if (end != g_mapNums)
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
if (end != g_mapNums) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %s", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
else format(menuBody[len],511-len,"^n0. %s", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody)
|
||||
new menuName[64]
|
||||
format(menuName,63,"%L","en","CHANGLE_MENU")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,menuName)
|
||||
}
|
||||
|
||||
load_settings(filename[])
|
||||
{
|
||||
load_settings(filename[]) {
|
||||
if (!file_exists(filename))
|
||||
return 0
|
||||
|
||||
new text[256]
|
||||
new a , pos = 0
|
||||
|
||||
while ( g_mapNums < MAX_MAPS && read_file(filename,pos++,text,255,a) )
|
||||
{
|
||||
while ( g_mapNums < MAX_MAPS && read_file(filename,pos++,text,255,a) ) {
|
||||
if ( text[0] == ';' ) continue
|
||||
|
||||
if ( parse(text,g_mapName[g_mapNums],31) < 1 ) continue
|
||||
|
@ -37,33 +37,33 @@
|
||||
|
||||
new g_menuPosition[33]
|
||||
|
||||
#define MENUS_NUMBER 15
|
||||
#define MENUS_NUMBER 16
|
||||
|
||||
new g_menuBody[MENUS_NUMBER][] = {
|
||||
"Kick Player",
|
||||
"Ban Player",
|
||||
"Slap/Slay Player",
|
||||
"Team Player^n",
|
||||
"KICK_PLAYER",
|
||||
"BAN_PLAYER",
|
||||
"SLAP_SLAY",
|
||||
"TEAM_PLAYER",
|
||||
|
||||
"Changelevel",
|
||||
"Vote for maps^n",
|
||||
"CHANGEL",
|
||||
"VOTE_MAPS",
|
||||
|
||||
"Speech Stuff",
|
||||
"Client Commands",
|
||||
"SPECH_STUFF",
|
||||
"CLIENT_COM",
|
||||
|
||||
// Next Page
|
||||
|
||||
"Server Commands",
|
||||
"Cvars Settings",
|
||||
"Configuration",
|
||||
"Stats Settings^n",
|
||||
"SERVER_COM",
|
||||
"CVARS_SET",
|
||||
"CONFIG",
|
||||
"LANG_SET",
|
||||
"STATS_SET",
|
||||
|
||||
"Pause Plugins",
|
||||
"Restrict Weapons",
|
||||
|
||||
"Teleport Player" /* Last is Teleport menu - if you want to move
|
||||
it change also code in displayMenu (look for fun module check) */
|
||||
"PAUSE_PLUG",
|
||||
"RES_WEAP",
|
||||
|
||||
"TELE_PLAYER" /* Last is Teleport menu - if you want to move it
|
||||
change also code in displayMenu (look for fun module check) */
|
||||
}
|
||||
|
||||
new g_menuCmd[MENUS_NUMBER][] = {
|
||||
@ -83,6 +83,7 @@ new g_menuCmd[MENUS_NUMBER][] = {
|
||||
"amx_cmdmenu",
|
||||
"amx_cvarmenu",
|
||||
"amx_cfgmenu",
|
||||
"amx_setlangmenu",
|
||||
"amx_statscfgmenu",
|
||||
|
||||
"amx_pausecfgmenu",
|
||||
@ -109,6 +110,7 @@ new g_menuAccess[MENUS_NUMBER][2] = {
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_CVAR,0},
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_CFG,0},
|
||||
{ADMIN_CFG,1},
|
||||
|
||||
{ADMIN_CFG,0},
|
||||
@ -121,10 +123,12 @@ new g_coloredMenus
|
||||
new g_cstrikeRunning
|
||||
new g_funModule
|
||||
|
||||
public plugin_init()
|
||||
{
|
||||
public plugin_init() {
|
||||
register_plugin("Menus Front-End",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
|
||||
register_dictionary("menufront.txt")
|
||||
register_dictionary("common.txt")
|
||||
|
||||
register_menucmd(register_menuid("AMX Mod X Menu"),1023,"actionMenu")
|
||||
register_clcmd("amxmodmenu","cmdMenu",ADMIN_MENU,"- displays menus")
|
||||
|
||||
@ -133,8 +137,7 @@ public plugin_init()
|
||||
g_funModule = is_module_loaded("Fun")
|
||||
}
|
||||
|
||||
public actionMenu(id,key)
|
||||
{
|
||||
public actionMenu(id,key) {
|
||||
switch (key) {
|
||||
case 8: displayMenu(id,++g_menuPosition[id])
|
||||
case 9: displayMenu(id,--g_menuPosition[id])
|
||||
@ -144,7 +147,6 @@ public actionMenu(id,key)
|
||||
}
|
||||
|
||||
displayMenu(id,pos) {
|
||||
|
||||
if (pos < 0) return
|
||||
|
||||
new menuBody[512]
|
||||
@ -165,39 +167,34 @@ displayMenu(id,pos){
|
||||
|
||||
new flags = get_user_flags(id)
|
||||
|
||||
for(new a = start; a < end; ++a)
|
||||
{
|
||||
for (new a = start; a < end; ++a) {
|
||||
if ( a == MENUS_NUMBER - 1 && !g_funModule )
|
||||
continue // checks if there is fun module for teleport menu
|
||||
|
||||
if ( (flags & g_menuAccess[a][0]) && ( g_menuAccess[a][1] ? g_cstrikeRunning : 1 ) )
|
||||
{
|
||||
if ( (flags & g_menuAccess[a][0]) && ( g_menuAccess[a][1] ? g_cstrikeRunning : 1 ) ) {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n",++b, g_menuBody[ a ] )
|
||||
len += format(menuBody[len],511-len,"%d. %L^n",++b, id, g_menuBody[ a ] )
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len, "\d%d. %s^n\w",b, g_menuBody[ a ] )
|
||||
len += format(menuBody[len],511-len, "\d%d. %L^n\w",b, id, g_menuBody[ a ] )
|
||||
else
|
||||
len += format(menuBody[len],511-len, "#. %s^n",g_menuBody[ a ] )
|
||||
len += format(menuBody[len],511-len, "#. %L^n", id, g_menuBody[ a ] )
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (end != MENUS_NUMBER )
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
if (end != MENUS_NUMBER ) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %s", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
else format(menuBody[len],511-len,"^n0. %s", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody)
|
||||
}
|
||||
|
||||
public cmdMenu(id,level,cid)
|
||||
{
|
||||
public cmdMenu(id,level,cid) {
|
||||
if (cmd_access(id,level,cid,1))
|
||||
displayMenu(id,g_menuPosition[id] = 0)
|
||||
return PLUGIN_HANDLED
|
||||
|
@ -80,13 +80,13 @@ new g_friend[33]
|
||||
new g_firstBlood
|
||||
|
||||
new g_MultiKillMsg[7][] = {
|
||||
"Multi-Kill! %s^nwith %d kills (%d hs)",
|
||||
"Ultra-Kill!!! %s^nwith %d kills (%d hs)",
|
||||
"%s IS ON A KILLING SPREE!!!^nwith %d kills (%d hs)",
|
||||
"RAMPAGE!!! %s^nwith %d kills (%d hs)" ,
|
||||
"%s IS UNSTOPPABLE!!!^nwith %d kills (%d hs)" ,
|
||||
"%s IS A MONSTER!^nwith %d kills (%d hs)",
|
||||
"%s IS GODLIKE!!!!^nwith %d kills (%d hs)"
|
||||
"Multi-Kill! %s^n%L %d kills (%d hs)",
|
||||
"Ultra-Kill!!! %s^n%L %d kills (%d hs)",
|
||||
"%s IS ON A KILLING SPREE!!!^n%L %d kills (%d hs)",
|
||||
"RAMPAGE!!! %s^n%L %d kills (%d hs)" ,
|
||||
"%s IS UNSTOPPABLE!!!^n%L %d kills (%d hs)",
|
||||
"%s IS A MONSTER!^n%L %d kills (%d hs)",
|
||||
"%s IS GODLIKE!!!!^n%L %d kills (%d hs)"
|
||||
}
|
||||
new g_Sounds[7][] = {
|
||||
"multikill",
|
||||
@ -107,37 +107,37 @@ new g_KillingMsg[7][] = {
|
||||
"%s IS GODLIKE!!!"
|
||||
}
|
||||
new g_KinfeMsg[4][] = {
|
||||
"%s sliced and diced %s",
|
||||
"%s pulled out knife and gutted %s",
|
||||
"%s sneaks carefully behind and knifed %s",
|
||||
"%s knived %s"
|
||||
"KNIFE_MSG_1",
|
||||
"KNIFE_MSG_2",
|
||||
"KNIFE_MSG_3",
|
||||
"KNIFE_MSG_4"
|
||||
}
|
||||
new g_LastMessages[4][] = {
|
||||
"Now all depend on you!",
|
||||
"I hope you still have a healthpack.",
|
||||
"All your teammates were killed. Good luck!",
|
||||
"Now you are alone. Have fun!"
|
||||
"LAST_MSG_1",
|
||||
"LAST_MSG_2",
|
||||
"LAST_MSG_3",
|
||||
"LAST_MSG_4"
|
||||
}
|
||||
new g_HeMessages[4][] = {
|
||||
"%s sends a little gift to %s",
|
||||
"%s throws a small present to %s",
|
||||
"%s made a precision throw to %s",
|
||||
"%s got a big explosion for %s"
|
||||
"HE_MSG_1",
|
||||
"HE_MSG_2",
|
||||
"HE_MSG_3",
|
||||
"HE_MSG_4"
|
||||
}
|
||||
new g_SHeMessages[4][] = {
|
||||
"%s detonated himself with a grenade",
|
||||
"%s trys the effect of an HE Grenade",
|
||||
"%s swallows grenades whole!",
|
||||
"%s explodes!"
|
||||
"SHE_MSG_1",
|
||||
"SHE_MSG_2",
|
||||
"SHE_MSG_3",
|
||||
"SHE_MSG_4",
|
||||
}
|
||||
new g_HeadShots[7][] = {
|
||||
"$kn killed $vn with a well^nplaced shot to the head!",
|
||||
"$kn removed $vn's^nhead with the $wn",
|
||||
"$kn turned $vn's head^ninto pudding with the $wn",
|
||||
"$vn got pwned by $kn",
|
||||
"$vn's head has been^nturned into red jello",
|
||||
"$kn has superb aim with the $wn,^nas $vn well knows.",
|
||||
"$vn's head stayed in $kn's^ncrosshairs a bit too long..."
|
||||
"HS_MSG_1",
|
||||
"HS_MSG_2",
|
||||
"HS_MSG_3",
|
||||
"HS_MSG_4",
|
||||
"HS_MSG_5",
|
||||
"HS_MSG_6",
|
||||
"HS_MSG_7"
|
||||
}
|
||||
|
||||
new g_teamsNames[2][] = {
|
||||
@ -147,6 +147,7 @@ new g_teamsNames[2][] = {
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("CS Misc. Stats",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("miscstats.txt")
|
||||
register_event("DeathMsg","eDeathMsg","a")
|
||||
register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w")
|
||||
register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
|
||||
@ -289,9 +290,9 @@ public eDeathMsg(){
|
||||
new name[32]
|
||||
get_user_name(g_LastAnnounce,name,31)
|
||||
set_hudmessage(0, 255, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3)
|
||||
show_hudmessage(0,"%s (%d HP) vs. %d %s%s: %s",name,
|
||||
show_hudmessage(0,"%s (%d HP) vs. %d %s%s: %L",name,
|
||||
get_user_health(g_LastAnnounce),oposite,
|
||||
g_teamsNames[team],(oposite==1)?"":"S" ,g_LastMessages[ random_num(0,3) ] )
|
||||
g_teamsNames[team],(oposite==1)?"":"S",LANG_PLAYER,g_LastMessages[ random_num(0,3) ] )
|
||||
client_cmd(g_LastAnnounce,"spk misc/oneandonly")
|
||||
}
|
||||
}
|
||||
@ -304,7 +305,7 @@ public eDeathMsg(){
|
||||
get_user_name(killerId,killer,31)
|
||||
get_user_name(victimId,victim,31)
|
||||
set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0,g_KinfeMsg[ random_num(0,3) ],killer,victim)
|
||||
show_hudmessage(0,"%L",LANG_PLAYER,g_KinfeMsg[ random_num(0,3) ],killer,victim)
|
||||
}
|
||||
if ( KnifeKillSound ) client_cmd(0,"spk misc/humiliation")
|
||||
}
|
||||
@ -314,22 +315,25 @@ public eDeathMsg(){
|
||||
get_user_name(victimId,victim,32)
|
||||
set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
if ( killerId != victimId ) {
|
||||
if ( GrenadeKill ) show_hudmessage(0,g_HeMessages[ random_num(0,3)],killer,victim)
|
||||
if ( GrenadeKill ) show_hudmessage(0,"%L",LANG_PLAYER,g_HeMessages[ random_num(0,3)],killer,victim)
|
||||
}
|
||||
else if ( GrenadeSuicide ) show_hudmessage(0,g_SHeMessages[ random_num(0,3) ],victim)
|
||||
else if ( GrenadeSuicide ) show_hudmessage(0,"%L",LANG_PLAYER,g_SHeMessages[ random_num(0,3) ],victim)
|
||||
}
|
||||
if ( headshot && (HeadShotKill || HeadShotKillSound) ) {
|
||||
if ( HeadShotKill ) {
|
||||
new killer[32], victim[32], weapon[32], message[128]
|
||||
new killer[32], victim[32], weapon[32], message[128], players[32], pnum
|
||||
get_user_name(killerId,killer,31)
|
||||
get_user_name(victimId,victim,31)
|
||||
read_data( 4 , weapon , 31 )
|
||||
copy( message, 127, g_HeadShots[ random_num(0,6) ] )
|
||||
get_players(players,pnum,"c")
|
||||
for (new i=0;i<pnum;i++) {
|
||||
fromat( message, 127, "%L",players[i],g_HeadShots[ random_num(0,6) ] )
|
||||
replace( message, 127 , "$vn", victim )
|
||||
replace( message, 127 , "$wn", weapon )
|
||||
replace( message, 127 , "$kn", killer )
|
||||
set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0,message )
|
||||
show_hudmessage(players[i],message )
|
||||
}
|
||||
}
|
||||
if ( HeadShotKillSound ) {
|
||||
client_cmd(killerId,"spk misc/headshot")
|
||||
@ -343,7 +347,7 @@ public eDeathMsg(){
|
||||
new name[32]
|
||||
get_user_name( killerId , name , 31 )
|
||||
set_hudmessage(255, 0, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3)
|
||||
show_hudmessage(0,"Wow! %s made a double kill!!!" ,name )
|
||||
show_hudmessage(0,"%L",LANG_PLAYER,"DOUBLE_KILL",name )
|
||||
}
|
||||
if ( DoubleKillSound ) client_cmd(0,"spk misc/doublekill")
|
||||
}
|
||||
@ -352,16 +356,17 @@ public eDeathMsg(){
|
||||
}
|
||||
}
|
||||
|
||||
public hideStatus(id)
|
||||
public hideStatus(id) {
|
||||
if ( PlayerName ) {
|
||||
set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4)
|
||||
show_hudmessage(id,"")
|
||||
}
|
||||
}
|
||||
|
||||
public setTeam(id)
|
||||
g_friend[id] = read_data(2)
|
||||
|
||||
public showStatus(id)
|
||||
public showStatus(id) {
|
||||
if ( PlayerName ) {
|
||||
new name[32],pid = read_data(2)
|
||||
get_user_name(pid,name,31)
|
||||
@ -383,6 +388,7 @@ public showStatus(id)
|
||||
show_hudmessage(id,name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public eNewRound()
|
||||
if ( read_data(1) == floatround(get_cvar_float("mp_roundtime") * 60.0) ) {
|
||||
@ -391,7 +397,7 @@ public eNewRound()
|
||||
++g_roundCount
|
||||
if ( RoundCounter ) {
|
||||
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0, "Prepare to FIGHT!^nRound %d" , g_roundCount )
|
||||
show_hudmessage(0, "%L", LANG_PLAYER, "PREPARE_FIGHT", g_roundCount )
|
||||
}
|
||||
if ( RoundCounterSound ) client_cmd( 0 , "spk misc/prepare" )
|
||||
if ( KillingStreak ) {
|
||||
@ -400,9 +406,9 @@ public eNewRound()
|
||||
for (new a = 0; a < ppl; ++a) {
|
||||
i = appl[ a ]
|
||||
if ( g_streakKills[ i ][ 0 ] >= 2 )
|
||||
client_print( i , print_chat , "* You've killed %d in a row so far", g_streakKills[ i ][ 0 ] )
|
||||
client_print( i , print_chat , "* %L", i, "KILLED_ROW", g_streakKills[ i ][ 0 ] )
|
||||
else if ( g_streakKills[ i ][ 1 ] >= 2 )
|
||||
client_print( i , print_chat , "* Careful! You've died %d rounds in a row now...", g_streakKills[ i ][ 1 ] )
|
||||
client_print( i , print_chat , "* %L", i, "DIED_ROUNDS", g_streakKills[ i ][ 1 ] )
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -433,7 +439,7 @@ public checkKills(param[]){
|
||||
get_user_name(id,name,31)
|
||||
set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)
|
||||
if ( a > 6 ) a = 6
|
||||
show_hudmessage(0,g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1])
|
||||
show_hudmessage(0,g_MultiKillMsg[a],name,LANG_PLAYER,"WITH",g_multiKills[id][0],g_multiKills[id][1])
|
||||
}
|
||||
if ( MultiKillSound ) client_cmd(0,"spk misc/%s",g_Sounds[a])
|
||||
}
|
||||
@ -442,16 +448,17 @@ public checkKills(param[]){
|
||||
}
|
||||
|
||||
public chickenKill()
|
||||
if ( ItalyBonusKill ) announceEvent( 0 , "Somebody killed a chicken!!!" )
|
||||
if ( ItalyBonusKill ) announceEvent( 0 , "KILLED_CHICKEN" )
|
||||
|
||||
public radioKill()
|
||||
if ( ItalyBonusKill ) announceEvent( 0 , "Somebody blew up the radio!!!" )
|
||||
public radioKill() {
|
||||
if ( ItalyBonusKill ) announceEvent( 0 , "BLEW_RADIO" )
|
||||
}
|
||||
|
||||
announceEvent( id, message[] ) {
|
||||
new name[32]
|
||||
get_user_name(id, name , 31)
|
||||
set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0,message,name)
|
||||
show_hudmessage(0,"%L",LANG_PLAYER,message,name)
|
||||
}
|
||||
|
||||
public eGotBomb(id) {
|
||||
@ -459,7 +466,7 @@ public eGotBomb(id){
|
||||
g_Defuser = g_Defusing = 0
|
||||
if ( BombReached && read_data(1)==2 && g_LastOmg<get_gametime()) {
|
||||
g_LastOmg = get_gametime() + 15.0
|
||||
announceEvent(g_Planter , "Omg! %s reached the target!" )
|
||||
announceEvent(g_Planter, "REACHED_TARGET" )
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,14 +474,14 @@ public eBombDefG(id){
|
||||
if (read_data(1) == 3) {
|
||||
if ( BombPlanting && g_LastPlan<get_gametime() ) {
|
||||
g_LastPlan = get_gametime() + 15.0
|
||||
announceEvent(g_Planter , "%s is planting the bomb!" )
|
||||
announceEvent(g_Planter, "PLANT_BOMB" )
|
||||
}
|
||||
}
|
||||
else {
|
||||
g_Defuser = g_Defusing = id
|
||||
if ( BombDefusing && g_LastPlan<get_gametime()) {
|
||||
g_LastPlan = get_gametime() + 15.0
|
||||
announceEvent(g_Defusing , "%s is defusing the bomb..." )
|
||||
announceEvent(g_Defusing, "DEFUSING_BOMB" )
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -484,7 +491,7 @@ public eBombDefL(id)
|
||||
|
||||
public eBombPlanted()
|
||||
if ( g_C4Timer != -2 ) {
|
||||
if (BombPlanted) announceEvent(g_Planter , "%s set us up the bomb!!!" )
|
||||
if (BombPlanted) announceEvent(g_Planter, "SET_UP_BOMB" )
|
||||
g_C4Timer = get_cvar_num("mp_c4timer") - 2
|
||||
set_task(1.0,"bombTimer",8038,"",0,"b")
|
||||
g_LastPlan = 0.0
|
||||
@ -510,13 +517,13 @@ public bombTimer(){
|
||||
}
|
||||
|
||||
public eBombDef()
|
||||
if (BombDefused) announceEvent(g_Defuser , "%s defused the bomb!" )
|
||||
if (BombDefused) announceEvent(g_Defuser, "DEFUSED_BOMB" )
|
||||
|
||||
public eBombFail()
|
||||
if (BombFailed && g_Defuser ) announceEvent(g_Defuser , "%s failed to defuse the bomb..." )
|
||||
if (BombFailed && g_Defuser ) announceEvent(g_Defuser , "FAILED_DEFU" )
|
||||
|
||||
public eBombPickUp(id)
|
||||
if (BombPickUp) announceEvent(id , "%s pick up the bomb...")
|
||||
if (BombPickUp) announceEvent(id , "PICKED_BOMB")
|
||||
|
||||
public eBombDrop()
|
||||
if (BombDrop) announceEvent(g_Planter , "%s dropped the bomb!!!")
|
||||
if (BombDrop) announceEvent(g_Planter , "DROPPED_BOMB")
|
@ -43,9 +43,9 @@ new g_nextMap[32]
|
||||
new g_mapCycle[32]
|
||||
new g_pos
|
||||
|
||||
public plugin_init()
|
||||
{
|
||||
public plugin_init() {
|
||||
register_plugin("NextMap",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("nextmap.txt")
|
||||
register_event("30","changeMap","a")
|
||||
register_clcmd("say nextmap","sayNextMap",0,"- displays nextmap")
|
||||
register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
|
||||
@ -111,7 +111,7 @@ readMapCycle(szFileName[], szNext[], iNext ){
|
||||
}
|
||||
}
|
||||
if ( !iMaps ) {
|
||||
log_message( g_warning , szFileName )
|
||||
log_amx( g_warning , szFileName )
|
||||
get_mapname( szFirst , 31 )
|
||||
}
|
||||
copy( szNext , iNext , szFirst )
|
||||
@ -120,8 +120,7 @@ readMapCycle(szFileName[], szNext[], iNext ){
|
||||
|
||||
#else
|
||||
|
||||
readMapCycle(szFileName[], szNext[], iNext )
|
||||
{
|
||||
readMapCycle(szFileName[], szNext[], iNext ) {
|
||||
new b, i = 0, iMaps = 0
|
||||
new szBuffer[32], szFirst[32], szCurrent[32]
|
||||
get_mapname( szCurrent , 31 )
|
||||
@ -151,7 +150,7 @@ readMapCycle(szFileName[], szNext[], iNext )
|
||||
}
|
||||
}
|
||||
if ( !iMaps ) {
|
||||
log_message( g_warning , szFileName )
|
||||
log_amx( g_warning , szFileName )
|
||||
copy( szNext ,iNext , szCurrent )
|
||||
}
|
||||
else copy( szNext ,iNext , szFirst )
|
||||
|
@ -46,14 +46,15 @@ new g_menuPos[33]
|
||||
new g_fileToSave[64]
|
||||
new g_coloredMenus
|
||||
new g_Modified
|
||||
new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^""
|
||||
new g_pluginMatch[] = "Plugin matching ^"%s^" %s"
|
||||
new g_pluginMatch[] = ""
|
||||
new g_addCmd[] = "amx_pausecfg add ^"%s^""
|
||||
new g_system[MAX_SYSTEM]
|
||||
new g_systemNum
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("Pause Plugins",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("pausecfg.txt")
|
||||
register_dictionary("common.txt")
|
||||
register_concmd("amx_pausecfg","cmdPlugin",ADMIN_CFG,"- list commands for pause/unpause managment")
|
||||
register_clcmd("amx_pausecfgmenu","cmdMenu",ADMIN_CFG,"- pause/unpause plugins with menu")
|
||||
#if defined DIRECT_ONOFF
|
||||
@ -101,7 +102,7 @@ public plugin_cfg() {
|
||||
server_cmd(g_addCmd, "Commands Menu" )
|
||||
server_cmd(g_addCmd, "Maps Menu" )
|
||||
server_cmd(g_addCmd, "Menus Front-End" )
|
||||
server_cmd(g_addCmd, "Admin Base for MySQL" )
|
||||
server_cmd(g_addCmd, "Admin Base (SQL)" )
|
||||
server_cmd(g_addCmd, "Players Menu" )
|
||||
server_cmd(g_addCmd, "Teleport Menu" )
|
||||
}
|
||||
@ -111,19 +112,19 @@ public actionMenu(id,key) {
|
||||
case 6: {
|
||||
if (file_exists(g_fileToSave)){
|
||||
delete_file(g_fileToSave)
|
||||
client_print(id,print_chat,"* Configuration file cleared. Reload the map if needed")
|
||||
client_print(id,print_chat,"* %L",id,"CONF_CLEARED")
|
||||
}
|
||||
else
|
||||
client_print(id,print_chat,"* Configuration was already cleared!")
|
||||
client_print(id,print_chat,"* %L",id,"ALR_CLEARED")
|
||||
displayMenu(id,g_menuPos[id])
|
||||
}
|
||||
case 7: {
|
||||
if (saveSettings(g_fileToSave)){
|
||||
g_Modified = 0
|
||||
client_print(id,print_chat,"* Configuration saved successfully")
|
||||
client_print(id,print_chat,"* %L",id,"CONF_SAVED")
|
||||
}
|
||||
else
|
||||
client_print(id,print_chat,"* Configuration saving failed!!!")
|
||||
client_print(id,print_chat,"* %L",id,"SAVE_FAILED")
|
||||
displayMenu(id,g_menuPos[id])
|
||||
}
|
||||
case 8: displayMenu(id,++g_menuPos[id])
|
||||
@ -149,13 +150,13 @@ public actionMenu(id,key) {
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
getStatus( code, arg[], iarg ) {
|
||||
getStatus( id, code, arg[], iarg ) {
|
||||
switch (code) {
|
||||
case 'r': copy( arg, iarg , "ON" )
|
||||
case 's': copy( arg, iarg , "STOPPED" )
|
||||
case 'p': copy( arg, iarg , "OFF" )
|
||||
case 'b': copy( arg, iarg , "ERROR" )
|
||||
default: copy( arg, iarg , "LOCKED" )
|
||||
case 'r': format( arg, iarg, "%L", id, "ON" )
|
||||
case 's': format( arg, iarg, "%L", id, "STOPPED" )
|
||||
case 'p': format( arg, iarg, "%L", id, "OFF" )
|
||||
case 'b': format( arg, iarg, "%L", id, "ERROR" )
|
||||
default: format( arg, iarg, "%L", id, "LOCKED" )
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,13 +174,13 @@ displayMenu(id, pos) {
|
||||
new menu_body[512], start = pos * 6, k = 0
|
||||
if (start >= datanum) start = pos = g_menuPos[id] = 0
|
||||
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)))
|
||||
g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n" ,
|
||||
id,"PAUSE_UNPAUSE"pos + 1,((datanum/6)+((datanum%6)?1:0)))
|
||||
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)
|
||||
getStatus( status[0] , status , 7 )
|
||||
getStatus( id, status[0] , status , 7 )
|
||||
if ( isSystem( a ) || (status[0]!='O'&&status[0]!='S')) {
|
||||
if ( g_coloredMenus ) {
|
||||
len += format(menu_body[len],511-len, "\d%d. %s\R%s^n\w",++k, title, status )
|
||||
@ -194,15 +195,15 @@ displayMenu(id, pos) {
|
||||
len += format(menu_body[len],511-len,g_coloredMenus ? "%d. %s\y\R%s^n\w" : "%d. %s %s^n",++k,title, status )
|
||||
}
|
||||
}
|
||||
len += format(menu_body[len],511-len,"^n7. Clear file with stopped^n")
|
||||
len += format(menu_body[len],511-len,g_coloredMenus ? "8. Save stopped \y\R%s^n\w"
|
||||
: "8. Save stopped %s^n" ,g_Modified ? "*" : "")
|
||||
len += format(menu_body[len],511-len,"^n7. %L^n",id,"CLEAR_STOPPED")
|
||||
len += format(menu_body[len],511-len,g_coloredMenus ? "8. %L \y\R%s^n\w"
|
||||
: "8. %L %s^n", id, "SAVE_STOPPED", g_Modified ? "*" : "")
|
||||
if (end != datanum){
|
||||
format(menu_body[len],511-len,"^n9. More...^n0. %s", pos ? "Back" : "Exit")
|
||||
format(menu_body[len],511-len,"^n9. %L...^n0. %s", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menu_body[len],511-len,"^n0. %s", pos ? "Back" : "Exit")
|
||||
show_menu(id,keys,menu_body)
|
||||
else format(menu_body[len],511-len,"^n0. %s", id, pos ? "BACK" : "EXIT")
|
||||
show_menu(id,keys,menu_body,-1,"Pause/Unpause Plugins")
|
||||
}
|
||||
|
||||
public cmdMenu(id,level,cid) {
|
||||
@ -221,7 +222,7 @@ pausePlugins(id){
|
||||
++count
|
||||
}
|
||||
}
|
||||
console_print(id,"Paused %d plugin%s",count,(count==1)?"":"s")
|
||||
console_print(id,"%L",id,(count==1)?"PAUSED_PLUGIN":"PAUSED_PLUGINS",count)
|
||||
}
|
||||
|
||||
unpausePlugins(id) {
|
||||
@ -234,7 +235,7 @@ unpausePlugins(id){
|
||||
++count
|
||||
}
|
||||
}
|
||||
console_print(id,"Unpaused %d plugin%s",count,(count==1)?"":"s")
|
||||
console_print(id,"%L",id,(count==1)?"UNPAUSED_PLUGIN":"UNPAUSED_PLUGINS",count)
|
||||
}
|
||||
|
||||
findPluginByFile(arg[32],&len) {
|
||||
@ -273,7 +274,7 @@ public cmdPlugin(id,level,cid){
|
||||
if ( g_systemNum < MAX_SYSTEM )
|
||||
g_systemNum++
|
||||
else
|
||||
console_print( id , "Can't mark more plugins as unpauseable!" )
|
||||
console_print( id, "%L", id, "CANT_MARK_MORE" )
|
||||
}
|
||||
}
|
||||
else if ( equal(cmds, "off" ) ) {
|
||||
@ -285,47 +286,53 @@ public cmdPlugin(id,level,cid){
|
||||
else if ( equal(cmds, "save" ) ) {
|
||||
if (saveSettings(g_fileToSave)) {
|
||||
g_Modified = 0
|
||||
console_print(id,"Configuration saved successfully")
|
||||
console_print(id,"%L",id,"CONF_SAVED")
|
||||
}
|
||||
else
|
||||
console_print(id,"Configuration saving failed!!!")
|
||||
console_print(id,"%L",id,"SAVE_FAILED")
|
||||
}
|
||||
else if ( equal(cmds, "clear" ) ) {
|
||||
if (file_exists(g_fileToSave)){
|
||||
delete_file(g_fileToSave)
|
||||
console_print(id,"Configuration file cleared. Reload the map if needed")
|
||||
console_print(id,"%L",id,"CONF_CLEARED")
|
||||
}
|
||||
else
|
||||
console_print(id,"Configuration was already cleared!")
|
||||
console_print(id,"%L",id,"ALR_CLEARED")
|
||||
}
|
||||
else if ( equal(cmds, "pause" ) ) {
|
||||
new arg[32], a ,len = read_argv(2,arg,31)
|
||||
if ( len && ((a = findPluginByFile(arg,len)) != -1) && !isSystem( a ) && pause("ac",arg) )
|
||||
console_print(id,g_pluginMatch,arg , "paused")
|
||||
else console_print(id,g_couldntFind,arg)
|
||||
console_print(id,"%L",id,"PLUGIN_MATCH",arg,id,"PAUSED")
|
||||
else console_print(id,"%L",id,"COULDNT_FIND",arg)
|
||||
}
|
||||
else if ( equal(cmds, "enable" ) ) {
|
||||
new arg[32], a , len = read_argv(2,arg,31)
|
||||
if ( len && (a = findPluginByFile(arg,len)) != -1 && !isSystem( a ) && unpause("ac",arg) )
|
||||
console_print(id,g_pluginMatch,arg , "unpaused")
|
||||
else console_print(id,g_couldntFind,arg)
|
||||
console_print(id,"%L",id,"PLUGIN_MATCH",arg,id,"UNPAUSED")
|
||||
else console_print(id,"%L",id,"COULDNT_FIND",arg)
|
||||
}
|
||||
else if ( equal(cmds, "stop" ) ) {
|
||||
new arg[32], a, len = read_argv(2,arg,31)
|
||||
if ( len && (a = findPluginByFile(arg,len)) != -1 && !isSystem( a ) && pause("dc",arg)){
|
||||
g_Modified = 1
|
||||
console_print(id,g_pluginMatch,arg , "stopped")
|
||||
console_print(id,"%L",id,"PLUGIN_MATCH",arg,id,"STOPPED")
|
||||
}
|
||||
else console_print(id,g_couldntFind,arg)
|
||||
else console_print(id,"%L",id,"COULDNT_FIND",arg)
|
||||
}
|
||||
else if ( equal(cmds, "list" ) ) {
|
||||
new lName[32],lVersion[32],lAuthor[32],lFile[32],lStatus[32]
|
||||
format(lName,31,"%L",id,"NAME")
|
||||
format(lVersion,31,"%L",id,"VERSION")
|
||||
format(lAuthor,31,"%L",id,"AUTHOR")
|
||||
format(lFile,31,"%L",id,"FILE")
|
||||
format(lStatus,31,"%L",id,"STATUS")
|
||||
new arg1[8], running = 0
|
||||
new start = read_argv(2,arg1,7) ? str_to_num(arg1) : 1
|
||||
if (--start < 0) start = 0
|
||||
new plgnum = get_pluginsnum()
|
||||
if (start >= plgnum) start = plgnum - 1
|
||||
console_print(id,"^n----- Pause Plugins: Loaded plugins -----")
|
||||
console_print(id, " %-18.17s %-8.7s %-17.16s %-16.15s %-9.8s","name","version","author","file","status")
|
||||
console_print(id,"^n----- %L -----",id,"PAUSE_LOADED")
|
||||
console_print(id, " %-18.17s %-8.7s %-17.16s %-16.15s %-9.8s",lName,lVersion,lAuthor,lFile,lStatus)
|
||||
new plugin[32],title[32],version[16],author[32],status[16]
|
||||
new end = start + 10
|
||||
if (end > plgnum) end = plgnum
|
||||
@ -333,26 +340,25 @@ public cmdPlugin(id,level,cid){
|
||||
get_plugin(a,plugin,31,title,31,version,15,author,31,status,15)
|
||||
if (status[0] == 'r') ++running
|
||||
console_print(id, " [%3d] %-18.17s %-8.7s %-17.16s %-16.15s %-9.8s",a+1,title,version,author,plugin, status )
|
||||
|
||||
}
|
||||
console_print(id,"----- Entries %d - %d of %d (%d running) -----",start+1,end,plgnum,running)
|
||||
console_print(id,"----- %L -----",id,"ENTRIES",start+1,end,plgnum,running)
|
||||
if (end < plgnum)
|
||||
console_print(id,"----- Use 'amx_pausecfg list %d' for more -----",end+1)
|
||||
console_print(id,"----- %L -----",id,"USE_MORE",end+1)
|
||||
else
|
||||
console_print(id,"----- Use 'amx_pausecfg list 1' for begin -----")
|
||||
console_print(id,"----- %L -----",id,"USE_BEGIN")
|
||||
}
|
||||
else {
|
||||
console_print(id,"Usage: amx_pausecfg <command> [name]")
|
||||
console_print(id,"Commands:")
|
||||
console_print(id,"^toff - pauses all plugins not in the list")
|
||||
console_print(id,"^ton - unpauses all plugins")
|
||||
console_print(id,"^tstop <file> - stops a plugin")
|
||||
console_print(id,"^tpause <file> - pauses a plugin")
|
||||
console_print(id,"^tenable <file> - enables a plugin")
|
||||
console_print(id,"^tsave - saves a list of stopped plugins")
|
||||
console_print(id,"^tclear - clears a list of stopped plugins")
|
||||
console_print(id,"^tlist [id] - lists plugins")
|
||||
console_print(id,"^tadd <title> - marks a plugin as unpauseable")
|
||||
console_print(id,"%L",id,"USAGE")
|
||||
console_print(id,"%L:",id,"COMMANDS")
|
||||
console_print(id,"%L",id,"COM_TOFF")
|
||||
console_print(id,"%L",id,"COM_TON")
|
||||
console_print(id,"%L",id,"COM_TSTOP")
|
||||
console_print(id,"%L",id,"COM_TPAUSE")
|
||||
console_print(id,"%L",id,"COM_TENABLE")
|
||||
console_print(id,"%L",id,"COM_TSAVE")
|
||||
console_print(id,"%L",id,"COM_TCLEAR")
|
||||
console_print(id,"%L",id,"COM_TLIST")
|
||||
console_print(id,"%L",id,"COM_TADD")
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user