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] Respawn System API!


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

Napisano 30.04.2016 21:47

<div><b><div align="center"><font size="7"><font color="Navy">[TF2] Respawn System API</font></font></div></b><br /><div align="center"><img src="https://photos-3.dro...;size=1280x960"border="0" alt="" /></div><ul><li><b>Version: 0.1</b></li>
</ul><br /><b><font size="3"><font color="MediumTurquoise">Introduction:</font></font></b><br />Oh no, an other respawn time plugin, wait it's not a new respawn time plugin. :) It's an API, that allows you to control the respawn time! And you don't have to print an ugly message like in other respawn plugins! You can override the client's hud directly! And I made a ton of natives to make your life easier.<br /><br /><b><font size="3"><font color="MediumTurquoise">Description:</font></font></b><ul><li>Allows plugin developpers to control the game's respawn time. <br />You can:</li>
<li>Set the respawn time of a team.</li>
<li>Set the respawn time of a client.</li>
<li>Get the respawn time of a team.</li>
<li>Get the respawn time of a client.</li>
<li>Detect when the game changes the respawn time of a team.</li>
<li>Detect when the game sets the respawn time on the client.</li>
<li>Detect when the game updates the respawn time of a client.</li>
</ul>The inc (with forwards and natives):<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 /><!-- Code block -->
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<pre class="alt2" dir="ltr" style="margin: 0px;padding: 6px;border: 1px inset;width: auto; height: px; text-align: left; overflow: auto"><div class="pawn" style="font-family: monospace;"><span style="color: #cf0020;">//=======[NATIVES]=======</span>

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Gets the respawn time of a team.
&nbsp;*
&nbsp;* @param iTeam&nbsp;&nbsp;Team number.
&nbsp;* @return&nbsp; &nbsp; &nbsp; Return team's respawn time.
&nbsp;*/</span>
native <span style="color: #00c0c0;">float</span> TF2_GetTeamRespawnTime<span style="color: #000000;">(</span>int iTeam<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* If the client is respawning then this returns the respawn time of the client.
&nbsp;*
&nbsp;* @param iClient&nbsp; &nbsp;&nbsp; &nbsp;Client index.
&nbsp;* @return&nbsp; &nbsp; &nbsp; &nbsp; Return client's respawn time.
&nbsp;*/</span>
native <span style="color: #00c0c0;">float</span> TF2_GetClientRespawnTime<span style="color: #000000;">(</span>int iClient<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Sets the respawn time of the client.
&nbsp;* !!WARNING!! Setting a new respawn time with this function, won't update the current respawn time of the client! If you want to update the respawn time use (TF2_UpdateClientRespawnTime) instead!
&nbsp;*
&nbsp;* @param iClient&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Client index.
&nbsp;* @param flRespawnTime&nbsp;&nbsp;Respawn time.
&nbsp;* @return&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return true if the client's respawn time has been set.
&nbsp;*/</span>
native <span style="color: #ff0000;">bool</span> TF2_SetClientRespawnTime<span style="color: #000000;">(</span>int iClient, <span style="color: #00c0c0;">float</span> flRespawnTime<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* If the client is respawning then this update their current respawn time.
&nbsp;*
&nbsp;* @param iClient&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Client index.
&nbsp;* @param flUpdatedRespawnTime&nbsp; &nbsp; Updated respawn time (can be negative).
&nbsp;* @return&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return true if the client's respawn time has been updated.
&nbsp;*/</span>
native <span style="color: #ff0000;">bool</span> TF2_UpdateClientRespawnTime<span style="color: #000000;">(</span>int iClient, <span style="color: #00c0c0;">float</span> flRespawnTime<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Sets the respawn time of a team.
&nbsp;* !!WARNING!! Setting a new respawn time with this function, won't update the current respawn time of respawning clients of a team! If you want to update the respawn time use (TF2_UpdateTeamRespawnTime) instead!
&nbsp;*
&nbsp;* @param iTeam&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Team number.
&nbsp;* @param flNewRespawnTime&nbsp; &nbsp; New respawn time.
&nbsp;* @return&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return true if the team's respawn time has been set.
&nbsp;*/</span>
native <span style="color: #ff0000;">bool</span> TF2_SetTeamRespawnTime<span style="color: #000000;">(</span>int iTeam,<span style="color: #00c0c0;">float</span> flNewRespawnTime<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Updates the respawn time of all clients in a team (similar to TF2_UpdateClientRespawnTime).
&nbsp;*
&nbsp;* @param iTeam&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Team number.
&nbsp;* @param flUpdatedRespawnTime&nbsp; &nbsp; Updated respawn time (can be negative).
&nbsp;* @return&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return true if the client's respawn time has been updated.
&nbsp;*/</span>
native <span style="color: #ff0000;">bool</span> TF2_UpdateTeamRespawnTime<span style="color: #000000;">(</span>int iTeam, <span style="color: #00c0c0;">float</span> flUpdatedRespawnTime<span style="color: #000000;">)</span>;

<span style="color: #cf0020;">//=======[FORWARDS]=======</span>

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Called when the game sets the client's respawn time.
&nbsp;* Return Plugin_Changed to override the respawn time.
&nbsp;* Return Plugin_Continue to keep the same.
&nbsp;*
&nbsp;* @param iClient&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Client Index.
&nbsp;* @param flRespawnTime&nbsp;&nbsp;&nbsp;The respawn time set.
&nbsp;*/</span>
forward Action TF2_OnClientRespawnTimeSet<span style="color: #000000;">(</span>int iClient,<span style="color: #00c0c0;">float</span> &amp;flRespawnTime<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Called when the game updates the current respawn time for a team.
&nbsp;* Return Plugin_Changed to override the new respawn time.
&nbsp;* Return Plugin_Continue to keep the same.
&nbsp;*
&nbsp;* @param iTeam&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Team number.
&nbsp;* @param flNewRespawnTime&nbsp; &nbsp; The new respawn time.
&nbsp;*/</span>
forward Action TF2_OnTeamRespawnTimeChanged<span style="color: #000000;">(</span>int iTeam,<span style="color: #00c0c0;">float</span> &amp;flNewRespawnTime<span style="color: #000000;">)</span>;

<span style="color: #ff0000; font-style: italic;">/**
&nbsp;* Called when the game updates the current respawn time of a team, and changes the respawn time of all respawning clients.
&nbsp;* Return Plugin_Changed to override the new respawn time.
&nbsp;* Return Plugin_Continue to keep the same.
&nbsp;*
&nbsp;* @param iClient&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Client Index.
&nbsp;* @param flUpdatedRespawnTime&nbsp; &nbsp; The respawn time set.
&nbsp;*/</span>
forward Action TF2_OnClientRespawnTimeUpdated<span style="color: #000000;">(</span>int iClient,<span style="color: #00c0c0;">float</span> &amp;flUpdatedRespawnTime<span style="color: #000000;">)</span>;</div></pre>
</div>
<!-- /Code block --></div>
</div>
</div><br /><br /><b><font size="3"><font color="MediumTurquoise">Installation:</font></font></b><ul><li>Download tf2_respawn_system_core.smx and put it into your plugins folder.</li>
<li>Download tf2_respawn.inc and put into your include folder.</li>
<li>(Optional) Download tf2_respawn_system_core.sp and put into your scripting folder.</li>
</ul><br /><b><font size="3"><font color="MediumTurquoise">Bugs:</font></font></b><ul><li>None.</li>
</ul><br /><b><font size="3"><font color="MediumTurquoise">List of plugins working with this API:</font></font></b><ul><li>None (A plugin, and a example plugin are comming).</li>
</ul><br /><a href="https://github.com/B...awn-System-API"target="_blank">Git-Hub Link</a></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...89"><strong>GetPlugin</strong></a> or
<a href="https://forums.allie...1462049267">GetSource</a> (tf2_respawn_system_core.sp - 11.3 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...em_core.smx</a>(8.4 KB)


</td>
</tr><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...respawn.inc</a>(3.5 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