I found this post with a fix for this.
https://forums.alliedmods.net/showthread.php?t=321011
This definitely fixes the ct bots that respawn after the bomb plant are sometimes stuck problem.
Thanks goes out to backwards for this code / idea.
PHP Code:
if(IsFakeClient(client) && bombIsPlanted)
{
CS_RespawnPlayer(client);
ent = -1;
ent = FindEntityByClassname(ent, "planted_c4");
if(ent != -1)
{
float c4_position[3];
float player_position[3];
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", c4_position);
GetEntPropVector(client, Prop_Send, "m_vecOrigin", player_position);
TeleportEntity(client, c4_position, NULL_VECTOR, NULL_VECTOR);
Event BombPlanted = CreateEvent("bomb_planted");
if(BombPlanted != null)
{
SetEventInt(BombPlanted, "userid", client);
SetEventInt(BombPlanted, "site", bombSite);
FireEvent(BombPlanted, true);
}
TeleportEntity(client, player_position, NULL_VECTOR, NULL_VECTOR);
}
}
else
{
CS_RespawnPlayer(client);
ent = -1;
ent = FindEntityByClassname(ent, "weapon_c4");
if(ent != -1 && (GetRandomInt(1, 10) <= 7))
{
//DebugLog("Found weapon_c4");
float c4_position[3];
float player_position[3];
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", c4_position);
GetEntPropVector(client, Prop_Send, "m_vecOrigin", player_position);
TeleportEntity(client, c4_position, NULL_VECTOR, NULL_VECTOR);
TeleportEntity(client, player_position, NULL_VECTOR, NULL_VECTOR);
}
}
I noticed a side effect this has is the bots really go for the bomb now so I am not limiting this to just CT bot but also T bot so the respawned T bots now "report in" better to the planted bomb site.
This made me think it might make for even better game play if I also did this for respawned bots "showing" them where the bomb is when dropped and being carried.
It works!
In fact it works too good and I had to put in a random chance and bump it down to only showing the non planted bomb 70% of the time.
This significantly improves the bot game play when the bomb is planted or not!