eBot-CSGO
eBot-CSGO copied to clipboard
Add chat command
Hey all!
Maybe, someone knows how to add a chat command for the eBot(i mean commands like: !pause, !ready, !unpause, etc)? I want to add timeout commands(timeout_ct_start and timeout_terrorist_start), but I don't know how. I think this may be useful not only for me. Please, help me if u can. Thank you
Hello, If you want to code it, here is the explaination of how to do it.
You can add your command in Match.php like it is for "pause". You will have to differenciate CT and T pause.
https://github.com/deStrO/eBot-CSGO/blob/179db02043bfb1ee775c70c6f23d0553f0536332/src/eBot/Match/Match.php#L1337
@vince52 Thank you for the fast answer! Do you mean add commands after the 1337 line?
I tried to do that
` }
} elseif ($this->isCommand($message, "tac")) {
if ($this->isMatchRound() && $this->isPaused && $this->enable) {
if ($message->getUserTeam() == "CT") {
$team = ($this->side['team_a'] == "ct") ? $this->teamAName : $this->teamBName;
if (!$this->timeout_ct_start['ct']) {
$this->timeout_ct_start['ct'] = true;
$this->say($team . " (CT) wants to tactical pause, the match will be paused in the next freezetime.");
}
} elseif ($message->getUserTeam() == "TERRORIST") {
$team = ($this->side['team_a'] == "t") ? $this->teamAName : $this->teamBName;
if (!$this->timeout_terrorist_start['t']) {
$this->timeout_terrorist_start['t'] = true;
$this->say($team . " (T) wants to tactical pause, the match will be paused in the next freezetime.");
}
}
$this->timeoutMatch();`
But it doesn't work