I am having difficulty forcing a map change in L4D2
neither of the following commands are working for me. Everything else works, I see the printtochatall output just fine. below is a snip of my code.
ServerCommand("changelevel %s", mapname);
ForceChangeLevel(mapname, "Just Because");
Code:
public OnPluginStart()
{
hMap = CreateConVar("FFF_Map", "c5m1_highway", "Force Map Change to this map",FCVAR_PLUGIN|FCVAR_NOTIFY);
}
public OnEntityCreated(entity, const String:classname[])
{
new CurrentEnts = entity;
if (CurrentEnts == 2000) {
decl String:mapname[64];
GetConVarString(hMap, mapname, sizeof(mapname));
PrintToChatAll("Force changing map now...", mapname);
//ServerCommand("changelevel %s", mapname);
ForceChangeLevel(mapname, "Just because");
}
}
__________________