Raised This Month: $ Target: $400
 0% 

[L4D2] - ready up reloaded


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
jess
Member
Join Date: Aug 2015
Location: mb
Plugin ID:
4861
Plugin Version:
1.a.1
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    based off of another author's abandoned plugin code.
    Old 10-20-2015 , 15:32   [L4D2] - ready up reloaded
    Reply With Quote #1

    Ready Up - Reloaded
    alpha version


    IMPORTANT INFORMATION: 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.

    Description: 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.

    Installation: My plugin has only one dependency. You must have Left 4 Downtown 2, and you can get it over here: https://forums.alliedmods.net/showthread.php?t=134032
    Download the readyup-reloaded_alpha.zip located at the bottom of this post, and extract the contents to /left4dead2/addons/sourcemod/
    Plugin directories have already been setup to mirror the sourcemod installation directory.

    Usage: 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:

    OnFirstClientLoaded() -> OnAllClientsLoaded() -> OnReadyUpStart()* -> OnReadyUpEnd()* -> OnRoundStart() -> OnRoundEnd() -> OnMapAboutToEnd()**
    *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.
    **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.
    Please Note: OnReadyUpStart automatically triggers when the round resets; the teams swap in versus, or all players respawn in coop.

    Plugins: 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.

    Ready Up - Timer - Adds a timer to the pre-game ready up period to determine when ready up ends. It will create a config in /cfg/sourcemod/
    Ready Up - Rotation - 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
    Ready Up - RPG - With the framework currrently in-development and available at !--- 162.248.92.192:27015 ready up development ---! for testing, via the !rpg command - however, it currently does not require ready-up-reloaded to function!



    Code:
    sm_readyup_timer_pregame - how many seconds (integer) until ready up period is ended after all players join the game.
    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.
    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.
    rur_maprotation_delay - Default is 3 seconds. Will display a notice to players in chat of next map and how long until it loads. sm_dynamicslots_playable - the number of players who can actually play in the server. It adds spectator count to this.
    sm_dynamicslots_kicking - if 1, we kick the player with the shortest  play time, otherwise the player with the longest playtime.


    Forwards: 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.
    PHP Code:
    /*
     *
     *        This forward is triggered, immediately, when any survivor player leaves the safe area
     *        for the first time, but ONLY after OnReadyUpEnd has fired. Otherwise the player will just be
     *        teleported back into the safe area.
     *
     */
    forward OnRoundStart();

    /*
     *
     *        When the survivors successfully clear a level in campaign, as well as when a round ends
     *        in versus or survival, this forward will be called.
     *
     */
    forward OnRoundEnd();

    /*
     *
     *        Triggers when the first connected user triggers OnClientPostAdminCheck on a new map.
     *        This will only trigger ONE TIME per map, and will not trigger for a user that disconnects
     *        prior to this stage.
     *
     */
    forward OnFirstClientLoaded();

    /*
     *
     *        Triggers when the last connecting client successfully clears OnClientPostAdminCheck. When
     *        a client disconnects from the server, if OnAllClientsLoaded hasn't already been called, it
     *        will check to see if all clients have loaded.
     *
     */
    forward OnAllClientsLoaded();

    /*
     *
     *        This forward is triggered when all clients have successfully loaded or, in versus game-types
     *        after a round ends, and when teams have switched sides. This forward fires BEFORE OnRoundStart().
     *        NOTE:    This forward can be forced by another plugin using the OnReadyUpStartEx native, and can be
     *                forced at any time, even before OnFirstClientLoaded has fired.
     *
     */
    forward OnReadyUpStart();

     
    /*
      *
      *        This forward is fired when the first survivor player leaves the safe area AFTER OnReadyUpEnd has fired.
      *        Note:    It will ALWAYS fire before OnRoundStart, but immediately before if the core plugin is allowed to fire
      *                OnReadyUpEnd. However, if another plugin called OnReadyUpEndBlock, this forward will only fire when
      *                another plugin calls it, so it's important that a plugin actually call it if the core plugin is blocked
      *                from calling it, itself, otherwise the ready up period will never end.
      *
      */
    forward OnReadyUpEnd();

    /*
     *
     *    This forward is called when the last round is completed on a map in versus, or when the survivors in coop
     *    successfully clear the level.
     *
     */
    forward OnMapAboutToEnd(); 
    Natives:
    PHP Code:
    /*
      *
      *        This native allows a plugin to force OnreadyUpStart to fire in the core plugin.
      *        Note:    Forcing it in this way only works if it hasn't already been called by the core plugin.
      *
      */
     
    native OnReadyUpStartEx();

     
    /*
      *
      *        This native allows a plugin to force OnReadyUpEnd to fire. This is useful if a plugin has disabled the core plugins
      *        ability to fire OnReadyUpEnd. Correction, it's not useful in this scenario, it's required.
      *
      */
     
    native OnReadyUpEndEx();

     
    /*
      *
       *        This native allows a plugin to prevent the core ready up  plugin from being able to end the ready up period. This means
      *         that another plugin must call OnReadyUpEndEx to end the ready up  period at some point, or the round will obviously never begin.
      *
      */
     
    native OnReadyUpEndBlock();

     
    /*
      *
       *        No explanation needed, here... It really just gives the ready  up core plugin back the ability to end the ready up period without
       *        another plugin having to force it to fire. If a plugin takes  away ready up core's ability to do this, it's important to call this
      *        native if a plugin that blocks it unloads, for any reason.
      *
      */
     
    native OnReadyUpEndAllow(); 
    Other Notes / Extra Reminders: Should have edited this a while a go! Fully tested, working on dev server. If feedback, let me know, thanks!
    Attached Files
    File Type: zip readyup_r1.a.1.zip (32.2 KB, 637 views)

    Last edited by jess; 12-10-2015 at 09:39. Reason: text
    jess is offline
     



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 00:58.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode