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

[ANY] Entity Toggler


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

Napisano 27.06.2016 12:05

<div>An Entity Toggler I wrote for Disabling Func_no_builds and other Entities for tf2, but should work for Any Game; <br /><br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;sourcemod&gt;<br />#include &lt;sdktools&gt;<br />&nbsp;<br />public Plugin myinfo =<br />{<br />&nbsp; &nbsp; name = &quot;Ent Toggler&quot;,<br />&nbsp; &nbsp; author = &quot;Ecclesiastical&quot;,<br />&nbsp; &nbsp; description = &quot;Toggle Entities and such&quot;,<br />&nbsp; &nbsp; version = &quot;3.3.3&quot;,<br />&nbsp; &nbsp; url = &quot;[url="""]http://xt6zo6bcjbrrjyvr.onion&quot;<br[/url]/>}<br />&nbsp;<br />public void OnPluginStart()<br />{<br />&nbsp; &nbsp; RegAdminCmd(&quot;sm_toggleent_admin&quot;, Command_EntToggler, ADMFLAG_SLAY);<br />&nbsp; &nbsp; RegAdminCmd(&quot;sm_enthealth_admin&quot;, Command_EntHealth, ADMFLAG_SLAY);<br />&nbsp; &nbsp; RegAdminCmd(&quot;sm_entcolor_admin&quot;, Command_EntColor, ADMFLAG_SLAY);<br />&nbsp; &nbsp; RegAdminCmd(&quot;sm_entmodel_admin&quot;, Command_EntModel, ADMFLAG_SLAY);<br />&nbsp; &nbsp; RegConsoleCmd(&quot;sm_toggleent&quot;, Command_EntToggler, &quot;Toggle an Entity;&quot;);<br />&nbsp; &nbsp; RegConsoleCmd(&quot;sm_enthealth&quot;, Command_EntHealth, &quot;Set an Entity's Health;&quot;);<br />&nbsp; &nbsp; RegConsoleCmd(&quot;sm_entcolor&quot;, Command_EntColor, &quot;Set an Entity's Color;&quot;);<br />&nbsp; &nbsp; RegConsoleCmd(&quot;sm_entmodel&quot;, Command_EntModel, &quot;Set an Entity's Model;&quot;);<br />}<br />&nbsp;<br />public Action Command_EntToggler(client, args)<br />{<br />&nbsp; &nbsp; char arg1[64];<br />&nbsp; &nbsp; char arg2[64];<br />&nbsp; &nbsp; char name[MAX_NAME_LENGTH];<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if (args &lt; 1)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] Usage: sm_toggleent &lt;Entity&gt; &lt;Input&gt;&quot;);<br />&nbsp; &nbsp; &nbsp; return Plugin_Handled;<br />&nbsp; &nbsp; }<br />&nbsp;<br />&nbsp; &nbsp; GetCmdArg(1, arg1, sizeof(arg1));<br />&nbsp; &nbsp; GetCmdArg(2, arg2, sizeof(arg2));<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new horse = FindEntityByClassname(-1, arg1);<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; for(new x = 0; x &gt; horse; x++) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; AcceptEntityInput(horse, arg2);<br />&nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; GetClientName(client, name, sizeof(name));<br />&nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] You Toggled The %s Entity&quot;, arg1);<br />&nbsp;<br />&nbsp; &nbsp; return Plugin_Handled;<br />}<br /><br />public Action Command_EntHealth(client, args)<br />{<br />&nbsp; &nbsp; char arg1[64];<br />&nbsp; &nbsp; char arg2[64];<br />&nbsp; &nbsp; char name[MAX_NAME_LENGTH];<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if (args &lt; 2)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] Usage: sm_enthealth &lt;Entity&gt; &lt;Health&gt;&quot;);<br />&nbsp; &nbsp; &nbsp; return Plugin_Handled;<br />&nbsp; &nbsp; }<br />&nbsp;<br />&nbsp; &nbsp; GetCmdArg(1, arg1, sizeof(arg1));<br />&nbsp; &nbsp; GetCmdArg(2, arg2, sizeof(arg2));<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new horse = FindEntityByClassname(-1, arg1);<br />&nbsp; &nbsp; new turtle = StringToInt(arg2);<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new x = 0; x &gt; horse; x++) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; SetEntityHealth(horse, turtle);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; GetClientName(client, name, sizeof(name));<br />&nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] %s's Health is now %d&quot;, arg1, turtle);<br />&nbsp;<br />&nbsp; &nbsp; return Plugin_Handled;<br />}<br /><br />public Action Command_EntColor(client, args)<br />{<br />&nbsp; &nbsp; char arg1[64];<br />&nbsp; &nbsp; char arg2[64];<br />&nbsp; &nbsp; char arg3[64];<br />&nbsp; &nbsp; char arg4[64];<br />&nbsp; &nbsp; char arg5[64];<br />&nbsp; &nbsp; char name[MAX_NAME_LENGTH];<br /><br />&nbsp; &nbsp; if (args &lt; 3)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] Usage: sm_entcolor &lt;entity&gt; &lt;Red 0-255&gt; &lt;Green 0-255&gt; &lt;blue 0-255&gt; &lt;alpha 0-255&gt;&quot;);<br />&nbsp; &nbsp; &nbsp; return Plugin_Handled;<br />&nbsp; &nbsp; }<br />&nbsp;<br />&nbsp; &nbsp; GetCmdArg(1, arg1, sizeof(arg1));<br />&nbsp; &nbsp; GetCmdArg(2, arg2, sizeof(arg2));<br />&nbsp; &nbsp; GetCmdArg(3, arg3, sizeof(arg3));<br />&nbsp; &nbsp; GetCmdArg(4, arg4, sizeof(arg4));<br />&nbsp; &nbsp; GetCmdArg(5, arg5, sizeof(arg5));<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new horse = FindEntityByClassname(-1, arg1);<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new donkey = StringToInt(arg2);<br />&nbsp; &nbsp; new penguin = StringToInt(arg3);<br />&nbsp; &nbsp; new anteater = StringToInt(arg4);<br />&nbsp; &nbsp; new angel = StringToInt(arg5);<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; for(new x = 0; x &gt; horse; x++) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; SetEntityRenderColor(horse, donkey, penguin, anteater, angel);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; GetClientName(client, name, sizeof(name));<br />&nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] You Changed %s's color Red: %d; Green: %d; Blue: %d; Alpha: %d &quot;, horse, donkey, penguin, anteater, angel);<br />&nbsp;<br />&nbsp; &nbsp; return Plugin_Handled;<br />}<br /><br />public Action Command_EntModel(client, args)<br />{<br />&nbsp; &nbsp; char arg1[64];<br />&nbsp; &nbsp; char arg2[64];<br />&nbsp; &nbsp; char name[MAX_NAME_LENGTH];<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if (args &lt; 3)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] Usage: sm_entmodel &lt;entity &gt; &lt;model&gt;&quot;);<br />&nbsp; &nbsp; &nbsp; return Plugin_Handled;<br />&nbsp; &nbsp; }<br />&nbsp;<br />&nbsp; &nbsp; GetCmdArg(1, arg1, sizeof(arg1));<br />&nbsp; &nbsp; GetCmdArg(2, arg2, sizeof(arg2));<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new horse = FindEntityByClassname(-1, arg1);<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new x = 0; x &gt; horse; x++) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; SetEntityModel(horse, arg2);<br />&nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; GetClientName(client, name, sizeof(name));<br />&nbsp; &nbsp; ReplyToCommand(client, &quot;[SM] The Model for %s has been changed to %s&quot;, arg1, arg2);<br />&nbsp;<br />&nbsp; &nbsp; return Plugin_Handled;<br />}</code><hr />
</div>For Joanne;</div>

Wyświetl pełny artykuł




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

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