Jamy Posted March 26, 2012 Posted March 26, 2012 (edited) 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; } } Edited March 27, 2012 by Emistry Codeboxed Content Quote
Lighta Posted March 27, 2012 Posted March 27, 2012 Doesn't seem like this preven connection on map but to whole server, do you want i to execute it on one map so people can't go there while in maintenance ? If yes I'd put a new mapflag (maintenance) and prevent warping here in pc_set_pos or function similar, then you could still insert a check if someone manage to get in this map to get kicked or warped somewhere else. Quote
Jamy Posted March 27, 2012 Author Posted March 27, 2012 lighta I want to kick all of the same server kickall. Quote
Lighta Posted March 27, 2012 Posted March 27, 2012 uh ?? You wanna kick averyone for a specified map-server ? Quote
Jamy Posted March 27, 2012 Author Posted March 27, 2012 This command causes the server to enter into maintenance so I want everyone to be kicked from the server. Quote
Question
Jamy
How do I use this command with all of it is being applied only on the map.
Edited by EmistryCodeboxed Content
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.