Rendril Posted January 15, 2010 Report Share Posted January 15, 2010 (edited) [b]null[/b] mds_player_avatar(string $name, string $attributes); Will echo the player's avatar image if the name is valid, otherwise it will give a no avatar message. Player name is not case sensitive. The image is echoed directly by the function with only a null value returned. The function can be called a maximum of 5 times in the script. Attributes are not required, but if used will be given directly to the image in html. Example: HTML [code] <script type="text/javascript"> function toggle(){ var img = document.getElementById("avatar"); img.style.display = img.style.display == "none" ? "inline" : "none"; } </script> <input type="button" value="Show/Hide" onclick="toggle()" /> <br /> [/code] Script [code] echo @content[0]; mds_player_avatar('Rendril Revant', 'id="avatar"'); [/code] Edited January 15, 2010 by Rendril Quote Link to comment Share on other sites More sharing options...
Burns Posted January 15, 2010 Report Share Posted January 15, 2010 It's not case sensitive... i get my avatar by entering '*burns*' xD apart from that... i left out the id= part, and it still works :/ script: [php]echo @content[0]; @vn=@input['name']; mds_player_avatar(@vn); [/php] html: [html]<form method="post" action=""> Enter a Playername and see his/her Avatar!<br /> <input name="name" type="text" /><br /> <br /> <input name="submit" type="submit" value="Show me your looks!"/><br /> </form>[/html] Quote Link to comment Share on other sites More sharing options...
Rendril Posted January 15, 2010 Author Report Share Posted January 15, 2010 Thanks for pointing out the change. When I tested it the function was case sensitive. Attritbutes are not required, I added the id only because the particular example I used needed a reference. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.