How do I use this command with all of it is being applied only on the map.
ACMD_FUNC(maintenance) {
nullpo_retr(-1, sd);[/font][/color]
if (message && *message) {
if(strcmpi(message, "on") == 0) {
if(runflag == MAPSERVER_ST_MAINTENANCE) {
clif_displaymessage(fd, "Server already in maintenance");
} else {
struct map_session_data* pl_sd;
struct s_mapiterator* iter;[/font][/color]
iter = mapit_getallusers();
for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) {
if (pc_get_group_level(pl_sd) != 99) { // Only Admin(99) that will stay in maintenance
clif_GM_kick(NULL, pl_sd);
}
}
mapit_free(iter);[/font][/color]
runflag = MAPSERVER_ST_MAINTENANCE; //Activate maintenance, disable all player except Admin to login
chrif_maintenis(MAPSERVER_ST_MAINTENANCE);
//ShowInfo("Maintenance: Onn");
clif_displaymessage(fd, "Maintenance: On");
}
} else if(strcmpi(message, "off") == 0) {
if(runflag == MAPSERVER_ST_MAINTENANCE) {
runflag = MAPSERVER_ST_RUNNING; //Deactivate maintenance
chrif_maintenis(MAPSERVER_ST_RUNNING);
//ShowInfo("Maintenance: Offn");
clif_displaymessage(fd, "Maintenance: Off");
} else {
clif_displaymessage(fd, "Server is not in maintenance");
}
} else {
clif_displaymessage(fd, "Usage: @maintenance <on|off>");
return -1;
}
} else {
clif_displaymessage(fd, "Usage: @maintenance <on|off>");
return -1;
}
}