Added 2 new functions spectate & voice
basiccommands.php
PHP
$mod->registerCommand("hardcore", '~^hardcore( (1|0))?$~i', "hardcore", $commands_basic);
$mod->registerCommand("oldschool", '~^oldschool( (1|0))?$~i', "oldschool", $commands_basic);
$mod->registerCommand("killcam", '~^killcam( (1|0))?$~i', "killcam", $commands_basic);
$mod->registerCommand("spectate", '~^spectate( (0|1|2))?$~i', "spectate", $commands_basic);
$mod->registerCommand("voice", '~^voice( (1|0))?$~i', "voice", $commands_basic);
$mod->registerCommand("ff", '~^ff( (0|1|2|3))?$~i', "ff", $commands_basic);
...
public function hardcore($guid, $parameters) {
$mode = array($this->mod->getLngString("disabled"), $this->mod->getLngString("enabled"));
if (!empty($parameters)) {
$hardcore = $parameters[0];
$this->mod->rconSay($this->mod->getLngString("hardcoreChange", array("<MODE>"), array($mode[$hardcore])));
$this->mod->rconSetDvar("scr_hardcore", $hardcore);
}
else {
$hardcore = $this->mod->rconGetDvar("scr_hardcore");
$this->mod->rconSay($this->mod->getLngString("hardcore", array("<MODE>"), array($mode[$hardcore])));
}
}
public function oldschool($guid, $parameters) {
$mode = array($this->mod->getLngString("disabled"), $this->mod->getLngString("enabled"));
if (!empty($parameters)) {
$oldschool = $parameters[0];
$this->mod->rconSay($this->mod->getLngString("oldschoolChange", array("<MODE>"), array($mode[$oldschool])));
$this->mod->rconSetDvar("scr_oldschool", $oldschool);
}
else {
$oldschool = $this->mod->rconGetDvar("scr_oldschool");
$this->mod->rconSay($this->mod->getLngString("oldschool", array("<MODE>"), array($mode[$oldschool])));
}
}
public function killcam($guid, $parameters) {
$mode = array($this->mod->getLngString("disabled"), $this->mod->getLngString("enabled"));
if (!empty($parameters)) {
$killcam = $parameters[0];
$this->mod->rconSay($this->mod->getLngString("killcamChange", array("<MODE>"), array($mode[$killcam])));
$this->mod->rconSetDvar("scr_game_allowkillcam", $killcam);
}
else {
$killcam = $this->mod->rconGetDvar("scr_game_allowkillcam");
$this->mod->rconSay($this->mod->getLngString("killcam", array("<MODE>"), array($mode[$killcam])));
}
}
public function spectate($guid, $parameters) {
$mode = array(
$this->mod->getLngString("disabled"),
$this->mod->getLngString("teamonly"),
$this->mod->getLngString("free"),
);
if (!empty($parameters)) {
$spectate = $parameters[0];
$this->mod->rconSay($this->mod->getLngString("spectateChange", array("<MODE>"), array($mode[$spectate])));
$this->mod->rconSetDvar("scr_game_spectatetype", $spectate);
}
else {
$spectate = $this->mod->rconGetDvar("scr_game_spectatetype");
$this->mod->rconSay($this->mod->getLngString("spectate", array("<MODE>"), array($mode[$spectate])));
}
}
public function voice($guid, $parameters) {
$mode = array($this->mod->getLngString("disabled"), $this->mod->getLngString("enabled"));
if (!empty($parameters)) {
$voice = $parameters[0];
$this->mod->rconSetDvar("sv_voice", $voice);
}
else {
$voice = $this->mod->rconGetDvar("sv_voice");
}
$this->mod->rconSay($this->mod->getLngString("voiceChange", array("<MODE>"), array($mode[$voice])));
}
public function ff($guid, $parameters) {
$mode = array(
$this->mod->getLngString("disabled"),
$this->mod->getLngString("enabled"),
$this->mod->getLngString("reflected"),
$this->mod->getLngString("shared"),
);
if (!empty($parameters)) {
$ff = $parameters[0];
$this->mod->rconSay($this->mod->getLngString("setFriendlyFire", array("<MODE>"), array($mode[$ff])));
$this->mod->rconSetDvar("scr_team_fftype", $ff);
}
else {
$ff = $this->mod->rconGetDvar("scr_team_fftype");
$this->mod->rconSay($this->mod->getLngString("friendlyFire", array("<MODE>"), array($mode[$ff])));
}
}
Alles anzeigen
main.lng
PHP
hardcoreChange = "^2Hardcore will be ^1<MODE>^2 after this map/round"
hardcore = "^2Hardcore is ^1<MODE>"
oldschoolChange = "^2Oldschool will be ^1<MODE>^2 after this map/round"
oldschool = "^2Oldschool is ^1<MODE>"
killcamChange = "^2Killcam will be ^1<MODE>^2 after this map/round"
killcam = "^2Killcam is ^1<MODE>"
spectateChange = "Spectate will be ^1<MODE>^2 after this map/round"
spectate = "Spectate is ^1<MODE>"
teamonly = "team only"
free = "free"
voiceChange = "Voice chat is ^1<MODE>"
Alles anzeigen
basic.lng