Page 1 of 1

[Solved] Get player avatar in server manialink

Posted: 25 Aug 2013, 18:21
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

Re: [ManiaLinks] List of known bugs

Posted: 25 Aug 2013, 19:49
by spaii
Try this ;)
ml ^="""<quad posn="0 0 1" sizen="24 24" image="file://Avatars/{{{Player.Login}}}/default" />""";

Re: [ManiaLinks] List of known bugs

Posted: 26 Aug 2013, 06:22
by steeffeen
spaii wrote:Try this ;)
ah yeah
i completely forgot that :D
thanks for the hint

Re: [Fixed] Get player avatar in server manialink

Posted: 26 Aug 2013, 08:31
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:

Re: [Fixed] Get player avatar in server manialink

Posted: 26 Aug 2013, 09:32
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 :)

Re: [ManiaLinks] List of known bugs

Posted: 26 Aug 2013, 10:24
by spaii
steeffeen wrote:thanks for the hint
You're welcome! ;)

Re: [NotSolved] Get player avatar in server manialink

Posted: 29 Jan 2016, 14:06
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.

Re: [Solved] Get player avatar in server manialink

Posted: 29 Jan 2016, 15:45
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.

Re: [Solved] Get player avatar in server manialink

Posted: 30 Jan 2016, 10:08
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: