Quote:
Originally Posted by bibu
Show us how you are doing the bomb plant automatically? There might be a variable which needs to be set in order to "tell" the bots that the bomb has been planted.
|
Thanks for responding.
This is called on newRound(),
PHP Code:
new mapname[31]
get_mapname(mapname,31)
new Float:origin[3];
new rngBomb
rngBomb = random_num(1,100)
if(equali(mapname, "de_dust2"))
{
if (rngBomb > 70)
{
origin[0] = -1360.031250
origin[1] = 2575.968750
origin[2] = 47.417095
}
else if (rngBomb < 30)
{
origin[0] = -1629.973022
origin[1] = 2495.968750
origin[2] = 36.031250
}
else
{
origin[0] = -1630.511841
origin[1] = 2592.031250
origin[2] = 36.031250
}
}
else if(equali(mapname, "de_inferno"))
{
if (rngBomb > 70)
{
origin[0] = 2097.071045
origin[1] = 442.607361
origin[2] = 196.031250
}
else if (rngBomb < 30)
{
origin[0] = 2070.960693
origin[1] = 183.968750
origin[2] = 196.031250
}
else
{
origin[0] = 2070.960693
origin[1] = 183.968750
origin[2] = 196.031250
}
}
// Create C4 at that location.
new iEntity = create_entity("weapon_c4");
if(!iEntity)
return;
DispatchKeyValue(iEntity, "detonatedelay", 0);
DispatchSpawn(iEntity);
engfunc(EngFunc_SetOrigin, iEntity, origin);
force_use(iEntity, iEntity);
client_cmd(0, "spk radio/bombpl")
// Set bomb location on radar and remove the timer.
message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1)
engfunc(EngFunc_WriteCoord, origin[0]);
engfunc(EngFunc_WriteCoord, origin[1]);
engfunc(EngFunc_WriteCoord, origin[2]);
write_byte(1);
message_end();