Here is the code for csgo I don't know anything about Amxmodx and cs 1.6 you will have to translate it. But what is going on is easy to understand and hopefully easy to implement / port to 1.6
All that I am doing to fix this (thanks to everyone) is teleporting bots that are respawned after the bomb plant to the planted bomb and then teleporting them back.
This seems to really fix the stuck problems with them.
I also decided to do this to all bots because all bots knowing where the planted bomb is makes for some interesting game play and defending the planted bomb. All bots rush to the planted bomb on both teams!
PHP Code:
public Action Timer_Respawn(Handle timer, any serial)
{
int client = GetClientFromSerial(serial);
if (!g_bRoundEnded &&
IsValidClient(client) &&
IsClientInGame(client) &&
!IsPlayerAlive(client) &&
(GetClientTeam(client) == 2 || GetClientTeam(client) == 3)
)
{
int ent = -1;
char name[255];
GetClientName(client, name, 254);
// some percent of CT bots spawned after the bomb plant are stuck, wake them up
//if(IsFakeClient(client) && GetClientTeam(client) == 3 && bombIsPlanted)
// showing the respawned bots (both teams) where the planted bomb is makes for better game play
// so do ths for bot t and ct bots.
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);
// DebugLog(bombSite);
//bool GiveRealBombSite = (GetRandomInt(1, 10) <= 7);
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);
}
}
if(GetClientTeam(client) == CS_TEAM_T)
CPrintToChatAll(" {orange}* Respawned - {red}%s - {purple}%3.0f", name, g_respawn_time.FloatValue);
else
CPrintToChatAll(" {orange}* Respawned - {blue}%s - {purple}%3.0f", name, g_respawn_time.FloatValue);
// V01 - 1.0
// each respawn increases the respawn time up to 12 seconds
g_respawn_time.FloatValue += 1.0;
if(g_respawn_time.FloatValue > 15.0)
g_respawn_time.FloatValue = 15.0;
}
}