!setff & !ff are merged into function !ff
Beiträge von koderr
-
-
Sorry, i forgot
// added -
Added 2 new functions spectate & voice
basiccommands.php
PHP
Alles anzeigen$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]))); } }
main.lng
PHP
Alles anzeigenhardcoreChange = "^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>"
basic.lng
-
-
-
// bug #1
// command_clearbans => command_banGuidPHP$mod->registerCommand("pbbanguid", "#^pbbanguid [0-9a-z]+ ?(.*?)$#i", "command_clearbans", $punkbuster_object);
// fixedPHP$mod->registerCommand("pbbanguid", "#^pbbanguid [0-9a-z]+ ?(.*?)$#i", "command_banGuid", $punkbuster_object);
//bug #2
// $return => $resultPHPprivate function pb_banGuid($guid, $name = "???", $ip = "???", $reason = "") { $return = $this->rcon->rcon("pb_sv_banguid $guid \"$name\" \"$ip\" \"$reason\""); return (stripos($result, "Ban Added to Ban List") !== false) ? true : false; // unknown $result }
//fixedPHPprivate function pb_banGuid($guid, $name = "???", $ip = "???", $reason = "") { $result = $this->rcon->rcon("pb_sv_banguid $guid \"$name\" \"$ip\" \"$reason\""); return (stripos($result, "Ban Added to Ban List") !== false) ? true : false; }
//bug #3
// $guid overwrite, $guid => $banguid
// translation fix, punkbuster.php & languages/en/punkbuster.lng
// punkbuster_bunguidsuccess => punkbuster_banguidsuccess
// punkbuster_bunguidfailed => punkbuster_banguidfailedPHP
Alles anzeigenpublic function command_banGuid($guid, $parameters) { if ($this->disabled) return false; $guid = $parameters[0]; // error !!! $name = (isset($parameters[1])) ? $parameters[1] : "???"; $ip = (isset($parameters[2])) ? $parameters[1] : "???"; // $parameters[2] $reason = (isset($parameters[3])) ? $parameters[1] : ""; // $parameters[3] if ($this->pb_banGuid($guid, $name, $ip, $reason)) { $this->players[$guid]->say($this->mod->getLngString("punkbuster_bunguidsuccess")); $this->pb_updateBanFile(); } else { $this->players[$guid]->say($this->mod->getLngString("punkbuster_bunguidfailed")); } }
//fixedPHP
Alles anzeigenpublic function command_banGuid($guid, $parameters) { if ($this->disabled) return false; $banguid = $parameters[0]; $name = (isset($parameters[1])) ? $parameters[1] : "???"; $ip = (isset($parameters[2])) ? $parameters[2] : "???"; $reason = (isset($parameters[3])) ? $parameters[3] : ""; if ($this->pb_banGuid($banguid, $name, $ip, $reason)) { $this->players[$guid]->say($this->mod->getLngString("punkbuster_banguidsuccess")); $this->pb_updateBanFile(); } else { $this->players[$guid]->say($this->mod->getLngString("punkbuster_banguidfailed")); } }
//bug #3
// pb_update() => pb_restart()PHPpublic function command_restart($guid, $parameters) { if ($this->disabled) return false; $this->pb_update(); // pb_restart(); $this->players[$guid]->say($this->mod->getLngString("punkbuster_restart")); }
//fixed
-
// fixed basiccommands.php
Codepublic function restart($guid, $parameters) { if (!empty($parameters[0])) { // !restart 1 $this->mod->rconSay($this->mod->getLngString("mapRestart")); $this->mod->rconMapRestart(true); } else { // !restart $this->mod->rconSay($this->mod->getLngString("mapFastRestart")); $this->mod->rconMapRestart(false); } }