I used this in one of my plugins that ends the map if you use amx_extend -x where x is greater than the time remaining. I believe I may have originally taken some code from the original amx_map command.
Code:
if (invtlimit * 60 >= get_timeleft())
{
client_print(id,print_console, "%s You have ended the map.", TAG)
client_print(0,print_chat, "%s %s has ended the map.", TAG, name)
//server_cmd("amx_map %s", get_cvar_string("amx_nextmap"))
//make a note of this message to display the
//scoreboard as if the map was ending normally
message_begin(MSG_ALL, SVC_INTERMISSION)
message_end()
set_task(2.0, "change_map")
return PLUGIN_HANDLED
}
public change_map()
{
new nextmap[32]
get_cvar_string("amx_nextmap", nextmap, 31)
server_cmd("changelevel %s", nextmap)
}