Raised This Month: $ Target: $400
 0% 

[CSGO] "Trigger" Surrender?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DukeBruno123
Member
Join Date: Jan 2016
Location: Germany
Old 10-02-2016 , 04:42   [CSGO] "Trigger" Surrender?
Reply With Quote #1

Hello,

I use NativeVotes to create a T/CT-Side vote if they want to surrender or not. That already works

The only thing missing is that the match actually cancels the current round and ends the game.
I was thinking about just setting mp_maxrounds to 0 but then the team with the most rounds would automatically win.

Anyone know if i can someone tell the game to do the stuff explained above? (Cancel round and end game with the win panel pop up)

I googled around but couldn't find anything useful

Example if you dont know what i mean: I want this screen to pop up

Last edited by DukeBruno123; 10-02-2016 at 04:44.
DukeBruno123 is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 10-02-2016 , 21:37   Re: [CSGO] "Trigger" Surrender?
Reply With Quote #2

Try this:

PHP Code:
TeamSurrender(CS_TEAM_T); // Terrorist Surrender.
TeamSurrender(CS_TEAM_CT); // CT Surrender. 
PHP Code:
stock void TeamSurrender(int iTeam)
{
    if(
iTeam CS_TEAM_T || iTeam CS_TEAM_CT) {
        return;
    }
    
    
SetConVarInt(FindConVar("mp_overtime_enable"), 0);
    
SetConVarInt(FindConVar("mp_ignore_round_win_conditions"), 0); 
    
    
GameRules_SetProp("m_totalRoundsPlayed"GetConVarInt(FindConVar("mp_maxrounds"));
    
    if(
iTeam == CS_TEAM_T) {
        
CS_TerminateRound(0.0CSRoundEnd_TerroristsSurrender);
    } else {
        
CS_TerminateRound(0.0CSRoundEnd_CTSurrender);
    }


Last edited by SM9; 10-02-2016 at 21:41.
SM9 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 14:57.


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