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] Class Restrictions for bots


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

Napisano 06.11.2013 16:59

<!-- BEGIN TEMPLATE: postbit_external -->
<div>Hello guys!<br /><br />I modified <b><a href="http://forums.allied...ber.php?u=34668" target="_blank">DJ Tsunami</a></b>'s plugin<b> <a href="http://forums.alliedmods.net/showthread.php?t=73104" target="_blank">Tf2 class restrictions</a></b>, so it will limit classes for bots instead.<br />I could not find any plugin for this purpose and default tf2 commands/cvars will not really help you with this. They can force bots to use only one class or not to change class at all, but bots can be kicked when player joins and when he leaves, he will be replaced by a random class bot... or the forced one.You can limit them to use only some classes... I think you get it ;)<br />So I took and modified the code, so it only affects bots. I also removed unnecessary parts of the code and modified cvars so you can use both at the same time.<br /><i><b><br />Cvars:</b></i><br /><!-- BEGIN TEMPLATE: bbcode_php_printable -->
<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">sm_classrestrictbot_enabled&nbsp;1&nbsp;</span><span style="color: #FF8000">//(0/1,&nbsp;default&nbsp;1)&nbsp;Enable/disable&nbsp;restricting&nbsp;classes&nbsp;for&nbsp;bots&nbsp;in&nbsp;TF2.<br /><br /></span><span style="color: #0000BB">sm_classrestrictbot_blu_demomen&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_engineers&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_heavies&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_medics&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_pyros&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_scouts&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_snipers&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_soldiers&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_blu_spies&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br /></span><span style="color: #FF8000">//&nbsp;Limits&nbsp;for&nbsp;Blu&nbsp;classes&nbsp;in&nbsp;TF2.&nbsp;(-1&nbsp;for&nbsp;no&nbsp;limit,&nbsp;0&nbsp;is&nbsp;disabled,&nbsp;1&nbsp;or&nbsp;anything&nbsp;higher&nbsp;will&nbsp;be&nbsp;the&nbsp;limit&nbsp;for&nbsp;that&nbsp;class.&nbsp;Default&nbsp;-1)<br /><br /></span><span style="color: #0000BB">sm_classrestrictbot_red_demomen&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_engineers&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_heavies&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_medics&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_pyros&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_scouts&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_snipers&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_soldiers&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br />sm_classrestrictbot_red_spies&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">1<br /></span><span style="color: #FF8000">//&nbsp;Limits&nbsp;for&nbsp;Red&nbsp;classes&nbsp;in&nbsp;TF2.&nbsp;(-1&nbsp;for&nbsp;no&nbsp;limit,&nbsp;0&nbsp;is&nbsp;disabled,&nbsp;1&nbsp;or&nbsp;&nbsp;anything&nbsp;higher&nbsp;will&nbsp;be&nbsp;the&nbsp;limit&nbsp;for&nbsp;that&nbsp;class.&nbsp;Default&nbsp;-1)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div>
<!-- END TEMPLATE: bbcode_php_printable --><font size="3"><br /><br /></font><i><b>Important info:</b></i><font size="3"><br /></font>Remove cvar tf_bot_force_class, before you start using this plugin.<br />Plugin limits classes when bots spawn, so if you change limits after they have been spawned then you have to wait untill they die or you can slay them.<br /><br /><i><b>Installation:</b></i><br />Copy .smx file to your plugins dir and then put cvars from above into server.cfg or sourcemod.cfg. If you do not include a cvar with it's value then the default value of it will be used, which is -1 = unlimited.<br /><br /><i><b>Credits:</b></i><br />Credit goes to <a href="http://forums.allied...ber.php?u=34668" target="_blank">DJ Tsunami </a>for his plugin. 80% of this plugin is his code. I'm not much of a coder and this is &quot;my&quot; first plugin.</div>


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








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


<a href="http://www.sourcemod...?file_id=127582"><strong>Get Plugin</strong></a> or
<a href="https://forums.allie...38;d=1383762650">Get Source</a> (classrestrictbots.sp - 6.3 KB)


</td>
</tr>
<!-- END TEMPLATE: postbit_attachment -->
</table>
</fieldset>


</div>

<!-- END TEMPLATE: postbit_external -->

Wyświetl pełny artykuł




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

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