RH_SV_AllowPhysent - able to pass through doors

Сообщения
231
Реакции
43
Предупреждения
2
I use this hook to be able to pass through doors without opening them.

But I notice some strange situations:
  1. The hook is called before you touch the door, even when you are far from the door.
  2. When you are touching the door, you can feel like the player gets a little stuck.
Video: https://imgur.com/a/3Atu2EO
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
}
 
Сообщения
109
Реакции
6
Предупреждения
10
what version of reapi ?

I get [ReAPI] SetHookChainReturn: trying to set return value with incompatible type, expected 'ATYPE_INTEGER'; got 'ATYPE_BOOL'
 
Сообщения
1,711
Реакции
1,519
Помог
26 раз(а)
raulitop, try to set SOLID_NOT for a door.
 
  • Нравится
Реакции: Murz
Сообщения
231
Реакции
43
Предупреждения
2
raulitop, try to set SOLID_NOT for a door.
I want to some players be able to pass through the door, not all.
The code posted is for testing.
6 Май 2025
what version of reapi ?

I get [ReAPI] SetHookChainReturn: trying to set return value with incompatible type, expected 'ATYPE_INTEGER'; got 'ATYPE_BOOL'
what version do you have?
Seems you are using a very old version, mine isn't latest.

Or maybe you haven't updated your includes.
 

Garey

ninjaCow
Сообщения
451
Реакции
1,111
Помог
11 раз(а)
raulitop, Set SOLID_NOT in fullpack then if not for all players.
 
Сообщения
231
Реакции
43
Предупреждения
2
Сообщения
369
Реакции
106
Помог
2 раз(а)
You can take a peek here. I think it won't be a problem to replace the player on the door.
7 Май 2025
Keep in mind that the player's width is 33 units
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу