PHP Code:
HookEvent("cs_intermission", Event_MapEnd);
HookEvent("announce_phase_end", Event_Phase);
public Action Event_MapEnd(Event event, const char[] name, bool dontBroadcast)
{
PrintToChatAll("Map end");
}
public Action Event_Phase(Event event, const char[] name, bool dontBroadcast)
{
PrintToChatAll("Warmup end, half time or match end");
}
you should use a global variable: iPhase;
OnMapStart: iPhase = 0;
and in announce_phase_end you increase iPhase++;
if(iPhase == 1) then warmup end
if(iPhase == 2) then half time
if(iPhase == 3) then match end
i use
PHP Code:
int iEntity = CreateEntityByName("game_end");
DispatchSpawn(iEntity);
AcceptEntityInput(iEntity, "EndGame");
in command_map instead of forcechangelevel cause i need to hook the end of the map before OnMapEnd() when map is changed;