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

[CSGO][PugSetup] RoundRestore


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Cruze
Veteran Member
Join Date: May 2017
Plugin ID:
7179
Plugin Version:
1.2
Plugin Category:
All
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Sometimes (player dropped/crashed) which would be disadvantage for a team. It would be very handy to restore the match to the previous round.
    Old 06-30-2020 , 09:13   [CSGO][PugSetup] RoundRestore
    Reply With Quote #1

    Description: Sometimes (player dropped/crashed) which would be disadvantage for a team. It would be very handy to restore the match to the previous round.

    Thanks to: L.O.T for suggestion and for testing.

    Dependencies:
    1) PugSetup (optional)
    2) "mp_backup_round_file_pattern" to default value ("%prefix%_round%round%.txt") [Thinking a way to add support to change in this too. :/ Suggestions and Pull requests are welcome! <3]

    More about this:
    1) https://github.com/splewis/csgo-pug-setup/issues/145
    2) https://forums.alliedmods.net/showthread.php?t=269467
    3) https://forums.alliedmods.net/showthread.php?t=306284

    Post bug reports and suggestions IN THIS THREAD/GITHUB ISSUES ONLY.

    Changelogs:
    Code:
    1.1 - 
    * Two New commands:
    1) sm_restoreround (to restore certain round)(admin only)
    2) sm_deleteallbackuprounds (to delete all backup rounds)(root admin only)
    * Three self-explanatory cvars.
    * Translation file (PR for other languages are welcome in my github)
    1.1fix -
    Fixed translation file name. Thanks to paulo_crash
    1.2 -
    * Fixes in multiple occasions!
    * Translation file name change for no freaking reason.
    * Added support to filename change in mp_backup_round_file
    Sourcecode in GitHub too (PR for translations are welcome)
    Attached Files
    File Type: zip RestartRound-1.1fix.zip (174 Bytes, 440 views)
    File Type: zip RestoreRound1.2.zip (37.1 KB, 934 views)
    __________________
    Taking paid private requests! Contact me

    Last edited by Cruze; 07-04-2020 at 18:17. Reason: Version 1.2
    Cruze is offline
    paulo_crash
    AlliedModders Donor
    Join Date: May 2016
    Location: Brazil
    Old 06-30-2020 , 13:28   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #2

    Thanks for the release.

    I only have a few questions that I would like to confirm even before testing, testing back with feedback, for now...

    Works with both WarMod [BFG] and PUGSetup, right?

    And any suggestions already, from what I could notice any player can use the .stop command and restore the round, right? In the future I could make the command be valid only for the team that lost its player in the case, that is, it will only use the team that is or has been without a player.

    It would also be good to implement a voting system, that is, the majority of the team that would like to use this feature needs to type in the .stop chat.

    Last edited by paulo_crash; 06-30-2020 at 18:57.
    paulo_crash is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 06-30-2020 , 17:07   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #3

    Quote:
    Thanks for the release.

    I only have a few questions that I would like to confirm even before testing, testing back with feedback, for now...

    Works with both WarMod [BG] and PUGSetup, right?
    I've tried PugSetup only, give it a go!
    Quote:
    And any suggestions already, from what I could notice any player can use the .stop command and restore the round, right? In the future I could make the command be valid only for the team that lost its player in the case, that is, it will only use the team that is or has been without a player.
    Good suggestion, will add it in next version with cvar to enable or disable.
    Quote:
    It would also be good to implement a voting system, that is, the majority of the team that would like to use this feature needs to type in the .stop chat.
    Like: "Playername just typed .stop (2/5 votes)" in which 3 votes are required to pause?
    __________________
    Taking paid private requests! Contact me
    Cruze is offline
    paulo_crash
    AlliedModders Donor
    Join Date: May 2016
    Location: Brazil
    Old 06-30-2020 , 18:59   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #4

    Quote:
    Originally Posted by Cruze View Post
    Like: "Playername just typed .stop (2/5 votes)" in which 3 votes are required to pause?
    That, it looks good this way.

    [EDIT]
    Translation errors:
    Code:
    LoadTranslations("PugRestoreRound.phrases");
    Translation file name PugRoundRestore.phrases.txt

    [EDIT2]
    Same thing in the config he creates, in this case the name was changed. But the config I believe is the least:
    Code:
    AutoExecConfig_SetFile("PugRestoreRound");

    Last edited by paulo_crash; 06-30-2020 at 19:26.
    paulo_crash is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 07-01-2020 , 00:03   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #5

    Quote:
    Originally Posted by paulo_crash View Post
    That, it looks good this way.

    [EDIT]
    Translation errors:
    Code:
    LoadTranslations("PugRestoreRound.phrases");
    Translation file name PugRoundRestore.phrases.txt

    [EDIT2]
    Same thing in the config he creates, in this case the name was changed. But the config I believe is the least:
    Code:
    AutoExecConfig_SetFile("PugRestoreRound");
    Can you show me the errors?
    Edit: Fixed
    __________________
    Taking paid private requests! Contact me

    Last edited by Cruze; 07-01-2020 at 03:13. Reason: edit
    Cruze is offline
    borzaka
    AlliedModders Donor
    Join Date: May 2020
    Location: Hungary
    Old 07-02-2020 , 17:30   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #6

    Couple of suggestions:
    • prefix is not always backup_round, it can be set to any custom by mp_backup_round_file cvar
      I have multi instance servers, where I have to set this to different values to not overwrite each other.
    • You can use completely different backup file name patterns by mp_backup_round_file_pattern cvar
      e.g. %prefix%_%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%.txt
    • mp_backup_restore_load_file pauses automatically after executing mp_backup_restore_load_file, if the mp_backup_restore_load_autopause cvar left default, no need to pause again

    So, I would pay attention to custom backup file prefixes and names and use the values from cvars.
    borzaka is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 07-03-2020 , 06:56   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #7

    Quote:
    Originally Posted by borzaka View Post
    Couple of suggestions:
    • prefix is not always backup_round, it can be set to any custom by mp_backup_round_file cvar
      I have multi instance servers, where I have to set this to different values to not overwrite each other.
    • You can use completely different backup file name patterns by mp_backup_round_file_pattern cvar
      e.g. %prefix%_%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%.txt
    • mp_backup_restore_load_file pauses automatically after executing mp_backup_restore_load_file, if the mp_backup_restore_load_autopause cvar left default, no need to pause again

    So, I would pay attention to custom backup file prefixes and names and use the values from cvars.
    Hmm, that's a good catch. Would if I do this? I don't know much about this cvars.

    PHP Code:
            char filepath[PLATFORM_MAX_PATH];
        
    char num[5];
        
    Format(filepathsizeof(filepath), "%s"g_BackupPrefixPattern);
        
    ReplaceString(filepathsizeof(filepath), "%prefix%"g_BackupPrefix);
        if(
    round 10)
        {
            
    Format(numsizeof(num), "0%d"round);
            
    ReplaceString(filepathsizeof(filepath), "%round%"num);
        }
        else
        {
            
    Format(numsizeof(num), "%d"round);
            
    ReplaceString(filepathsizeof(filepath), "%round%"num);
        }
        
    ServerCommand("mp_backup_restore_load_file %s"filepath); 
    Code:
    public void OnMapStart()
    {
    	FindConVar("mp_backup_round_file").GetString(g_BackupPrefix, sizeof(g_BackupPrefix));
    	FindConVar("mp_backup_round_file_pattern").GetString(g_BackupPrefixPattern, sizeof(g_BackupPrefixPattern));
    	
    	ServerCommand("mp_backup_restore_load_autopause 0");
    	ServerCommand("mp_backup_round_auto 1");
    }
    EDIT: After F-ing up my mind, I couldn't think of any way to replace this with old round's prefix :/ "%date%_%time%_%team1%_%team2%_%map%_ round%round%_score_%score1%_%score2%"
    "%map%" can be possible but rest, I don't know. Any help would be appreciated!
    __________________
    Taking paid private requests! Contact me

    Last edited by Cruze; 07-03-2020 at 14:26. Reason: edit
    Cruze is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 07-03-2020 , 06:58   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #8

    Quote:
    Originally Posted by paulo_crash View Post
    Thanks for the release.

    I only have a few questions that I would like to confirm even before testing, testing back with feedback, for now...

    Works with both WarMod [BFG] and PUGSetup, right?

    And any suggestions already, from what I could notice any player can use the .stop command and restore the round, right? In the future I could make the command be valid only for the team that lost its player in the case, that is, it will only use the team that is or has been without a player.

    It would also be good to implement a voting system, that is, the majority of the team that would like to use this feature needs to type in the .stop chat.
    I can't guarantee WarMod [BFG] but get5 and pugsetup should be supported after next release!
    __________________
    Taking paid private requests! Contact me
    Cruze is offline
    thinkii
    New Member
    Join Date: Jul 2020
    Old 07-03-2020 , 13:01   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #9

    Loving this plugin, would you mind adding a .pause and !pause feature? Just for in between rounds tactical pauses
    thinkii is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 07-04-2020 , 01:05   Re: [CSGO][PugSetup] RoundRestore
    Reply With Quote #10

    Quote:
    Originally Posted by thinkii View Post
    Loving this plugin, would you mind adding a .pause and !pause feature? Just for in between rounds tactical pauses
    Why do you need pause feature inside tactical pauses? O.o There is !unpause
    __________________
    Taking paid private requests! Contact me
    Cruze is offline
    Reply


    Thread Tools
    Display Modes

    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 02:37.


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