Thx for your quick answer, maybe you see my problem when i post the whole function onPlayerInfoChanged:
Code: Select all
public function onPlayerInfoChanged ($aseco, $login){
$player = $aseco->server->players->getPlayerByLogin($login);
$isSpec = $player->is_spectator;
$isTempSpec = $player->temporary_spectator;
//if status changed to spectator
if($isSpec || $isTempSpec){
//$aseco->console("target spectated by $login : $player->target_spectating");
//is a player spectated
if($player->target_spectating != false){
//set in specArray
$this->specArray[$login] = $player->target_spectating;
//show instantly widgets of target
$xml = $this->buildTimeDiffWidgets($player->target_spectating, false);
$aseco->sendManialink($xml, $login, 0);
}
}
//if status changed from spectator to player
else if(isset($this->specArray[$login])){
//unset in specArray
unset($this->specArray[$login]);
//show instantly widgets player himself
$xml = $this->buildTimeDiffWidgets($login, false);
$aseco->sendManialink($xml, $login, 0);
}
A free-spectator is a spectator, so it will go into my if-condition. Normally a free-spectator has no target, but: target_spectating still points to the last spectated player.... that's why i asked if it is possible to determine the camera, then i could do sth like:
Code: Select all
if($player->target_spectating != false && $player->camera != 2)
I know there's not such member in Players-class, just for demonstrating...
I've seen, one can force a player into spectator and a special camera, so I thought, maybe one could determine the cam also other way round.