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] TF2 Item DB (replaces tf2itemsinfo)


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

Napisano 22.01.2015 06:33

<!-- BEGIN TEMPLATE: postbit_external -->
<div>This is a library that will allow you to query items or search for them with a specified criteria. For example you can check which slot an item uses or get all items in the melee slot for snipers.<br /><br />This plugin is meant to replace tf2itemsinfo which has memory leaks and other problems that cannot be fixed and will eventually become permanently broken due to how long it takes to run and that it uses almost the maximum number of handles.<br /><br />This plugin work by storing the data in sqlite. A python script is used to update the database. I decided to do it this way because it is a bad idea to put a 10+ second loading time into your server especially when there is time limit for plugins now and is much faster in python. It is recommended to run this after every update.<br /><br />If you do not have python on your server, you can always run it on your computer and upload it to your server.<br /><br /><b>We need people to start porting plugins to use tf2idb.</b> I have tried to make the functions close to tf2itemsinfo but unfortunately I could not make them all the same because they were too inefficient, especially for SQLite.<br /><br />With the TF2IDB_FindItemCustom function, you can create arbitrary SQL queries which should be much faster and much more flexible than the finditem function in tf2itemsinfo.<br /><br /><b>How to initialize the database</b><br />You need to first edit tf2idb.py and edit the first 2 lines to point to the sourcemod sql folder and items_games.txt<br /><br /><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<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">native bool:TF2IDB_IsValidItemID(id);<br />native bool:TF2IDB_GetItemName(id, const String:string[], length);<br />native bool:TF2IDB_GetItemClass(id, const String:string[], length);<br />native bool:TF2IDB_GetItemSlotName(id, const String:string[], length);<br />native TF2ItemSlot:TF2IDB_GetItemSlot(id);<br />native bool:TF2IDB_GetItemQualityName(id, const String:string[], length);<br />native TF2ItemQuality:TF2IDB_GetItemQuality(id);<br />native bool:TF2IDB_GetItemLevels(id, &amp;min, &amp;max);<br />native TF2IDB_GetItemAttributes(id, aid[MAX_ATTRIBUTES], Float:values[MAX_ATTRIBUTES]);<br />native Handle:TF2IDB_GetItemEquipRegions(id);<br />native bool:TF2IDB_DoRegionsConflict(const String:region1[], const String:region2[]);<br />native Handle:TF2IDB_ListParticles();<br />native Handle:TF2IDB_FindItemCustom(const String:query[]);<br />native bool:TF2IDB_ItemHasAttribute(id, aid);</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->If you are creating items, you will want to filter out items with string attributes like this.<br /><br /><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<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">TF2IDB_FindItemCustom(&quot;SELECT id FROM tf2idb_item WHERE has_string_attribute=0&quot;)</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable --></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.../attach/sp.gif"alt="File Type: sp" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="http://www.sourcemod...56"><strong>GetPlugin</strong></a> or
<a href="https://forums.allie...1421901958">GetSource</a> (tf2idb.sp - 11.0 KB)


</td>
</tr>
<!-- END TEMPLATE: postbit_attachment --><!-- BEGIN TEMPLATE: postbit_attachment -->
<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...>tf2idb.inc</a>(2.3 KB)


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


<a href="https://forums.allie...>tf2idb.zip</a>(3.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