[FIXED]User you are spectating

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: User you are spectating

Post by Eole »

oliverde8 wrote:Can you please fix this?
Bug confirmed, we will investigate it.
undef.de wrote:Should this not be easily possible with the (unfortunately unavailable in TM) CTmMode::Spectators?
The Players array in the manialink scripts contains all players on the server(players and spectators). With something like this you should be able to differentiate spectators from players :

Code: Select all

foreach (Player in Players) {
	if (Player.RequestsSpectate) {
		// Spectator
	} else {
		// Player
	}
}
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: User you are spectating

Post by Eole »

oliverde8 wrote:Hi, I confirm there is a problem.
I had hope it was fix I know it was crazy for me to hope for that so soon.

I put this code inside a Manialinks maniascript's while loop :

Code: Select all

if (GUIPlayer != Null) {
    log("GUIPlayer is "^GUIPlayer.Name);
} else {
    log("GUIPlayer is NULL");
}
I did see null while switching between players but beside that always my nickname was in the logs never saw the nickname of the player I spectate.
I tried in Script & Legacy Rounds mode as I needed the feature there.

Can you please fix this?
xbx fixed the bug, it will be available in the next update.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
reaby
Posts: 956
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: User you are spectating

Post by reaby »

I maybe can also thank for this !

Many thanks :thx:
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: User you are spectating

Post by oliverde8 »

Thanks I confirm fixed :thumbsup:

many thanks
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: User you are spectating

Post by djhubertus »

Eole wrote: foreach (Player in Players) {
if (Player.RequestsSpectate) {
// Spectator
} else {
// Player
}
}
I made something like this and it doesn't work. It's always invisible

Code: Select all

Text UpdateCaptureMessageVisibility(Boolean _Show)
{
  return """
<manialink version="1" name="Elite:GoalIsReadyToCapture">
<frame hidden="1" id="Frame_Ready">
 <quad posn="0 75 100" sizen="70 10" bgcolor="FFFA" style="Bgs1" substyle="BgList" halign="center"/>
 <label posn="0 72.5 101" textsize="3" textfont="Play.font.gbx" halign="center" text="$sThe goal is ready to capture">
 <script><!--
 main()
  {
    while(True)
    {
      yield;
      declare F_Ready <=> (Page.GetFirstChild("Frame_Ready") as CMlFrame);

      if({{{_Show}}})
      {
        if(InputPlayer.RequestSpectate) F_Ready.Show();
        else F_Ready.Hide();
      }
      else F_Ready.Hide();
    }
  }
 --></script>
</manialink>
  """;
}
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: [FIXED]User you are spectating

Post by Eole »

You forgot to close the

Code: Select all

<frame hidden="1" id="Frame_Ready">
with a

Code: Select all

</frame>

Same thing for the label, it should be

Code: Select all

<label posn="0 72.5 101" textsize="3" textfont="Play.font.gbx" halign="center" text="$sThe goal is ready to capture" />
with a / at the end.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: [FIXED]User you are spectating

Post by djhubertus »

rofl, I should buy new glasses :thx:
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: [FIXED]User you are spectating

Post by Eole »

It happened to me so many times ... Now it's the first thing I check when a manialink script doesn't work. :mrgreen:
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest