RegisterHookChain, true or false of the post

Сообщения
13
Реакции
1
What is the work of true or false in RegisterHookChain? What does it provide?
For example:

RegisterHookChain(RG_CBasePlayer_Killed, "@CBasePlayer_Killed", false);
RegisterHookChain(RG_CBasePlayer_Killed, "@CBasePlayer_Killed", true);
 
Сообщения
580
Реакции
338
Предупреждения
1
Помог
9 раз(а)
true - post
false - pre

.post = true/false
 
  • Нравится
Реакции: Ayk
Сообщения
278
Реакции
137
# false - 0 =pre
# true - 1 = post
AFAIK it is setting the start of hook. If you make it false, it will work before the event happened. If you make it true, it will work after the event happened.

For example; If you want to block giving C4 to client, you must use false. Because hooking is useless after c4 is given.

PHP:
RegisterHookChain(RG_CSGameRules_GiveC4, "@CSGameRules_GiveC4", .post=false);   // It blockes giving C4 to client
//RegisterHookChain(RG_CSGameRules_GiveC4, "@CSGameRules_GiveC4", .post=true);   // C4 is given, man. What the?

@CSGameRules_GiveC4(const id)
{
     return HC_SUPERCEDE;
}
And also;
https://dev-cs.ru/threads/11972/#post-89780
 

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

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