new bool:g_bSomeMassive[MAX_PLAYERS + 1]
А где у тебя убирается блок атаки, ставишь её в фолс для нужного игрока.set_pdata_float( pPlayer, m_flNextAttack, 2.83 + 0.1, 5)
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
можешь показать пример как это выглядит?
#include <amxmodx>
#include <reapi>
new bool:g_bSomeMassive[33];
public plugin_init()
{
RegisterHookChain(RG_CBasePlayerWeapon_CanDeploy, "CBasePlayerWeapon_CanDeploy", false);
register_clcmd("say /block", "block");
}
public block(pId)
{
g_bSomeMassive[pId] = !g_bSomeMassive[pId];
if(g_bSomeMassive[pId])
set_member(pId, m_flNextAttack, 999);
else
set_member(pId, m_flNextAttack, 0);
}
public CBasePlayerWeapon_CanDeploy(pId)
{
if(g_bSomeMassive[pId])
{
SetHookChainReturn(ATYPE_BOOL, false);
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}
#include <amxmodx>
#include <reapi>
new bool:g_bSomeMassive[33];
public plugin_init()
{
RegisterHookChain(RG_CBasePlayerWeapon_CanDeploy, "CBasePlayerWeapon_CanDeploy", false);
register_clcmd("say /block", "block");
}
public block(pId)
{
g_bSomeMassive[pId] = !g_bSomeMassive[pId];
set_member(pId, m_flNextAttack, g_bSomeMassive[pId] ? 999.0 : 0.0);
}
public CBasePlayerWeapon_CanDeploy(iItem)
{
static iPlayer;
if(!(iPlayer = get_member(iItem, m_pPlayer)) || !is_user_connected(iPlayer))
return HC_CONTINUE;
if(g_bSomeMassive[iPlayer])
{
SetHookChainReturn(ATYPE_BOOL, false);
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}
if(!(iPlayer = get_member(iItem, m_pPlayer)) || !is_user_connected(iPlayer))
#include <iostream>
int GetPlayer(const unsigned short item) {
if(!item)
return 0;
return 123;
}
bool is_user_connected(const unsigned short player) {
return player != 0;
}
void CanDeploy(const unsigned short item) {
unsigned short player = 0;
if(!(player = GetPlayer(item)) || !is_user_connected(player)) {
std::cout << "return HC_SUPERCEDE 1" << std::endl;
}
// OR
player = GetPlayer(item);
if(!player || !is_user_connected(player)) {
std::cout << "return HC_SUPERCEDE 2" << std::endl;
}
}
int main() {
CanDeploy(0);
CanDeploy(1);
}