Quote:
Originally Posted by HarryPotter
PHP Code:
public void Event_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if(g_cvarAutoload.BoolValue && g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
}
public void OnMapStart()
{
if(g_cvarAutoload.BoolValue && !g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
CreateTimer(2.0,tSpawnObjects);
}
...
...
}
public Action tSpawnObjects(Handle timer)
{
SpawnObjects();
return Plugin_Continue;
}
and done
|
Thank you for helping me, but it still doesn't seem to work
Code:
L 11/06/2022 - 18:53:32: SourceMod error session started
L 11/06/2022 - 18:53:32: Info (map "c9m1_alleys") (file "XXX/left4dead2/addons/sourcemod/logs/errors_20221106.log")
L 11/06/2022 - 18:53:32: [l4d2_spawn_props.smx] Attempted to load an object file which does not exist (addons/sourcemod/../stripper/plugin_cache/.txt)
L 11/06/2022 - 18:55:57: Error log file session closed.
I tried the following codes,They will throw the above error logs.
Unless the map is changed, the configuration will not be loaded even if all survivors die (restart)
Even if the map is switched, it will only be loaded in the first game
If all survivors die (restart), the configuration will no longer be loaded and no errors will be thrown
PHP Code:
public void Event_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if(g_cvarAutoload.BoolValue && g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
}
public Action tSpawnObjects(Handle timer)
{
SpawnObjects();
return Plugin_Continue;
}
public void OnMapStart()
{
if(g_cvarAutoload.BoolValue && !g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
CreateTimer(2.0,tSpawnObjects);
}
......
......
}
PHP Code:
public void Event_SurvivalRoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
SpawnObjects();
// CreateTimer(2.0,tSpawnObjects);
}
}
public void Event_ScavengeRoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
LogSpawn("Scavenge Round Has Started");
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
SpawnObjects();
// CreateTimer(2.0,tSpawnObjects);
}
}
public void Event_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if(g_cvarAutoload.BoolValue && g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
}
public Action tSpawnObjects(Handle timer)
{
SpawnObjects();
return Plugin_Continue;
}
public void OnMapStart()
{
if(g_cvarAutoload.BoolValue && !g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
CreateTimer(2.0,tSpawnObjects);
}
......
......
}
PHP Code:
public void Event_SurvivalRoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
// SpawnObjects();
// CreateTimer(2.0,tSpawnObjects);
}
}
public void Event_ScavengeRoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
LogSpawn("Scavenge Round Has Started");
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
// SpawnObjects();
// CreateTimer(2.0,tSpawnObjects);
}
}
public void Event_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if(g_cvarAutoload.BoolValue && g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
}
public Action tSpawnObjects(Handle timer)
{
SpawnObjects();
return Plugin_Continue;
}
public void OnMapStart()
{
if(g_cvarAutoload.BoolValue && !g_cvarAutoloadType.BoolValue)
{
GetRandomMapPath(g_sPath, sizeof(g_sPath));
}
if(g_cvarAutoload.BoolValue && !g_bLoaded)
{
g_bLoaded = true;
CreateTimer(2.0,tSpawnObjects);
}
......
......
}
My English is not good.