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

[CS:GO/CS:S] Simple Weapon Restrictor


  • 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 20.06.2016 16:21

<div><font size="6">Simple Weapon Restrictor</font><br />This plugin simply restricts weapons, so they can't be used. All weapons can easily be restricted by the use of commands or the config file. The plugin is &quot;sv_cheats&quot;-friendly, and it's impossible to equip a restricted weapon. (If that's not the case, please contact me)<br /><br /><font size="4">Feature list</font><ul><li>Very simple to use</li>
<li>Prevent specific weapons from being used</li>
<li>Control restricted weapons through commands</li>
<li>Easy-to-use config file for permanent restrictions</li>
</ul><br /><font size="4">Commands</font><ul><li>wr_restrict &lt;weapon<b>*</b>&gt; - Restricts the given weapon.</li>
<li>wr_unrestrict &lt;weapon<b>*</b>&gt; - Unrestricts the given weapon.</li>
<li>wr_reload - Reloads the config files. (<b>Note:</b> This removes all temporary restrictions.)</li>
</ul>All commands require the config admin flag.<br /><b>*:</b> The weapon parameter can either be the classname (e.g. weapon_awp) or the weapon alias (e.g. awp). It's also case-insensitive.<br /><br /><font size="4">Config</font><br />The config adds a neat and simple way to permanently restrict weapons. It's not needed and does not have to be present at all. The config is located in <b>addons/sourcemod/configs/restricted_weapons.txt</b>. It's a plain text file, where each line is an entry in the restrictions list. A line consists of just a weapon alias, which works the same way as the commands. The plugin will yield warning, if a line is an invalid weapon or if the same weapon is listed multiple times. An example of a config file could be:<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">awp<br />p90<br />weapon_Glock<br />rpg<br />weapon_deagle<br />weapon_stunstick<br />P90</code><hr />
</div>The config uses both class names and aliases, but there's some invalid weapons and some other weapons are listed multiple times. The plugin skips the invalid entries and works fine even with errors in the config, but it does print some warnings in the console to assist the server manager:<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">[WR] Config file: WARNING - Invalid entry: rpg! (Line: 4)<br />[WR] Config file: WARNING - Invalid entry: stunstick! (Line: 6)<br />[WR] Config file: WARNING - Duplicate entry: p90! (Line: 7)<br />[WR] Config file: Loaded 4 restriction(s).</code><hr />
</div>This makes it easy to identify mistakes. It loaded 4 restrictions in total: awp, p90, glock, and deagle. The other lines were simply skipped. A more detailed description of the loading process can be seen with debug enabled. The ConVar config is located in <b>cfg/sourcemod/restricted_weapons.txt</b><br /><br /><font size="4">Installation</font><br />If you want to utilize the config file, then you have to manually create the file: <b>addons/sourcemod/configs/restricted_weapons.txt</b>. Otherwise, it's a normal plugin installation.<br /><br /><font size="4">ConVars</font><ul><li>wr_debug (<b>default:</b> false/0) - Prints debug information to the console.</li>
<li>wr_version - The current version of the plugin.</li>
</ul><br /><font size="4">Plans</font><ul><li>Commenting in config file</li>
<li>Listing restrictions</li>
<li>Further customization</li>
</ul>I see this plugin as done, because I want to keep it simple. But I'm open for suggestions.<br /><br /><font size="4">Notes</font><br />This plugin must be compiled with SourceMod v1.8 or higher.<br />I know this plugin isn't anything major, but I've been working with SourcePawn for about a year now, and I've mostly done private plugins. I thought this simple plugin, which I made for a friend, might be a good start on AM. So, yea, this is also my first post, so the formatting might be odd. Thanks for giving my plugin a look!</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/sp.gif"alt="File Type: sp" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="http://www.sourcemod...10"><strong>GetPlugin</strong></a> or
<a href="https://forums.allie...1466436035">GetSource</a> (SimpleWeaponRestrictor.sp - 9.1 KB)


</td>
</tr><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...trictor.smx</a>(17.7 KB)


</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