many more fixes
This commit is contained in:
@ -87,23 +87,12 @@ public cmdON(id,level,cid) {
|
||||
public plugin_cfg() {
|
||||
loadSettings(g_fileToSave)
|
||||
// Put here titles of plugins which you don't want to pause
|
||||
server_cmd(g_addCmd, "Pause Plugins" )
|
||||
server_cmd(g_addCmd, "Admin Commands" )
|
||||
server_cmd(g_addCmd, "TimeLeft" )
|
||||
server_cmd(g_addCmd, "Slots Reservation" )
|
||||
server_cmd(g_addCmd, "Admin Chat" )
|
||||
server_cmd(g_addCmd, "NextMap" )
|
||||
server_cmd(g_addCmd, "Admin Help" )
|
||||
server_cmd(g_addCmd, "Admin Base" )
|
||||
server_cmd(g_addCmd, "Admin Votes" )
|
||||
server_cmd(g_addCmd, "Welcome Message" )
|
||||
server_cmd(g_addCmd, "Stats Configuration" )
|
||||
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 (SQL)" )
|
||||
server_cmd(g_addCmd, "Players Menu" )
|
||||
server_cmd(g_addCmd, "Teleport Menu" )
|
||||
server_cmd(g_addCmd, "Pause Plugins" )
|
||||
server_cmd(g_addCmd, "TimeLeft" )
|
||||
server_cmd(g_addCmd, "NextMap" )
|
||||
server_cmd(g_addCmd, "Slots Reservation" )
|
||||
}
|
||||
|
||||
public actionMenu(id,key) {
|
||||
@ -111,19 +100,19 @@ public actionMenu(id,key) {
|
||||
case 6: {
|
||||
if (file_exists(g_fileToSave)){
|
||||
delete_file(g_fileToSave)
|
||||
client_print(id,print_chat,"* %L",id,"CONF_CLEARED")
|
||||
client_print(id,print_chat,"* %L",id,"PAUSE_CONF_CLEARED")
|
||||
}
|
||||
else
|
||||
client_print(id,print_chat,"* %L",id,"ALR_CLEARED")
|
||||
client_print(id,print_chat,"* %L",id,"PAUSE_ALR_CLEARED")
|
||||
displayMenu(id,g_menuPos[id])
|
||||
}
|
||||
case 7: {
|
||||
if (saveSettings(g_fileToSave)){
|
||||
g_Modified = 0
|
||||
client_print(id,print_chat,"* %L",id,"CONF_SAVED")
|
||||
client_print(id,print_chat,"* %L",id,"PAUSE_CONF_SAVED")
|
||||
}
|
||||
else
|
||||
client_print(id,print_chat,"* %L",id,"SAVE_FAILED")
|
||||
client_print(id,print_chat,"* %L",id,"PAUSE_SAVE_FAILED")
|
||||
displayMenu(id,g_menuPos[id])
|
||||
}
|
||||
case 8: displayMenu(id,++g_menuPos[id])
|
||||
@ -149,13 +138,28 @@ public actionMenu(id,key) {
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
getStatus( id, code, arg[], iarg ) {
|
||||
getStatus( id, code, &statusCode, lStatus[], lLen ) {
|
||||
switch (code) {
|
||||
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" )
|
||||
case 'r': {
|
||||
statusCode = 'O'
|
||||
format( lStatus, lLen, "%L", id, "ON" )
|
||||
}
|
||||
case 's': {
|
||||
statusCode = 'S'
|
||||
format( lStatus, lLen, "%L", id, "STOPPED" )
|
||||
}
|
||||
case 'p': {
|
||||
statusCode = 'O'
|
||||
format( lStatus, lLen, "%L", id, "OFF" )
|
||||
}
|
||||
case 'b': {
|
||||
statusCode = 'E'
|
||||
format( lStatus, lLen, "%L", id, "ERROR" )
|
||||
}
|
||||
default: {
|
||||
statusCode = 'L'
|
||||
format( lStatus, lLen, "%L", id, "LOCKED" )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,7 +172,7 @@ isSystem( id ) {
|
||||
|
||||
displayMenu(id, pos) {
|
||||
if (pos < 0) return
|
||||
new filename[32],title[32],status[8]
|
||||
new filename[32],title[32],status[8],statusCode
|
||||
new datanum = get_pluginsnum()
|
||||
new menu_body[512], start = pos * 6, k = 0
|
||||
if (start >= datanum) start = pos = g_menuPos[id] = 0
|
||||
@ -179,8 +183,8 @@ displayMenu(id, pos) {
|
||||
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( id, status[0] , status , 7 )
|
||||
if ( isSystem( a ) || (status[0]!='O'&&status[0]!='S')) {
|
||||
getStatus( id, status[0], statusCode, status, 7 )
|
||||
if ( isSystem( a ) || (statusCode!='O'&&statusCode!='S')) {
|
||||
if ( g_coloredMenus ) {
|
||||
len += format(menu_body[len],511-len, "\d%d. %s\R%s^n\w",++k, title, status )
|
||||
}
|
||||
@ -285,38 +289,38 @@ public cmdPlugin(id,level,cid) {
|
||||
else if ( equal(cmds, "save" ) ) {
|
||||
if (saveSettings(g_fileToSave)) {
|
||||
g_Modified = 0
|
||||
console_print(id,"%L",id,"CONF_SAVED")
|
||||
console_print(id,"%L",id,"PAUSE_CONF_SAVED")
|
||||
}
|
||||
else
|
||||
console_print(id,"%L",id,"SAVE_FAILED")
|
||||
console_print(id,"%L",id,"PAUSE_SAVE_FAILED")
|
||||
}
|
||||
else if ( equal(cmds, "clear" ) ) {
|
||||
if (file_exists(g_fileToSave)){
|
||||
delete_file(g_fileToSave)
|
||||
console_print(id,"%L",id,"CONF_CLEARED")
|
||||
console_print(id,"%L",id,"PAUSE_CONF_CLEARED")
|
||||
}
|
||||
else
|
||||
console_print(id,"%L",id,"ALR_CLEARED")
|
||||
console_print(id,"%L",id,"PAUSE_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,"%L %L",id,"PLUGIN_MATCH",arg,id,"PAUSED")
|
||||
else console_print(id,"%L",id,"COULDNT_FIND",arg)
|
||||
console_print(id,"%L %L",id,"PAUSE_PLUGIN_MATCH",arg,id,"PAUSED")
|
||||
else console_print(id,"%L",id,"PAUSE_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,"%L %L",id,"PLUGIN_MATCH",arg,id,"UNPAUSED")
|
||||
else console_print(id,"%L",id,"COULDNT_FIND",arg)
|
||||
console_print(id,"%L %L",id,"PAUSE_PLUGIN_MATCH",arg,id,"UNPAUSED")
|
||||
else console_print(id,"%L",id,"PAUSE_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,"%L %L",id,"PLUGIN_MATCH",arg,id,"STOPPED")
|
||||
console_print(id,"%L %L",id,"PAUSE_PLUGIN_MATCH",arg,id,"STOPPED")
|
||||
}
|
||||
else console_print(id,"%L",id,"COULDNT_FIND",arg)
|
||||
else console_print(id,"%L",id,"PAUSE_COULDNT_FIND",arg)
|
||||
}
|
||||
else if ( equal(cmds, "list" ) ) {
|
||||
new lName[32],lVersion[32],lAuthor[32],lFile[32],lStatus[32]
|
||||
|
Reference in New Issue
Block a user