Raised This Month: $51 Target: $400
 12% 

Switch MOTD automatically?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JAWAWA
Junior Member
Join Date: May 2013
Old 05-24-2013 , 16:57   Switch MOTD automatically?
Reply With Quote #1

Hello,everyone!

Here is my question:
Is there have any script can switch my motd pics automatically?

I've designed over then 30 pics for the frontpage of my server,
but I have to change them manually.

Is there have any script can switch them automatically,
so each time when players join the server can see different pics?

Anyone can help with that? Thank you!

(btw,why my host banner never showing up correctly.. )
JAWAWA is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 05-24-2013 , 19:35   Re: Switch MOTD automatically?
Reply With Quote #2

This should work:

HTML Code:
<!DOCTYPE html>
<script type="text/javascript">
// <![CDATA[
var server_picture = new Array(
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE',
'INSERT LINK HERE'
);
var nr = Math.floor(Math.random()*server_picture.length);
document.write('<style type="text/css">body{background-image:url('+server_picture[nr]+');background-repeat:no-repeat;background-position:center center;background-attachment:fixed;-webkit-background-size:100% 100%,auto;background-size:100% 100%,auto}</style>');
// ]]>
</script>
</html>
Example: http://rytis.rytiscraft.com/thisisweird.html

Regards,
Rytis

Last edited by Rytis; 05-31-2013 at 08:34. Reason: />
Rytis is offline
altair540
Member
Join Date: Dec 2012
Old 05-24-2013 , 20:09   Re: Switch MOTD automatically?
Reply With Quote #3

Quote:
Originally Posted by Rytis View Post
This should work:

HTML Code:
<!DOCTYPE html>
<script type="text/javascript">
// <![CDATA[
var server_picture = new Array(
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>',
'<img src="INSERT LINK HERE"/>'
);
var nr = Math.floor(Math.random()*server_picture.length);
document.write(''+server_picture[nr]+'');
// ]]>
</script>
</html>
Example: http://rytis.rytiscraft.com/thisisweird.html

Regards,
Rytis
Is there a way to make that image was the entire width and height of the motd window, all the players who have come?
altair540 is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 05-24-2013 , 20:57   Re: Switch MOTD automatically?
Reply With Quote #4

Quote:
Originally Posted by altair540 View Post
Is there a way to make that image was the entire width and height of the motd window, all the players who have come?
How do you mean that?
Rytis is offline
altair540
Member
Join Date: Dec 2012
Old 05-24-2013 , 22:10   Re: Switch MOTD automatically?
Reply With Quote #5

Quote:
Originally Posted by Rytis View Post
How do you mean that?
before like this could be: <img src = "Direct address of the image" width = "100%" height = "100%" and the picture in the whole Klien motd window
altair540 is offline
JAWAWA
Junior Member
Join Date: May 2013
Old 05-25-2013 , 00:29   Re: Switch MOTD automatically?
Reply With Quote #6

Wow! It WORKs!
Thank you Rytis! But it have a little problem here.



My images was fit to the frame and now it looks like shrinked.
How can I fix it to fit to the frame without change the resolution
of the images ? Thanks again!
JAWAWA is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 05-25-2013 , 06:11   Re: Switch MOTD automatically?
Reply With Quote #7

You can't fix that, without the resolution of the image
Rytis is offline
JAWAWA
Junior Member
Join Date: May 2013
Old 05-27-2013 , 03:43   Re: Switch MOTD automatically?
Reply With Quote #8

Ok, I've did a lot of test, and the best resolution of the image I can set is 1180x564.
but it just can't fit the window perfectly:


The image above is on a resolution at 1920x1080 for the game video setting.
If I change the video resolution to 1600x900,and the image is same resolution at 1180x564,
it became like this:


It seems to fit the window better with a white frame around it perfectly , but I have to slide it
to see whole image. I'm always play the game on 1920x1080,so is there have any way to let the
image fit to the window better? thanks a lot,Rytis =))

And thank you altair540 for the tip,but it seems not work,the image not even show up.

Last edited by JAWAWA; 05-31-2013 at 16:47. Reason: .
JAWAWA is offline
Rytis
Veteran Member
Join Date: Feb 2012
Location: Germany
Old 05-31-2013 , 08:35   Re: Switch MOTD automatically?
Reply With Quote #9

I've updated the code above, try it again
Rytis is offline
JAWAWA
Junior Member
Join Date: May 2013
Old 05-31-2013 , 16:36   Re: Switch MOTD automatically?
Reply With Quote #10

Wiiiiii~!!! Look how it fit it perfectly !


Thank you so much! Rytis!!
You are really a magician ! =)))

Last edited by JAWAWA; 05-31-2013 at 16:39. Reason: .
JAWAWA is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode