Re: No Entities Block
Posted: 28 Jul 2018, 22:48
here is ip: 91.224.117.15:27055
Rehlds - 3.4.0.654
Reapi 5.6.0 157
regameDLL - 5,7,0.312
Metamod v1.21p37
Rehlds - 3.4.0.654
Reapi 5.6.0 157
regameDLL - 5,7,0.312
Metamod v1.21p37
Code: Select all
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i < charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
client_print(id, print_center, "Block Event Called!")
}
}
I am using this codeRaheem wrote: ↑5 years ago I tested on your server, seems that the block event is called. So can you tell what is the problem and which code you used?
Try this and tell if you get message when you blocking the entities or not:
Code: Select all
#include <zombie_escape> new const szEntities[][] = { "func_train", "func_vehicle", "func_tracktrain", "func_door" } public plugin_init() { register_plugin("No Block", "1.0", "Raheem") for (new i = 0; i < charsmax(szEntities); i++) { RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1) } } public Fw_Blocked_Post(iEnt, id) { if (is_user_alive(id) && pev_valid(iEnt)) { client_print(id, print_center, "Block Event Called!") } }
Code: Select all
#include <zombie_escape>
new Float:g_flPlayed[33]
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i < charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
if (get_gametime() > g_flPlayed[id] + 1.0)
{
PlaySound(id, "hgrunt/move!.wav")
g_flPlayed[id] = get_gametime();
}
client_print(id, print_center, "STOP BLOCK! MOVE!")
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 1.0, DMG_GENERIC)
}
}
Code: Select all
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 1.0, DMG_GENERIC)
Code: Select all
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 0.1, DMG_GENERIC)
try this i use it in my server
Code: Select all
#include <zombie_escape>
new Float:g_flPlayed[33]
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
new g_iPulsating = 0, Float:g_flLastBlock[33]
// Cvars
new g_pCvarBlockTime
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
// Cvars
g_pCvarBlockTime = register_cvar("ze_block_time", "1.5")
for (new i = 0; i <= charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
new Float:flRefTime = get_gametime()
if (is_user_alive(id) && pev_valid(iEnt))
{
PlaySound(id, "zombie_escape/move.wav")
g_flPlayed[id] = get_gametime();
}
{
if(g_flLastBlock[id] > flRefTime)
return
g_flLastBlock[id] = flRefTime + get_pcvar_float(g_pCvarBlockTime)
if (ze_is_user_zombie(id))
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 2000.0, DMG_GENERIC)
}
else
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 15.0, DMG_GENERIC)
}
client_print(id, print_center, "STOP BLOCK!! MOVE")
switch (g_iPulsating)
{
case 0:
{
Set_Rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 10)
g_iPulsating = 1
}
case 1:
{
Set_Rendering(id)
g_iPulsating = 0
}
}
}
}
i try this befor but dont workJack GamePlay wrote: ↑5 years ago
#include <zombie_escape> new Float:g_flPlayed[33] new const szEntities[][] = { "func_train", "func_vehicle", "func_tracktrain", "func_door" } new g_iPulsating = 0, Float:g_flLastBlock[33] // Cvars new g_pCvarBlockTime public plugin_init() { register_plugin("No Block", "1.0", "Raheem") // Cvars g_pCvarBlockTime = register_cvar("ze_block_time", "1.5") for (new i = 0; i <= charsmax(szEntities); i++) { RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1) } } public Fw_Blocked_Post(iEnt, id) { new Float:flRefTime = get_gametime() if (is_user_alive(id) && pev_valid(iEnt)) { PlaySound(id, "zombie_escape/move.wav") g_flPlayed[id] = get_gametime(); } { if(g_flLastBlock[id] > flRefTime) return g_flLastBlock[id] = flRefTime + get_pcvar_float(g_pCvarBlockTime) if (ze_is_user_zombie(id)) { client_print(id, print_center, "STOP BLOCKING!!! -2000HP") ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 2000.0, DMG_GENERIC) } else { client_print(id, print_center, "STOP BLOCKING!!! -15HP") ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 15.0, DMG_GENERIC) } client_print(id, print_center, "STOP BLOCK!! MOVE") switch (g_iPulsating) { case 0: { Set_Rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 10) g_iPulsating = 1 } case 1: { Set_Rendering(id) g_iPulsating = 0 } } } }
I think yes, can't block entities anymore.