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

[ANY] Simple Mysql Whitelist


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

Napisano 28.08.2016 20:18

<div><div align="center"><font size="6"><b><u>Simple Mysql Whitelist</u></b></font><br /><font size="2">Mysql database whitelister to control player access to server[s].</font><br /><br /><font size="3">Currently Tested <b><font color="RoyalBlue">[CSS][CS:GO]</font></b></font></div><br /><br /><font size="4"><b>Description:</b></font><br /><div style="margin: 5px;">
<div class="smallfont" style="margin-bottom: 2px;">
<b>Spoiler</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button">
</div>
<div class="alt2" style="border: 1px inset; padding: 6px;">
<div class="spoiler" style="display: none;"><br />As i've seen some &quot;<b>Advanced</b>&quot; and &quot;<b>old/outdated</b>&quot; mysql whitelist's i decided to rewrite one more Simple yet functional whitelist to today's standards including all code being written in SourcePawn Transitional Syntax.<br /><br />Plugin used as Base: <a href="https://forums.allie...d.php?t=162859" target="_blank">https://forums.allie...t=162859</a><br /></div>
</div>
</div><br /><br /><font size="4"><b>Requirements:</b></font><ul><li>A mysql database <font size="1">(obviously)</font></li>
</ul><br /><font size="4"><b>Cvars:</b></font><ul><li>All cvars including menu requires Admin-Root access.</li>
</ul><ul><li><b>sm_whitelist</b> <u>Opens the menu to list/remove</u></li>
<li><b>sm_whitelist_add</b> <u>Add a steamid to the database.</u></li>
<li><b>sm_whitelist_delete</b> <u>Deletes a steamid from the database.</u></li>
<li><b>sm_whitelist_list</b> <u>List all SteamIDs in the database.</u></li>
</ul><br /><font size="4"><b>Installation:</b></font><br /><div style="margin: 5px;">
<div class="smallfont" style="margin-bottom: 2px;">
<b>Spoiler</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button">
</div>
<div class="alt2" style="border: 1px inset; padding: 6px;">
<div class="spoiler" style="display: none;"><br /><br /><b>Step 1.</b> Create a mysql database named <b>mysql_whitelist</b> &lt;- This is the default name, Any named can be used, but it requires you to adjust the table name in the <b>.sp</b> file itself and have a recompile!<br /><br /><b>Step 2.</b> Goto your mysql database and make a new sql query with the following data:<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">SET SQL_MODE=&quot;NO_AUTO_VALUE_ON_ZERO&quot;;<br /><br />CREATE TABLE IF NOT EXISTS `mysql_whitelist` (<br />&nbsp; `steamid` text CHARACTER SET utf8 COLLATE utf8_danish_ci<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1;</code><hr />
</div><b>Step 3.</b> Throw the compiled smx into plugins folder.<br /><br /><b>Step 4.</b> Head to your <b>addonssourcemodconfigsdatabases.cfg</b> and put the below with correct information.<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">&quot;whitelister&quot; //do not change this name<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;driver&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mysql&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;host&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;Your hostname here&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;database&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mysql_whitelist&quot; //Database table name here<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;user&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;Username here&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;pass&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;Password here&quot;<br />}</code><hr />
</div></div>
</div>
</div><br /><br /><font size="4"><b>Notice This!:</b></font><br /><div style="margin: 5px;">
<div class="smallfont" style="margin-bottom: 2px;">
<b>Spoiler</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button">
</div>
<div class="alt2" style="border: 1px inset; padding: 6px;">
<div class="spoiler" style="display: none;"><br />Once everything is set, you'll have to add yourself to the database, this is done by going to your mysql database name, then click it, and click the database table name, then you'll see a &quot;<b>insert</b>&quot; button click this, now you'll see a box where you simply put your steam2 id, they look like this <b>STEAM_0:0:12345678</b> Then you click &quot;<b>GO</b>&quot;<br /><br />Then your done and ready to load up the server and connect! From there you can add steamids from ingame to database.<br /></div>
</div>
</div><br /><br /><font size="4"><b>Changelog:</b></font><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">1.0 - Plugin release</code><hr />
</div></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...01"><strong>Get Plugin</strong></a> or
<a href="https://forums.allie...1472411420">Get Source</a> (simple_mysql_whitelist.sp - 10.8 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