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

[L4D2] - ready up reloaded


  • 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 20.10.2015 20:32

<div><b><font size="4"><font face="Tahoma">Ready Up - Reloaded<br /></font></font></b><font size="4"><font face="Tahoma"><font size="2">alpha version<br /><br /><br /><b>IMPORTANT INFORMATION: </b>This is an alpha release. It is untested; I don't have a left 4 dead 2 server or the game installed. Any server operators who can help to test the plugin and report errors would be greatly appreciated! This is my first plugin and is based off of source code from both Downtown1's ready up and Skyy's ready up.<br /><br /><b>Description: </b>After seeing a demand for a ready up type of plugin still for left 4 dead 2, and both versions I found abandoned, I decided to try to write my own. This plugin should correct many of the problems with other ready up plugins, at least when it is no longer in alpha or beta version.<br /><br /><b>Installation:</b> My plugin has only one dependency. You must have Left 4 Downtown 2, and you can get it over here: <a href="https://forums.allie...d.php?t=134032"target="_blank">https://forums.allie...t=134032</a><br />Download the readyup-reloaded_alpha.zip located at the bottom of this post, and extract the contents to /left4dead2/addons/sourcemod/<br />Plugin directories have already been setup to mirror the sourcemod installation directory.<br /><br /><b>Usage:</b> The Ready Up Reloaded plugin consists of a core file that provides a few natives. It also has some functionality in case there are no other plugins running that are utilizing ready up natives. The order is as follows without any plugins altering its course:<br /><br />OnFirstClientLoaded() -&gt; OnAllClientsLoaded() -&gt; OnReadyUpStart()* -&gt; OnReadyUpEnd()* -&gt; OnRoundStart() -&gt; OnRoundEnd() -&gt; OnMapAboutToEnd()**<br />*Two forwards can be forced at any time (as long as they have not fired, yet) by another plugin. These are OnReadyUpStart, which can be called even before OnFirstClientLoaded, and OnReadyUpEnd, which can only be called once OnReadyUpStart has fired.<br />**OnMapAboutToEnd fires immediately after OnRoundEnd if it's the last round of the map or when the survivors in coop have successfully completed the map.<br />Please Note: OnReadyUpStart automatically triggers when the round resets; the teams swap in versus, or all players respawn in coop.<br /><br /><b>Plugins: </b>The following plugins use the natives and forwards in this plugin, so they require it to work. They are both in the zip on this post. I have also included my own version of a dynamic server slot plugin, that does not require this plugin or any other plugin to work.<br /><br /><u>Ready Up - Timer</u> - Adds a timer to the pre-game ready up period to determine when ready up ends. It will create a config in /cfg/sourcemod/<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">sm_readyup_timer_pregame - how many seconds (integer) until ready up period is ended after all players join the game.<br />sm_readyup_timer_readyup - if it is 1 then players can say !ready to toggle their ready status from on and off. Otherwise they have to wait the entire pregame time.</code><hr />
</div><u>Ready Up - Rotation</u> - Adds a map rotation to the server. It also includes an option to enable/disable player map voting during the finale. It requires an already-existing config in /left4dead2/addons/sourcemod/configs/ named rur_rotation.cfg<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">rur_maprotation_voting - if 1, voting for the next campaign is allowed using !mapvote, otherwise the next campaign will be in the rotation. Voting can occur at any time during the final level of a campaign, and players can recast their ballot at any time.</code><hr />
</div><u>Dynamic Slots</u> - Will alter the available and maximum slots on the server when a player connects or leaves the server. It does not require ready up reloaded or any other plugin to work.<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">sm_dynamicslots_playable - the number of players who can actually play in the server. It adds spectator count to this.<br />sm_dynamicslots_kicking - if 1, we kick the player with the shortest play time, otherwise the player with the longest playtime.</code><hr />
</div><b>Forwards:</b> My plugin provides several useful (to left 4 dead 2) natives and forwards for left4dead2 plugin developers. I've copied the readyup.inc file to list them below.<br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">/*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;forward&nbsp;is&nbsp;triggered,&nbsp;immediately,&nbsp;when&nbsp;any&nbsp;survivor&nbsp;player&nbsp;leaves&nbsp;the&nbsp;safe&nbsp;area<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;the&nbsp;first&nbsp;time,&nbsp;but&nbsp;ONLY&nbsp;after&nbsp;OnReadyUpEnd&nbsp;has&nbsp;fired.&nbsp;Otherwise&nbsp;the&nbsp;player&nbsp;will&nbsp;just&nbsp;be<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;teleported&nbsp;back&nbsp;into&nbsp;the&nbsp;safe&nbsp;area.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnRoundStart</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When&nbsp;the&nbsp;survivors&nbsp;successfully&nbsp;clear&nbsp;a&nbsp;level&nbsp;in&nbsp;campaign,&nbsp;as&nbsp;well&nbsp;as&nbsp;when&nbsp;a&nbsp;round&nbsp;ends<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;versus&nbsp;or&nbsp;survival,&nbsp;this&nbsp;forward&nbsp;will&nbsp;be&nbsp;called.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnRoundEnd</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Triggers&nbsp;when&nbsp;the&nbsp;first&nbsp;connected&nbsp;user&nbsp;triggers&nbsp;OnClientPostAdminCheck&nbsp;on&nbsp;a&nbsp;new&nbsp;map.<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;will&nbsp;only&nbsp;trigger&nbsp;ONE&nbsp;TIME&nbsp;per&nbsp;map,&nbsp;and&nbsp;will&nbsp;not&nbsp;trigger&nbsp;for&nbsp;a&nbsp;user&nbsp;that&nbsp;disconnects<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prior&nbsp;to&nbsp;this&nbsp;stage.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnFirstClientLoaded</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Triggers&nbsp;when&nbsp;the&nbsp;last&nbsp;connecting&nbsp;client&nbsp;successfully&nbsp;clears&nbsp;OnClientPostAdminCheck.&nbsp;When<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;client&nbsp;disconnects&nbsp;from&nbsp;the&nbsp;server,&nbsp;if&nbsp;OnAllClientsLoaded&nbsp;hasn't&nbsp;already&nbsp;been&nbsp;called,&nbsp;it<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;check&nbsp;to&nbsp;see&nbsp;if&nbsp;all&nbsp;clients&nbsp;have&nbsp;loaded.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnAllClientsLoaded</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;forward&nbsp;is&nbsp;triggered&nbsp;when&nbsp;all&nbsp;clients&nbsp;have&nbsp;successfully&nbsp;loaded&nbsp;or,&nbsp;in&nbsp;versus&nbsp;game-types<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;after&nbsp;a&nbsp;round&nbsp;ends,&nbsp;and&nbsp;when&nbsp;teams&nbsp;have&nbsp;switched&nbsp;sides.&nbsp;This&nbsp;forward&nbsp;fires&nbsp;BEFORE&nbsp;OnRoundStart().<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NOTE:&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;forward&nbsp;can&nbsp;be&nbsp;forced&nbsp;by&nbsp;another&nbsp;plugin&nbsp;using&nbsp;the&nbsp;OnReadyUpStartEx&nbsp;native,&nbsp;and&nbsp;can&nbsp;be<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forced&nbsp;at&nbsp;any&nbsp;time,&nbsp;even&nbsp;before&nbsp;OnFirstClientLoaded&nbsp;has&nbsp;fired.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnReadyUpStart</span><span style="color: #007700">();<br /><br />&nbsp;</span><span style="color: #FF8000">/*<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;forward&nbsp;is&nbsp;fired&nbsp;when&nbsp;the&nbsp;first&nbsp;survivor&nbsp;player&nbsp;leaves&nbsp;the&nbsp;safe&nbsp;area&nbsp;AFTER&nbsp;OnReadyUpEnd&nbsp;has&nbsp;fired.<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note:&nbsp;&nbsp;&nbsp;&nbsp;It&nbsp;will&nbsp;ALWAYS&nbsp;fire&nbsp;before&nbsp;OnRoundStart,&nbsp;but&nbsp;immediately&nbsp;before&nbsp;if&nbsp;the&nbsp;core&nbsp;plugin&nbsp;is&nbsp;allowed&nbsp;to&nbsp;fire<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OnReadyUpEnd.&nbsp;However,&nbsp;if&nbsp;another&nbsp;plugin&nbsp;called&nbsp;OnReadyUpEndBlock,&nbsp;this&nbsp;forward&nbsp;will&nbsp;only&nbsp;fire&nbsp;when<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;another&nbsp;plugin&nbsp;calls&nbsp;it,&nbsp;so&nbsp;it's&nbsp;important&nbsp;that&nbsp;a&nbsp;plugin&nbsp;actually&nbsp;call&nbsp;it&nbsp;if&nbsp;the&nbsp;core&nbsp;plugin&nbsp;is&nbsp;blocked<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;calling&nbsp;it,&nbsp;itself,&nbsp;otherwise&nbsp;the&nbsp;ready&nbsp;up&nbsp;period&nbsp;will&nbsp;never&nbsp;end.<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnReadyUpEnd</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;forward&nbsp;is&nbsp;called&nbsp;when&nbsp;the&nbsp;last&nbsp;round&nbsp;is&nbsp;completed&nbsp;on&nbsp;a&nbsp;map&nbsp;in&nbsp;versus,&nbsp;or&nbsp;when&nbsp;the&nbsp;survivors&nbsp;in&nbsp;coop<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;successfully&nbsp;clear&nbsp;the&nbsp;level.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #0000BB">forward&nbsp;OnMapAboutToEnd</span><span style="color: #007700">();&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div><b>Natives:</b><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">/*<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;native&nbsp;allows&nbsp;a&nbsp;plugin&nbsp;to&nbsp;force&nbsp;OnreadyUpStart&nbsp;to&nbsp;fire&nbsp;in&nbsp;the&nbsp;core&nbsp;plugin.<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note:&nbsp;&nbsp;&nbsp;&nbsp;Forcing&nbsp;it&nbsp;in&nbsp;this&nbsp;way&nbsp;only&nbsp;works&nbsp;if&nbsp;it&nbsp;hasn't&nbsp;already&nbsp;been&nbsp;called&nbsp;by&nbsp;the&nbsp;core&nbsp;plugin.<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*/<br />&nbsp;</span><span style="color: #0000BB">native&nbsp;OnReadyUpStartEx</span><span style="color: #007700">();<br /><br />&nbsp;</span><span style="color: #FF8000">/*<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;native&nbsp;allows&nbsp;a&nbsp;plugin&nbsp;to&nbsp;force&nbsp;OnReadyUpEnd&nbsp;to&nbsp;fire.&nbsp;This&nbsp;is&nbsp;useful&nbsp;if&nbsp;a&nbsp;plugin&nbsp;has&nbsp;disabled&nbsp;the&nbsp;core&nbsp;plugins<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ability&nbsp;to&nbsp;fire&nbsp;OnReadyUpEnd.&nbsp;Correction,&nbsp;it's&nbsp;not&nbsp;useful&nbsp;in&nbsp;this&nbsp;scenario,&nbsp;it's&nbsp;required.<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*/<br />&nbsp;</span><span style="color: #0000BB">native&nbsp;OnReadyUpEndEx</span><span style="color: #007700">();<br /><br />&nbsp;</span><span style="color: #FF8000">/*<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;native&nbsp;allows&nbsp;a&nbsp;plugin&nbsp;to&nbsp;prevent&nbsp;the&nbsp;core&nbsp;ready&nbsp;up&nbsp;&nbsp;plugin&nbsp;from&nbsp;being&nbsp;able&nbsp;to&nbsp;end&nbsp;the&nbsp;ready&nbsp;up&nbsp;period.&nbsp;This&nbsp;means<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;another&nbsp;plugin&nbsp;must&nbsp;call&nbsp;OnReadyUpEndEx&nbsp;to&nbsp;end&nbsp;the&nbsp;ready&nbsp;up&nbsp;&nbsp;period&nbsp;at&nbsp;some&nbsp;point,&nbsp;or&nbsp;the&nbsp;round&nbsp;will&nbsp;obviously&nbsp;never&nbsp;begin.<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*/<br />&nbsp;</span><span style="color: #0000BB">native&nbsp;OnReadyUpEndBlock</span><span style="color: #007700">();<br /><br />&nbsp;</span><span style="color: #FF8000">/*<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;explanation&nbsp;needed,&nbsp;here...&nbsp;It&nbsp;really&nbsp;just&nbsp;gives&nbsp;the&nbsp;ready&nbsp;&nbsp;up&nbsp;core&nbsp;plugin&nbsp;back&nbsp;the&nbsp;ability&nbsp;to&nbsp;end&nbsp;the&nbsp;ready&nbsp;up&nbsp;period&nbsp;without<br />&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;another&nbsp;plugin&nbsp;having&nbsp;to&nbsp;force&nbsp;it&nbsp;to&nbsp;fire.&nbsp;If&nbsp;a&nbsp;plugin&nbsp;takes&nbsp;&nbsp;away&nbsp;ready&nbsp;up&nbsp;core's&nbsp;ability&nbsp;to&nbsp;do&nbsp;this,&nbsp;it's&nbsp;important&nbsp;to&nbsp;call&nbsp;this<br />&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;native&nbsp;if&nbsp;a&nbsp;plugin&nbsp;that&nbsp;blocks&nbsp;it&nbsp;unloads,&nbsp;for&nbsp;any&nbsp;reason.<br />&nbsp;&nbsp;*<br />&nbsp;&nbsp;*/<br />&nbsp;</span><span style="color: #0000BB">native&nbsp;OnReadyUpEndAllow</span><span style="color: #007700">();&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div><b>Other Notes / Extra Reminders:</b> I wait for feedback from whether it works or not. If problems, please attach as a file (please do not paste into message) the error log as text. Thank you!<br /></font></font></font></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/zip.gif"alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


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