#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <reapi>
new g_pPrecacheSpawn;
new Array:g_aBreakebleEntity;
public plugin_init()
{
unregister_forward(FM_Spawn, g_pPrecacheSpawn);
register_clcmd("say /respawn", "redeploy_breakble_entity");
}
public plugin_precache()
{
g_aBreakebleEntity = ArrayCreate();
g_pPrecacheSpawn = register_forward(FM_Spawn, "FM_SpawnPrecache", false);
}
public FM_SpawnPrecache(iEnt)
{
if(is_entity(iEnt))
{
static szClass[32];
get_entvar(iEnt, var_classname, szClass, charsmax(szClass));
if(equal(szClass, "func_breakable")) ArrayPushCell(g_aBreakebleEntity, iEnt);
}
}
public redeploy_breakble_entity()
{
static iTmp, iSize;
iSize = ArraySize(g_aBreakebleEntity);
for(new i = 0; i < iSize; ++i)
{
iTmp = ArrayGetCell(g_aBreakebleEntity, i);
ExecuteHamB(Ham_CS_Restart, iTmp);
}
}