<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;">/**
* Gets the respawn time of a team.
*
* @param iTeam Team number.
* @return Return team's respawn time.
*/</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;">/**
* If the client is respawning then this returns the respawn time of the client.
*
* @param iClient Client index.
* @return Return client's respawn time.
*/</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;">/**
* Sets the respawn time of the client.
* !!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!
*
* @param iClient Client index.
* @param flRespawnTime Respawn time.
* @return Return true if the client's respawn time has been set.
*/</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;">/**
* If the client is respawning then this update their current respawn time.
*
* @param iClient Client index.
* @param flUpdatedRespawnTime Updated respawn time (can be negative).
* @return Return true if the client's respawn time has been updated.
*/</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;">/**
* Sets the respawn time of a team.
* !!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!
*
* @param iTeam Team number.
* @param flNewRespawnTime New respawn time.
* @return Return true if the team's respawn time has been set.
*/</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;">/**
* Updates the respawn time of all clients in a team (similar to TF2_UpdateClientRespawnTime).
*
* @param iTeam Team number.
* @param flUpdatedRespawnTime Updated respawn time (can be negative).
* @return Return true if the client's respawn time has been updated.
*/</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;">/**
* Called when the game sets the client's respawn time.
* Return Plugin_Changed to override the respawn time.
* Return Plugin_Continue to keep the same.
*
* @param iClient Client Index.
* @param flRespawnTime The respawn time set.
*/</span>
forward Action TF2_OnClientRespawnTimeSet<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;">/**
* Called when the game updates the current respawn time for a team.
* Return Plugin_Changed to override the new respawn time.
* Return Plugin_Continue to keep the same.
*
* @param iTeam Team number.
* @param flNewRespawnTime The new respawn time.
*/</span>
forward Action TF2_OnTeamRespawnTimeChanged<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;">/**
* Called when the game updates the current respawn time of a team, and changes the respawn time of all respawning clients.
* Return Plugin_Changed to override the new respawn time.
* Return Plugin_Continue to keep the same.
*
* @param iClient Client Index.
* @param flUpdatedRespawnTime The respawn time set.
*/</span>
forward Action TF2_OnClientRespawnTimeUpdated<span style="color: #000000;">(</span>int iClient,<span style="color: #00c0c0;">float</span> &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ł
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.
|
Guest Message by DevFuse
[TF2] Respawn System API!
Temat rozp. Adminek AMXX.PL, 30.04.2016 21:47
Brak odpowiedzi do tego tematu
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych