In both Counter-Strike and Day of Defeat, restarting the round not only respawns all players (and resets flags in dod) but it also
resets all entities.
This includes func_breakables, and other triggers in the map that were set off. These all return to their default state on round restarting.
Does anyone know how to achieve this without restarting the round through a console command, which would also respawn everyone?
I have tried looping through all entities and executing hamsandwich's Ham_DOD_RoundRespawn, but the plugin dies mid-loop and doesn't make it to the echo. When I perform it on an individual func_breakable, it makes it to the echo but nothing happens to the entity at all.
Code:
static maxents;
maxents = global_get( glb_maxEntities );
for( new i = 1; i < maxents; i++ )
if( pev_valid(i) ) ExecuteHam( Ham_DOD_RoundRespawn, i );
console_print( id, "Reset All %i Entities", maxents );
One thing I did notice was that a func_breakable's pev_health is set to 100.0 or 150.0 before it is broken, when it is set to 0.0 or negative, depending on the damage done to it. In addition, after it "breaks," its pev_deadflag is set to 2. I have tried setting the health back to 100.0 and the deadflag back to 0 and using DLLFunc_Spawn on it, but all that happens is I can no longer walk through it - but there is no window there, visually.
Thanks in advance gents.
__________________