Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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] Stickybomb and Pipe Indicator


  • 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:7178
  • Lokalizacja:AMXX.PL
Offline

Napisano 06.01.2016 01:57

<div>This plugin creates a Call of Duty-esque projectile indicator for Stickybombs and Pipe Grenades!<br /><br /><u><b>since this plugin uses methodmaps, it requires SourceMod 1.7+ to compile;</b></u><br /><u>also, this plugin can also be modified to work in order games as so needed.</u><br /><br />cvars<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">projindic_enabled&nbsp;</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Enable&nbsp;Projectile&nbsp;Indicator&nbsp;plugin<br />projindic_grenades&nbsp;</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Enable&nbsp;the&nbsp;Projectile&nbsp;Indicator&nbsp;plugin&nbsp;to&nbsp;detect&nbsp;pipe&nbsp;grenades<br />projindic_stickies&nbsp;</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Enable&nbsp;the&nbsp;Projectile&nbsp;Indicator&nbsp;plugin&nbsp;to&nbsp;detect&nbsp;stickybombs<br /><br />projindic_grenaderadius&nbsp;</span><span style="color: #DD0000">"300.0"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Detection&nbsp;radius&nbsp;</span><span style="color: #007700">for&nbsp;</span><span style="color: #0000BB">pipe&nbsp;grenades&nbsp;in&nbsp;Hammer&nbsp;Units<br />projindic_stickyradius&nbsp;</span><span style="color: #DD0000">"300.0"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Detection&nbsp;radius&nbsp;</span><span style="color: #007700">for&nbsp;</span><span style="color: #0000BB">stickybombs&nbsp;in&nbsp;Hammer&nbsp;Units<br />projindic_detectfriendly&nbsp;</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Detect&nbsp;friendly&nbsp;projectiles&nbsp;
<br /></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div>Commands<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">User&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">sm_detect&nbsp;</span><span style="color: #007700">or&nbsp;</span><span style="color: #0000BB">sm_indic&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Enables&nbsp;the&nbsp;indicator<br />Admins&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">sm_forcedetection&nbsp;</span><span style="color: #007700">or&nbsp;</span><span style="color: #0000BB">sm_forcedetect&nbsp;</span><span style="color: #007700">&lt;@</span><span style="color: #0000BB">all</span><span style="color: #007700">|@</span><span style="color: #0000BB">red</span><span style="color: #007700">|@</span><span style="color: #0000BB">blue</span><span style="color: #007700">|@</span><span style="color: #0000BB">alive</span><span style="color: #007700">|@</span><span style="color: #0000BB">etc</span><span style="color: #007700">.&gt;&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div><font color="Magenta">Considering how expensive the code is to run 100% perfectly, ANY optimization tips are welcome.<br />BEFORE you tell me your optimization tips, I already tried using SDKHooks on the projectiles themselves, hooking them to Think.<br /><br />It worked but it wasn't updating fast enough like the current expensive method. The prior expensive method was hooking SDKHooks ThinkPost on clients and using FindEntityByClassname2; it worked but the plugin would unload itself after detecting too many stickybombs and grenades xD.<br /><br />So I changed it to a 0.1 second timer which updates slow but not as slow as my first optimization attempt by hooking the projectiles which ONLY worked when I hooked them to Think after hooking their SpawnPost which I used to hook Think from...</font><br /><br />BitBucket Repo -&gt; <a href="https://bitbucket.or...e-view-default"target="_blank">clickme!</a></div>


<br /> <div style="padding:6px">








<fieldset class="fieldset">
<legend>Attached Files</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><img class="inlineimg" src="https://forums.allie...attach/smx.gif"alt="File Type: smx" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="https://forums.allie...etector.smx</a>(9.8 KB)


</td>
</tr><tr>
<td><img class="inlineimg" src="https://forums.allie.../attach/sp.gif"alt="File Type: sp" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="http://www.sourcemod...65"><strong>GetPlugin</strong></a> or
<a href="https://forums.allie...1452041498">GetSource</a> (projdetector.sp - 11.7 KB)


</td>
</tr><tr>
<td><img class="inlineimg" src="https://forums.allie...attach/inc.gif"alt="File Type: inc" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="https://forums.allie...>macros.inc</a>(1,002 Bytes)


</td>
</tr>
</table>
</fieldset>


</div>

Wyświetl pełny artykuł




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

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