[ML-Scripting]Is this possible?

Talk about ManiaLink development in this forum

Moderator: NADEO

Post Reply
User avatar
Rots
Translator
Translator
Posts: 1101
Joined: 01 Sep 2010, 14:39
Location: España, Barcelona

[ML-Scripting]Is this possible?

Post by Rots »

Can I determine if a player that is browsing my manialink is in a server or on menus? Some magical maniascript function maybe?

I'd like to change manialink stuff depending on player status

w/o getting MPWS players online_status, i'm not breaking any privacy stuff.
Image
Image
Image
TrackMania Original brought me here... Here I am since 2006
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: [ML-Scripting]Is this possible?

Post by Eole »

It's probably not bulletproof, but you could check the value of CurMap. If it's not Null, then there's a high chance that the player is on a server (or editing a map in the editor?).

Code: Select all

<script><!--
main() {
  while(True) {
    yield;
    
    if (CurMap != Null) {
      log(Now^"> I'm on a server");
    } else {
      log(Now^"> I'm not on a server");
    }
  }
}
--></script>
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Rots
Translator
Translator
Posts: 1101
Joined: 01 Sep 2010, 14:39
Location: España, Barcelona

Re: [ML-Scripting]Is this possible?

Post by Rots »

Ah! Nice idea, I'll give it a try :thx:

Do I need to #include something?
Image
Image
Image
TrackMania Original brought me here... Here I am since 2006
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: [ML-Scripting]Is this possible?

Post by Eole »

Rots wrote:Do I need to #include something?
No.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
Post Reply

Return to “ManiaLink”

Who is online

Users browsing this forum: No registered users and 3 guests