#include <amxmodx>
new msgidHostagePos, msgidHostageK, maxPlayers;
public plugin_init()
{
register_plugin("Bomb_on_ct", "1.0", "Exclusive");
new const szMapTypes[][] = { "de_" }; // Типы карт, на которых плагин БУДЕТ работать
new szMapname[32], bool:bMapType;
get_mapname(szMapname, charsmax(szMapname));
for(new i, iMapTypesNum = sizeof szMapTypes; i < iMapTypesNum; i++)
{
if(equali(szMapname, szMapTypes[i], strlen(szMapTypes[i])))
{
bMapType = true;
break;
}
}
if(!bMapType)
{
pause("d");
}
msgidHostagePos = get_user_msgid("HostagePos");
msgidHostageK = get_user_msgid("HostageK");
maxPlayers = get_maxplayers();
set_task(1.0, "UpdateRadar", _, _, _, "b");
}
public UpdateRadar()
{
static bombOrigin[3], id;
for (id = 1; id <= maxPlayers; id++)
{
if (user_has_weapon(id, CSW_C4))
{
get_user_origin(id, bombOrigin);
break;
}
}
for (id = 1; id <= maxPlayers; id++)
{
{
if(!is_user_connected(id))
return;
message_begin(MSG_ONE_UNRELIABLE, msgidHostagePos, {0, 0, 0}, id);
write_byte(id);
write_byte(0);
write_coord(bombOrigin[0]);
write_coord(bombOrigin[1]);
write_coord(bombOrigin[2]);
message_end();
message_begin(MSG_ONE_UNRELIABLE, msgidHostageK, {0, 0, 0}, id);
write_byte(0);
message_end();
}
}
}