I use this hook to be able to pass through doors without opening them.
But I notice some strange situations:
Is there any other way to achieve or fix that?
Code:
But I notice some strange situations:
- The hook is called before you touch the door, even when you are far from the door.
- When you are touching the door, you can feel like the player gets a little stuck.
Is there any other way to achieve or fix that?
Code:
Код:
#include <amxmodx>
#include <fakemeta>
#include <reapi>
public plugin_init()
{
register_plugin("Walking Through Doors", "0.1", "RauliTop")
RegisterHookChain(RH_SV_AllowPhysent, "SV_AllowPhysent_Pre")
}
public SV_AllowPhysent_Pre(entindex, playerindex)
{
if (!is_door(entindex))
return HC_CONTINUE;
client_print(0, print_chat, "Testing isDoor")
if (!is_user_alive(playerindex))
return HC_CONTINUE;
client_print(0, print_chat, "Testing SV_AllowPhysent")
SetHookChainReturn(ATYPE_BOOL, false)
return HC_SUPERCEDE;
}
is_door(iEntity)
{
if( !pev_valid(iEntity) )
return 0
static class[10] // length for: func_door and func_door_rotating
pev(iEntity, pev_classname, class, charsmax(class))
if( !equal(class, "func_door") )
return 0
return 1
}