BlackSignature, Ну, это многое объясняет... Постараюсь в дальнейшем не задавать Вам вопросов.
#include <amxmodx>
#include <reapi>
new g_iHudSync;
#define DIST 60
public plugin_init() {
register_plugin("Bomb Taker", "1.0.0", "Vaqtincha & Minni Mouse");
if(bool:get_member_game(m_bMapHasBombTarget)) {
RegisterHookChain(RG_CBasePlayer_UseEmpty, "refwd_UseEmpty_Post", .post = true);
register_event("StatusValue", "event_StatusValue_Show", "be", "1=3", "2>0");
register_event("StatusValue", "event_StatusValue_Hide", "b", "1=1", "2=0");
g_iHudSync = CreateHudSyncObj();
}
else {
pause("ad");
}
}
public refwd_UseEmpty_Post(pPlayer) {
if(TeamName:get_member(pPlayer, m_iTeam) == TEAM_TERRORIST) {
new pTarget, iBody;
get_user_aiming(pPlayer, pTarget, iBody, DIST);
if(pTarget > 0 && iBody > 0 && func_CanUseThisPlayer(pTarget)) {
rg_transfer_c4(pTarget, pPlayer);
}
}
}
public event_StatusValue_Hide(const pPlayer) {
ClearSyncHud(pPlayer, g_iHudSync);
}
public event_StatusValue_Show(const pPlayer) {
if(TeamName:get_member(pPlayer, m_iTeam) != TEAM_TERRORIST) {
return;
}
new pTarget, iBody;
get_user_aiming(pPlayer, pTarget, iBody, DIST);
if(pTarget && iBody && func_CanUseThisPlayer(pTarget)) {
set_hudmessage(
125, 110, 200,
-1.0, 0.40,
.holdtime = 120.0,
.fadeintime = 0.1,
.fadeouttime = 0.1
);
ShowSyncHudMsg(pPlayer, g_iHudSync, "[E] Взять бомбу")
}
else {
ClearSyncHud(pPlayer, g_iHudSync);
}
}
func_CanUseThisPlayer(pPlayer) {
if(is_user_alive(pPlayer) && get_member(pPlayer, m_bHasC4) && is_user_bot(pPlayer)) {
return true;
}
return false;
}