This code will reset any block that is around doors at zombie spawn.
But the problem is that if there are two doors, plugin is removing blocks
at the center between these two doors. How to fix that?
PHP Code:
// plugin_init
new Float:mins[3], Float:maxs[3]
g_iEntBarrier = find_ent_by_tname( -1, "barrier" );
entity_get_vector(g_iEntBarrier, EV_VEC_mins, mins);
entity_get_vector(g_iEntBarrier, EV_VEC_maxs, maxs);
g_fBarrierOrigin[0] = (mins[0] + maxs[0]) / 2.0
g_fBarrierOrigin[1] = (mins[1] + maxs[1]) / 2.0
g_fBarrierOrigin[2] = (mins[2] + maxs[2]) / 2.0
PHP Code:
// Triggered when player release block
new entity = -1
while( ( entity = engfunc( EngFunc_FindEntityInSphere, entity, g_fBarrierOrigin, 200.0 ) ) != 0 )
{
if (entity == ent)
{
ColorChat(id, CHATCOLOR_RED, "$g%s$t %L", BB_PREFIX, id, "BBBM_BLOCK_SPAWN")
engfunc( EngFunc_SetOrigin, entity, Float:{ 0.0, 0.0, 0.0 } );
//g_iOwnedEntities[BlockLocker(ent)]--
g_EntMover[ent] = 0
g_EntOwner[ent] = 0
}
}