Hey hab da mal ne Frage
Hab diese Datei geschickt bekommen, mit der man Leute zum Beispiel explodieren lassen kann
Bloß meine Frage, wie aktivier ich sie oder was ist daran falsch?
Habe in der config.cfg vom MAM einen eintrag gemacht
[funcommands]
enabled = 1
aber sie funtzt net
also muss da A) was falsch sein oder B) ich bin zu dumm sie zu aktivieren
PHP
<?php
/*
rcon set warp # shoots the player into the air and kills them with fire
rcon set lock # locks a player inplace
rcon set unlock # unlocks the player from place
rcon set suicide # kills a player
rcon set smite # blows up a player
rcon set zombie # makes player a zombie, headless with blood
rcon set torch # torches a player and kills them
rcon set fire # sets a player on fire, player&fire can move, will not kill player
rcon set spank # spanks a player by going prone, shellshock, drop wep all for 15 seconds.
rcon set disableweapon # disables the player weapons
rcon set enableweapon # enables the player weapons
rcon setcheater # ruins the gaming experience for the player (hehe)
rcon set switchplayerspec # switches a player to spectator
rcon set switchplayerallies # switches a player to allie
rcon set switchplayeraxis # switches a player to axis
rcon sayall # says a msg to lower left of hud
rcon sayallcenter # says a msg to center of screen
*/
$funcommands_object = new funcommands();
$mod->registerCommand("warp", "#^warp \S.*$#", "command_warp", $funcommands_object);
$mod->registerCommand("lock", "#^lock \S.*$#", "command_lock", $funcommands_object);
$mod->registerCommand("unlock", "#^unlock \S.*$#", "command_unlock", $funcommands_object);
$mod->registerCommand("suicide", "#^suicide \S.*$#", "command_suicide", $funcommands_object);
$mod->registerCommand("boom", "#^boom \S.*$#", "command_boom", $funcommands_object);
$mod->registerCommand("zombie", "#^zombie \S.*$#", "command_zombie", $funcommands_object);
$mod->registerCommand("torch", "#^torch \S.*$#", "command_torch", $funcommands_object);
$mod->registerCommand("fire", "#^fire \S.*$#", "command_fire", $funcommands_object);
$mod->registerCommand("fuck", "#^fuck \S.*$#", "command_fuck", $funcommands_object);
$mod->registerCommand("noweapon", "#^noweapon \S.*$#", "command_noweapon", $funcommands_object);
$mod->registerCommand("weapon", "#^weapon \S.*$#", "command_weapon", $funcommands_object);
$mod->registerCommand("cheater", "#^cheater \S.*$#", "command_cheater", $funcommands_object);
$mod->registerCommand("spec", "#^spec \S.*$#", "command_spec", $funcommands_object);
$mod->registerCommand("allies", "#^allies \S.*$#", "command_allies", $funcommands_object);
$mod->registerCommand("axis", "#^axis \S.*$#", "command_axis", $funcommands_object);
$mod->registerCommand("swap", "#^swap \S.*$#", "command_swap", $funcommands_object);
$mod->registerCommand("sa", "#^sa \S.*$#", "command_sa", $funcommands_object);
$mod->registerCommand("pm", "#^pm \S.*$#", "command_pm", $funcommands_object);
$mod->registerCommand("kill", false, "command_kill", $funcommands_object);
class funcommands {
private $mod = false;
private $players = false;
public function __construct() {
$this->mod =& $GLOBALS['mod'];
$this->players =& $GLOBALS['players'];
}
public function command_warp($guid, $parameters) {
$this->execute("warp", $guid, $parameters);
}
public function command_lock($guid, $parameters) {
$this->execute("lock", $guid, $parameters);
}
public function command_unlock($guid, $parameters) {
$this->execute("unlock", $guid, $parameters);
}
public function command_suicide($guid, $parameters) {
$this->execute("suicide", $guid, $parameters);
}
public function command_boom($guid, $parameters) {
$this->execute("smite", $guid, $parameters);
}
public function command_zombie($guid, $parameters) {
$this->execute("zombie", $guid, $parameters);
}
public function command_torch($guid, $parameters) {
$this->execute("torch", $guid, $parameters);
}
public function command_fire($guid, $parameters) {
$this->execute("fire", $guid, $parameters);
}
public function command_fuck($guid, $parameters) {
$this->execute("spank", $guid, $parameters);
}
public function command_noweapon($guid, $parameters) {
$this->execute("disableweapon", $guid, $parameters);
}
public function command_weapon($guid, $parameters) {
$this->execute("enableweapon", $guid, $parameters);
}
public function command_cheater($guid, $parameters) {
$this->execute("cheater", $guid, $parameters);
}
public function command_spec($guid, $parameters) {
$this->execute("switchplayerspec", $guid, $parameters);
}
public function command_allies($guid, $parameters) {
$this->execute("switchplayerallies", $guid, $parameters);
}
public function command_axis($guid, $parameters) {
$this->execute("switchplayeraxis", $guid, $parameters);
}
private function execute($dvar, $executer_guid, $parameters) {
$search = implode(" ", $parameters);
$target = $this->mod->findPlayerGuid($search);
if (!$target) {
$this->players[$executer_guid]->say($this->mod->getLngString("playerNotFound", array("<SEARCH>"), array($search)));
return;
}
$pid = $this->players[$target]->getPID();
$playername = $this->players[$target]->getName();
$this->mod->rconRcon("set $dvar $pid");
$this->players[$executer_guid]->say($this->mod->getLngString("funcommands_executed_$dvar", "<PLAYER_NAME>", $playername));
}
public function command_kill($guid, $parameters) {
$pid = $this->players[$guid]->getPID();
$playername = $this->players[$guid]->getName();
$this->mod->rconRcon("set suicide $pid");
$this->mod->rconSay($this->mod->getLngString("funcommands_kill", "<PLAYER_NAME>", $playername));
}
public function command_swap($guid, $parameters) {
$search = implode(" ", $parameters);
$target = $this->mod->findPlayerGuid($search);
if (!$target) {
$this->players[$guid]->say($this->mod->getLngString("playerNotFound", array("<SEARCH>"), array($search)));
return;
}
if (!in_array($this->players[$target]->team, array("allies", "axis"))) {
$playername = $this->players[$target]->getName();
$this->players[$guid]->say($this->mod->getLngString("funcommands_swap_error", "<PLAYER_NAME>", $playername));
return;
}
$pid = $this->players[$target]->getPID();
$playername = $this->players[$target]->getName();
if ($this->players[$target]->team == "allies") {
$this->mod->rconRcon("set switchplayeraxis $pid");
$this->players[$guid]->say($this->mod->getLngString("funcommands_executed_switchplayeraxis", "<PLAYER_NAME>", $playername));
}
else {
$this->mod->rconRcon("set switchplayerallies $pid");
$this->players[$guid]->say($this->mod->getLngString("funcommands_executed_switchplayerallies", "<PLAYER_NAME>", $playername));
}
}
public function command_sa($guid, $parameters) {
$msg = implode(" ", $parameters);
$this->mod->rconRcon("sayall ^1$msg");
}
public function command_pm($guid, $parameters) {
$msg = implode(" ", $parameters);
$this->mod->rconRcon("sayallcenter ^1$msg");
}
}
?>
Alles anzeigen