Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[TF2] RegenThink Hook


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 494
  • Lokalizacja:AMXX.PL
Offline

Napisano 03.11.2022 17:50

<div><font color="darkorange"><font size="7">TF2 RegenThink Hook</font></font><br /><br />The topic of hooking medics health regenration came up recently and I was kinda surprised nobody did a proper hook for this yet. I think nosoop brought up RegenThink in relation to that on the SM Discord, so thank you nosoop.<br /><br />As I didn't want this to be a &quot;stupid&quot; OnRegenThink hook, I dug into the decompile and reversed the function to give the most control possible. Since this plugin superceds the original function, I'm currently not sure how well this works with other RegenThink hooks, if at all.<br /><br /><font color="darkorange"><font size="5">Forward Summary</font></font><br /><br />The forwards are documented in the include.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">Action&nbsp;TF2_OnRegenThinkPre</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;client</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">Action&nbsp;TF2_OnRegenThinkHealth</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;client</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">float</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">regenHealthClass</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">float</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">regenHealthAttribs</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">Action&nbsp;TF2_OnRegenThinkAmmo</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;client</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">float</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">regenAmmoPercent</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">regenMetal</span><span style="color: #007700">);
<br /></span><span style="color: #0000BB">void&nbsp;TF2_OnRegenThinkPost</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;client</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;regenHealth</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">float&nbsp;regenAmmo</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;regenMetal</span><span style="color: #007700">);&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div><font color="DarkOrange"><font size="5">Dependencies</font></font><br /><br />Requires <a href="https://github.com/F.../tf2attributes"target="_blank" rel="nofollow noopener">TF2 Attributes</a><br /><br /><font color="DarkOrange"><font size="5">Credits</font></font><br /><br />I want to thank nosoop for always having some insights or helpful reference code withing TF2 in their plugins. Also thanks to who ever asked for this in the SM Discord, I actually needed this for a personal project, but was too lazy to properly do this until now. Please open an issue if I forgot anyone :)<br /><br /><div align="center"><font size="7"><a href="https://github.com/DosMike/TF2-RegenThinkHook" target="_blank" rel="nofollow noopener">Available on GitHub</a></font></div></div>

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych