[Solved] Get player avatar in server manialink

Talk about ManiaLink development in this forum

Moderator: NADEO

Post Reply
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

[Solved] Get player avatar in server manialink

Post by steeffeen »

it would be quite cool if it would be possible to show the avatars of the players on a server in a manialink
like

Code: Select all

<quad style="avatar" substyle="playerlogin"/>
or something similar :D
Last edited by steeffeen on 25 Nov 2013, 03:26, edited 1 time in total.
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    spaii
    Posts: 1075
    Joined: 19 Jun 2010, 00:04
    Location: Rémy - France
    Contact:

    Re: [ManiaLinks] List of known bugs

    Post by spaii »

    Try this ;)
    ml ^="""<quad posn="0 0 1" sizen="24 24" image="file://Avatars/{{{Player.Login}}}/default" />""";
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [ManiaLinks] List of known bugs

    Post by steeffeen »

    spaii wrote:Try this ;)
    ah yeah
    i completely forgot that :D
    thanks for the hint
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      magnetik
      Posts: 1673
      Joined: 01 Feb 2012, 19:13
      Location: Bordeaux
      Contact:

      Re: [Fixed] Get player avatar in server manialink

      Post by magnetik »

      Please consider using new topics instead of reply in old one, it's much easier for other players to find their answer. :thumbsup:
      ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: [Fixed] Get player avatar in server manialink

      Post by steeffeen »

      thanks for separating it

      i just posted it in the other thread because it was meant to be a suggestion for the list because i forgot it's already possible :)
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        User avatar
        spaii
        Posts: 1075
        Joined: 19 Jun 2010, 00:04
        Location: Rémy - France
        Contact:

        Re: [ManiaLinks] List of known bugs

        Post by spaii »

        steeffeen wrote:thanks for the hint
        You're welcome! ;)
        User avatar
        adamkooo2
        Posts: 1318
        Joined: 13 Jun 2014, 08:43
        Location: Slovakia
        Contact:

        Re: [NotSolved] Get player avatar in server manialink

        Post by adamkooo2 »

        Hello,

        I have a problem with this script now, becuse it doesn´t works for me :oops: .
        This I've written in manialink :

        Code: Select all

        <quad  posn="-37 61 2" sizen="31 25" id="1" image="file://Avatars/{{{Player.Login}}}/default"  scriptevents="1"/>
        script part :

        Code: Select all

        
        <script><!--
        
        main() 
        {
        	(Page.GetFirstChild("1") as CMlQuad).SetText(Player.Avatar);
        	yield;   
        }
        
        --></script>
        it doesn´t work anymore :/

        Plaese, if you can, correct my script.
        /\rkady
        Image
        zocka
        Posts: 205
        Joined: 15 Jun 2010, 17:56

        Re: [Solved] Get player avatar in server manialink

        Post by zocka »

        Quads don't have SetText(). The have ChangeImageUrl() or ImageUrl.

        You could use:

        Code: Select all

        (Page.GetFirstChild("avatar") as CMlQuad).ImageUrl = LocalUser.AvatarUrl;
        
        PS: You shouldn't use ids like "1". Using qualified names benefits the readability of your code.

        PPS: Just in case you are not on a server-manialink: {{{inlineManiaScript}}} in your xml will not be evaluated. If you are however, you can try <quad image="{{{Player.AvatarUrl}}}" /> without further ManiaScript code.
        manialink minigame shatter
        my manialink: zockaml
        my maniaflash: maniaflash?zocka
        User avatar
        adamkooo2
        Posts: 1318
        Joined: 13 Jun 2014, 08:43
        Location: Slovakia
        Contact:

        Re: [Solved] Get player avatar in server manialink

        Post by adamkooo2 »

        zocka wrote:Quads don't have SetText(). The have ChangeImageUrl() or ImageUrl.

        You could use:

        Code: Select all

        (Page.GetFirstChild("avatar") as CMlQuad).ImageUrl = LocalUser.AvatarUrl;
        
        PS: You shouldn't use ids like "1". Using qualified names benefits the readability of your code.

        PPS: Just in case you are not on a server-manialink: {{{inlineManiaScript}}} in your xml will not be evaluated. If you are however, you can try <quad image="{{{Player.AvatarUrl}}}" /> without further ManiaScript code.
        Thanks, it works! :thx:
        /\rkady
        Image
        Post Reply

        Return to “ManiaLink”

        Who is online

        Users browsing this forum: No registered users and 1 guest