*updated
- reset all capture points, set "Flag of the United Kingdom" 🇬🇧 🇬🇧
Here quick version...
This not reset home flags, need look another day.
- If try use entity input "
SetOwner", it crash server. :/
PHP Code:
#include <sdktools>
#define CAP_POINT_TICK_FOR_BOMBS_REMAINING (1<<2)
public void OnPluginStart()
{
HookEventEx("dod_round_start", dod_round_start);
}
public void dod_round_start(Event event, const char[] name, bool dontBroadcast)
{
CreateTimer(1.0, delay);
}
public Action delay(Handle timer)
{
int entity = -1;
while((entity = FindEntityByClassname(entity, "dod_capture_area")) != -1)
{
AcceptEntityInput(entity, "Disable");
//PrintToServer("dod_capture_area %i", entity);
}
entity = FindEntityByClassname(-1, "dod_control_point_master");
if(entity != -1)
AcceptEntityInput(entity, "Disable");
entity = FindEntityByClassname(-1, "dod_objective_resource");
if(entity != -1)
{
int count = GetEntPropArraySize(entity, Prop_Send, "m_iOwner");
for(int x = 0; x < count; x++)
{
//PrintToServer("x %i = m_iOwner %i", x, GetEntProp(entity, Prop_Send, "m_iOwner", _, x));
SetEntProp(entity, Prop_Send, "m_iOwner", 0, _, x);
SetEntProp(entity, Prop_Send, "m_iBombsRequired", 0, _, x);
SetEntProp(entity, Prop_Send, "m_iBombsRemaining", 0, _, x);
SetEntProp(entity, Prop_Send, "m_bBombBeingDefused", 0, _, x);
}
}
entity = -1;
while((entity = FindEntityByClassname(entity, "dod_control_point")) != -1)
{
//PrintToServer("dod_control_point %i", entity);
SetVariantInt(2);
AcceptEntityInput(entity, "SetBodyGroup");
SetEntProp(entity, Prop_Data, "m_iBombsRequired", 0);
int flags = GetEntProp(entity, Prop_Data, "m_spawnflags");
flags &= ~CAP_POINT_TICK_FOR_BOMBS_REMAINING;
SetEntProp(entity, Prop_Data, "m_spawnflags", flags);
}
entity = -1;
while((entity = FindEntityByClassname(entity, "dod_bomb_target")) != -1)
{
//PrintToServer("dod_bomb_target %i", entity);
AcceptEntityInput(entity, "Disable");
}
entity = -1;
while((entity = FindEntityByClassname(entity, "dod_bomb_dispenser")) != -1)
{
//PrintToServer("dod_bomb_dispenser %i", entity);
AcceptEntityInput(entity, "Disable");
}
return Plugin_Continue;
}
__________________