Raised This Month: $32 Target: $400
 8% 

[CS:GO] Force Win Panel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kunalpowar
Junior Member
Join Date: Sep 2014
Old 06-05-2018 , 04:11   [CS:GO] Force Win Panel
Reply With Quote #1

Is there any way i can force a win panel to show up before the actual game end or at any other moment?

Last edited by kunalpowar; 06-05-2018 at 04:11.
kunalpowar is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 06-06-2018 , 23:55   Re: [CS:GO] Force Win Panel
Reply With Quote #2

PHP Code:
int iGameEnd FindEntityByClassname(-1"game_end");

if (
iGameEnd == -1)   
{
    
iGameEnd CreateEntityByName("game_end");
    if (
iGameEnd != -1AcceptEntityInput(iGameEnd"EndGame");
}
else 
AcceptEntityInput(iGameEnd"EndGame"); 
Try this
__________________

Last edited by LenHard; 06-06-2018 at 23:58.
LenHard is offline
kunalpowar
Junior Member
Join Date: Sep 2014
Old 06-14-2018 , 08:07   Re: [CS:GO] Force Win Panel
Reply With Quote #3

Quote:
Originally Posted by LenHard View Post
PHP Code:
int iGameEnd FindEntityByClassname(-1"game_end");

if (
iGameEnd == -1)   
{
    
iGameEnd CreateEntityByName("game_end");
    if (
iGameEnd != -1AcceptEntityInput(iGameEnd"EndGame");
}
else 
AcceptEntityInput(iGameEnd"EndGame"); 
Try this
This just triggers a cs-intermission event. Win screen is not shown. I'll try the same approach and dig up more. Will update if i get it working.
kunalpowar is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 06-14-2018 , 09:24   Re: [CS:GO] Force Win Panel
Reply With Quote #4

PHP Code:
#include <sdktools>
#include <cstrike>

void ForceWinPanel()
{
    
StringMap smReset = new StringMap();
    
    
ConVar cTimeLimit FindConVar("mp_timelimit");
    
smReset.SetValue("mp_timelimit"cTimeLimit.IntValuetrue);
    
cTimeLimit.IntValue 1;
    
    
ConVar cMaxOverTimeRounds FindConVar("mp_overtime_maxrounds");
    
smReset.SetValue("mp_overtime_maxrounds"cMaxOverTimeRounds.IntValuetrue);
    
cMaxOverTimeRounds.IntValue 0;
    
    
ConVar cOverTimeEnabled FindConVar("mp_overtime_enable");
    
smReset.SetValue("mp_overtime_enable"cOverTimeEnabled.BoolValuetrue);
    
cOverTimeEnabled.BoolValue false;
    
    
ConVar cIgnoreWinConditions FindConVar("mp_ignore_round_win_conditions");
    
smReset.SetValue("mp_ignore_round_win_conditions"cIgnoreWinConditions.BoolValuetrue);
    
cIgnoreWinConditions.BoolValue false;
    
    
SetTeamScoreProper(CS_TEAM_T15);
    
SetTeamScoreProper(CS_TEAM_CT15);
    
    
ConVar cMaxRounds FindConVar("mp_maxrounds");
    
smReset.SetValue("mp_maxrounds"cMaxRounds.IntValuetrue);
    
cMaxRounds.IntValue GetRoundNumber();
    
    
ConVar cRoundRestartDelay FindConVar("mp_round_restart_delay");
    
smReset.SetValue("mp_round_restart_delay"cRoundRestartDelay.IntValuetrue);
    
cRoundRestartDelay.IntValue 0
    
    CS_TerminateRound
(0.0CSRoundEnd_Drawtrue);
    
RequestFrame(Frame_ResetConVarssmReset);
}

void Frame_ResetConVars(StringMap smReset)
{
    
int iTimeLimitsmReset.GetValue("mp_timelimit"iTimeLimit);
    
int iMaxOverTimeRoundssmReset.GetValue("mp_overtime_maxrounds"iMaxOverTimeRounds);
    
bool bOverTimeEnabledsmReset.GetValue("mp_overtime_enable"bOverTimeEnabled);
    
bool bIgnoreWinConditionssmReset.GetValue("mp_ignore_round_win_conditions"bIgnoreWinConditions);
    
int iMaxRoundssmReset.GetValue("mp_maxrounds"iMaxRounds);
    
int iRoundRestartDelaysmReset.GetValue("mp_round_restart_delay"iRoundRestartDelay);
    
    
delete smReset;
    
    
FindConVar("mp_timelimit").IntValue iTimeLimit;
    
FindConVar("mp_overtime_maxrounds").IntValue iMaxOverTimeRounds;
    
FindConVar("mp_overtime_enable").BoolValue bOverTimeEnabled;
    
FindConVar("mp_ignore_round_win_conditions").BoolValue bIgnoreWinConditions;
    
FindConVar("mp_maxrounds").IntValue iMaxRounds;
    
FindConVar("mp_round_restart_delay").IntValue iRoundRestartDelay;
}

int GetRoundNumber() {
    return 
GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT);
}

bool SetTeamScoreProper(int iTeamint iScore)
{
    if (
iTeam CS_TEAM_T || iTeam CS_TEAM_CT) {
        return 
false;
    }
    
    
SetTeamScore(iTeamiScore);
    
CS_SetTeamScore(iTeamiScore);
    
GameRules_SetProp("m_totalRoundsPlayed"GetRoundNumber());
    
    return 
GetTeamScore(iTeam) == iScore;

This should work, if not try removing RequestFrame and the StringMap cache.

Last edited by SM9; 06-14-2018 at 09:30.
SM9 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 22:04.


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