Block Plant Round End

Block Plant Round End 0.0.1

Нет прав для скачивания
Код:
#include <amxmodx>
#include <hamsandwich>
#include <reapi>

public stock const PLUGIN[] = "Block Plant Round End";
public stock const VERSION[] = "0.0.1";
public stock const AUTHOR[] = "Albertio";

new HamHook:g_pHook_Weapon_PrimaryAttack;

new Float:g_fPlayerBlockedPlanting;

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR);

    if(!get_member_game(m_bMapHasBombZone))
        pause("d");

    RegisterHookChain(RG_RoundEnd, "RoundEnd_Pre", false);
    RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound_Post", true);

    DisableHamForward((g_pHook_Weapon_PrimaryAttack = RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_c4", "C4_PrimaryAttack_Pre", false)));
}

public RoundEnd_Pre() {
    EnableHamForward(g_pHook_Weapon_PrimaryAttack);
}

public CSGameRules_RestartRound_Post() {
    DisableHamForward(g_pHook_Weapon_PrimaryAttack);
}

public C4_PrimaryAttack_Pre(const pItem) {
    if(is_nullent(pItem))
        return HAM_IGNORED;

    new pPlayer = get_member(pItem, m_pPlayer);

    if(is_nullent(pPlayer) || !rg_get_user_bombzone(pPlayer))
        return HAM_IGNORED;

    new Float:fGameTime = get_gametime();
 
    if(g_fPlayerBlockedPlanting + 1.0 > fGameTime)
        return HAM_SUPERCEDE;

    client_print(pPlayer, print_center, "* Нельзя минировать бомбу после конца раунда *");
    g_fPlayerBlockedPlanting = fGameTime;
    return HAM_SUPERCEDE;
}

stock bool:rg_get_user_bombzone(const pPlayer) {
    new iSignals[UnifiedSignals];
    get_member(pPlayer, m_signals, iSignals);

    return bool:(SignalState:iSignals[US_State] & SIGNAL_BOMB);
}
Назад
Верх