Raised This Month: $51 Target: $400
 12% 

[ND] Surrender and Mutiny Votes - V1.3


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Player 1
Member
Join Date: Apr 2012
Plugin ID:
3225
Plugin Version:
1.3
Plugin Category:
Gameplay
Plugin Game:
Nuclear Dawn
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    A more reliable voting system than Nuclear Dawn's surrender and mutiny functions.
    Old 09-08-2012 , 12:10   [ND] Surrender and Mutiny Votes - V1.3
    Reply With Quote #1

    Description:
    If you've played Nuclear Dawn, you probably know how unreliable the surrender and mutiny voting can be. Sometimes a vote will freeze with one more 'yes' needed; sometimes a surrender vote will fail and not be available again; sometimes players are unable to cast their votes at all! ND Votes will fix this with SourceMod vote menus.


    Plugin Features:
    * Will override Nuclear Dawn's surrender and mutiny votes, and replace them with its own functions.
    * The in-game GUI Mutiny and Surrender buttons are still fully functional.
    * Integrates previously existing Cvars
    * Support for translations
    * Votes can be canceled with sm_cancelvote

    Cvars:
    • nd_commander_surrender_surpress_time | Default: 1 | Time in minutes that must pass before a team may start a new surrender vote.
    • nd_commanders_only_surrender_vote | Default: 1 | (0 | 1) - Only commanders can start surrender votes?
    • nd_commander_surrender_min_players | Default: 2 | Number of real players on a team required to start a surrender vote.
    • nd_commander_surrender_vote_threshold | Default: 51 | Percentage of 'yes' votes required to surrender.

    • nd_commander_mutiny_surpress_time | Default: 5 | Time in minutes that must pass before a team can start a new mutiny vote.
    • nd_commander_mutiny_min_players | Default: 3 | Minimum number of players required to start a mutiny vote.
    • nd_commander_mutiny_vote_threshold | Default: 51 | Percentage of 'yes' votes required to mutiny.


    • nd_voting_simple_majority | Default: 1 | If 1, a simple majority is all that's needed to pass a surrender or mutiny vote, and no-votes and the threshold Cvars are ignored. If 0, the 'yes' votes divided by the number of players on the team must be greater than or equal to the above threshold, and no-votes are considered a vote for 'no'.

    Installation Instructions:
    * nd_votes.smx goes in /sourcemod/plugins/
    * The included English version of ndvotes.phrases.txt goes to /sourcemod/translations/

    * If your server's language is not English, ndvotes.phrases will need to be translated, then saved in the appropriate language folder under /sourcemod/translations


    Planned Additions:
    * Translations for any requested language (Don't expect this to be perfect)


    Change Log:

    * Version 1.3 (28 October 2012
    Corrected a copy-paste error that could cause mutiny votes to surrender

    * Version 1.2 (28 September 2012)
    Added nd_voting_simple_majority

    * Version 1.1 (28 September 2012) :

    Added two cvars:
    nd_commander_surrender_vote_threshold
    nd_commander_mutiny_vote_threshold

    Other small fixes


    * Initial Release (08 September 2012)



    If you translate the phrases yourself, please post them!
    Attached Files
    File Type: txt ndvotes.phrases.txt (876 Bytes, 331 views)
    File Type: sp Get Plugin or Get Source (nd_votes.sp - 851 views - 14.5 KB)

    Last edited by Player 1; 10-29-2012 at 00:30. Reason: update to V1.3
    Player 1 is offline
    DIMEDROLL
    Junior Member
    Join Date: Apr 2012
    Old 11-01-2013 , 08:19   Re: [ND] Surrender and Mutiny Votes - V1.3
    Reply With Quote #2

    If player gets dropped because of map conflict or no map this error is sent to console.

    Quote:
    Client "Bla bla" connected (). L 11/01/2013 - 14:07:23: [SM] Native "GetClientTeam" reported: Client 15 is not in game L 11/01/2013 - 14:07:23: [SM] Displaying call stack trace for plugin "nd_votes.smx": L 11/01/2013 - 14:07:23: [SM] [0] Line 417, /home/groups/alliedmodders/forums/files/1/7/9/3/9/7/111565.attach::OnClientDisconnect()

    Last edited by DIMEDROLL; 11-01-2013 at 08:19.
    DIMEDROLL is offline
    RU_6uK
    SourceMod Donor
    Join Date: May 2010
    Old 11-02-2013 , 08:06   Re: [ND] Surrender and Mutiny Votes - V1.3
    Reply With Quote #3

    Try this. Line 415.

    PHP Code:
    public OnClientDisconnect(client)
    {
        if(!
    IsClientInGame(client)) return;
        new 
    iTeam GetClientTeam(client)
        
        if (
    iTeam && client == g_iCommanders[iTeam 2])
        {
            
    g_iCommanders[iTeam 2] = -1;
            
            if (
    g_hVoteHandle != INVALID_HANDLE && IsVoteInProgress() && g_iCurrentVoteInfo[VOTE_INFO_TEAM] == iTeam && g_iCurrentVoteInfo[VOTE_INFO_TYPE] == VOTETYPE_MUTINY)
                    
    CancelVote();
        }


    Last edited by RU_6uK; 11-02-2013 at 08:09.
    RU_6uK is offline
    DIMEDROLL
    Junior Member
    Join Date: Apr 2012
    Old 11-02-2013 , 09:08   Re: [ND] Surrender and Mutiny Votes - V1.3
    Reply With Quote #4

    Thanks, The only thing you added is
    if(!IsClientInGame(client)) return;

    am I right?

    I used this web compiler to compile code:
    http://www.sourcemod.net/compiler.php

    Last edited by DIMEDROLL; 11-02-2013 at 09:18.
    DIMEDROLL is offline
    RU_6uK
    SourceMod Donor
    Join Date: May 2010
    Old 11-02-2013 , 09:24   Re: [ND] Surrender and Mutiny Votes - V1.3
    Reply With Quote #5

    Yes. Simple way to compile is http://spider.limetech.org/
    RU_6uK is offline
    DIMEDROLL
    Junior Member
    Join Date: Apr 2012
    Old 11-02-2013 , 09:28   Bug fix version
    Reply With Quote #6

    Thank you, this fixed that error. I attached a fixed version.
    Attached Files
    File Type: sp Get Plugin or Get Source (nd_votes.sp - 738 views - 14.5 KB)

    Last edited by DIMEDROLL; 11-02-2013 at 09:29.
    DIMEDROLL is offline
    Reply



    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 22:18.


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