View Single Post
Author Message
Jamo
Junior Member
Join Date: Aug 2018
Old 03-12-2020 , 17:30   [CS:GO] Can't register "pause" / "unpause" Command
Reply With Quote #1

Hey there!

So - I'm currently creating a plugin which contains !pause and !unpause commands.
Unfortunately it's not working.
I've registered my commands as follows:

PHP Code:
RegConsoleCmd("pause"pause_match);
RegConsoleCmd("unpause"unpause_match); 
The commands refer to the following Actions:

PHP Code:
public Action pause_match(int clientint args) {
    
char full[256];
    
GetCmdArgString(fullsizeof(full));
    if(!
gamepause_active && GameRules_GetProp("m_bWarmupPeriod") == 0) {
        new 
String:name[99];
        
ServerCommand("mp_pause_match");
        
GetClientName(clientnamesizeof(name));
        
PrintToChatAll("%s triggered a game pause!",name);
        
gamepause_active true;
    } else if(
gamepause_active) {
        
PrintHintText(client,"A pause has already been triggered!");
    } else if(
GameRules_GetProp("m_bWarmupPeriod") == 1) {
        
PrintHintText(client,"Can't start pause during warmup!");
    }
}

public 
Action unpause_match(int clientint args) {
    
char full[256];
    
GetCmdArgString(fullsizeof(full));
    if(!
gamepause_active) {
        
PrintHintText(client,"There is no scheduled pause!");
    } else {
        
// Both teams need to !unpause
        // Check if pause was set by admin or players
    
}

So far so good - everything compiles just fine.
But I can't call the command ingame.

What I noticed is, that if I renamd my commands to something like "123_pause", it works.
Is it possible that there already are !pause and !unpause commands built in by sourcemod?

If yes - how can I overwrite those??

Thanks in advance!

Last edited by Jamo; 03-12-2020 at 17:46.
Jamo is offline