Raised This Month: $ Target: $400
 0% 

Solved Help [CS:GO] pause & unpause using default game timeout


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Star0
Junior Member
Join Date: Jan 2019
Old 08-20-2021 , 04:58   Help [CS:GO] pause & unpause using default game timeout
#1

Hello guys first of all sorry for my bad english i need help this this script
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma newdecls required
#pragma semicolon 1

public void  OnPluginStart()
{
    
RegConsoleCmd("sm_pause"Command_Pause"Start a Team timeout");
    
RegConsoleCmd("sm_unpause"Command_UnPause"End a Team timeout");
}

public 
Action Command_Pause(int clientint args)
{
    if(
GetClientTeam(client) == CS_TEAM_T)
    {
        
ServerCommand("timeout_terrorist_start");
        
PrintToChatAll("\x01[\x05ServerName\x01]\x04 %N\x01 has called for a pause."client);
        
        return 
Plugin_Handled;
    }
    
    else if(
GetClientTeam(client) == CS_TEAM_CT)
    {
        
ServerCommand("timeout_ct_start");
        
PrintToChatAll("\x01[\x05ServerName\x01]\x04 %N\x01 has called for a pause."client);
        
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;
}

public 
Action Command_UnPause(int clientint args
{
}

#define ChatAlias(%1,%2) \
if (StrEqual(sArgs[0], %1false)) { \
    %
(client0); \
}
public 
Action OnClientSayCommand(int client, const char[]command, const char[]sArgs)
{
    
ChatAlias(".pause"Command_Pause)
    
ChatAlias(".unpause"Command_UnPause)

i need script to delete team timeout or kill the remainig time and when any team ask for timeout again will count as new timeout 1/4 , 2/4 ...etc
i mean the team only have 4 pauses per game
with time 3 min per pause

An example of what I mean

this is the Section i need help with
PHP Code:
public Action Command_UnPause(int clientint args
{

Thanks

Last edited by DarkDeviL; 08-21-2021 at 13:52. Reason: Restore to previous version.
Star0 is offline
BeepIsla
Member
Join Date: Mar 2020
Location: Germany
Old 08-20-2021 , 08:15   Re: Help [CS:GO] pause & unpause using default game timeout
#2

mp_team_timeout_max for the 1/4 2/4 etc

mp_team_timeout_time for 3 minutes time per pause

For unpause you probably want the use the netprops m_bTerroristTimeOutActive or m_flTerroristTimeOutRemaining or m_nTerroristTimeOuts (For CT just replace "Terrorist" with "CT")

Last edited by BeepIsla; 08-20-2021 at 08:18.
BeepIsla is offline
Star0
Junior Member
Join Date: Jan 2019
Old 08-20-2021 , 09:46   Re: Help [CS:GO] pause &amp; unpause using default game timeout
#3

Quote:
Originally Posted by BeepIsla View Post
mp_team_timeout_max for the 1/4 2/4 etc

mp_team_timeout_time for 3 minutes time per pause

For unpause you probably want the use the netprops m_bTerroristTimeOutActive or m_flTerroristTimeOutRemaining or m_nTerroristTimeOuts (For CT just replace "Terrorist" with "CT")
i already know about

mp_team_timeout_max and mp_team_timeout_time

but can u do this
Quote:
For unpause you probably want the use the netprops m_bTerroristTimeOutActive or m_flTerroristTimeOutRemaining or m_nTerroristTimeOuts (For CT just replace "Terrorist" with "CT")
on
public Action Command_UnPause(int client, int args)
{

}

Last edited by DarkDeviL; 08-21-2021 at 13:52. Reason: Restore to previous version.
Star0 is offline
Star0
Junior Member
Join Date: Jan 2019
Old 08-21-2021 , 04:55   Re: Help [CS:GO] pause & unpause using default game timeout
#4

Done Thanks for help

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

#pragma newdecls required
#pragma semicolon 1

public Plugin myinfo = {
    
name        "CS:GO Pause & Unpause",
    
author        "https://github.com/Staar0",
    
description    "Pause & Unpause using default Game Timeout",
    
version        "0.0.1"
};

public 
void  OnPluginStart()
{
    
RegConsoleCmd("sm_pause"Command_Pause"Start a Team timeout");
    
RegConsoleCmd("sm_unpause"Command_UnPause"End a Team timeout");
}

public 
Action Command_Pause(int clientint args)
{
    if(
GetClientTeam(client) == CS_TEAM_T)
    {
        
ServerCommand("timeout_terrorist_start");
        
PrintToChatAll("\x01[\x05Timeout\x01]\x04 %N\x01 has called for a pause."client);
        
        return 
Plugin_Handled;
    }
    
    else if(
GetClientTeam(client) == CS_TEAM_CT)
    {
        
ServerCommand("timeout_ct_start");
        
PrintToChatAll("\x01[\x05Timeout\x01]\x04 %N\x01 has called for a pause."client);
        
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;
}

public 
Action Command_UnPause(int clientint args
{
    if(
GetClientTeam(client) == CS_TEAM_T)
    {
        
GameRules_SetPropFloat("m_flTerroristTimeOutRemaining"0.00true);
        
PrintToChatAll("\x01[\x05Timeout\x01]\x04 %N\x01 has unpaused."client);
        
        return 
Plugin_Handled;
    }
    
    else if(
GetClientTeam(client) == CS_TEAM_CT)
    {
        
GameRules_SetPropFloat("m_flCTTimeOutRemaining"0.00true);
        
PrintToChatAll("\x01[\x05Timeout\x01]\x04 %N\x01 has unpaused."client);
        
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;
}

#define ChatAlias(%1,%2) \
if (StrEqual(sArgs[0], %1false)) { \
    %
(client0); \
}
public 
Action OnClientSayCommand(int client, const char[]command, const char[]sArgs)
{
    
ChatAlias(".pause"Command_Pause)
    
ChatAlias(".unpause"Command_UnPause)

Star0 is offline
Closed Thread



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


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