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

Motd background too small [Solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 12-05-2015 , 09:50   Motd background too small [Solved]
Reply With Quote #1

Here is the code

PHP Code:
public MotdiPlayer )
{
    new 
szMotd1024 ], szTitle128 ], iPos 0;

    
formatexszTitlecharsmaxszTitle ), "Motd" );

    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"<html>" );

    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"<head>" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"<style type=^"text/css^">" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"html {height:100%;}" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"body {height:100%; margin:0; padding:0;}" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"#bg {position:fixed; top:0; left:0; width:100%; height:100%;}" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"#content {position:relative; z-index:1;}" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"</style>" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"</head>" );

    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"<body>" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"<div id=^"bg^"><img src=^"http://i.imgur.com/ufLyCar.png^" width=^"100%^" height=^"100%^" alt=^"^"></div>" );
    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"</body>" );

    
iPos += formatexszMotdiPos ], charsmaxszMotd ) - iPos"</html>" );

    
show_motdiPlayerszMotd szTitle );

why image appears like this, but not fully backgrounded?


Last edited by ~Ice*shOt; 12-05-2015 at 11:06. Reason: Solved
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Old 12-05-2015, 09:58
wickedd
This message has been deleted by wickedd. Reason: I think I need glasses
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-05-2015 , 10:48   Re: Motd background too small
Reply With Quote #2

It's probably that '%' characters are getting erased because you are using formatex() to format your page. In formatex() (and every other string formatting function), to display a single percentage character, you have to write two, e.g:
Code:
#bg {width:100%%}

Last edited by klippy; 12-05-2015 at 10:49.
klippy is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 12-05-2015 , 11:05   Re: Motd background too small
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
Because the the height and width is 100.

Edit: That's the size of my avatar.
No, it's 100% there's difference between 100 and 100%

Quote:
Originally Posted by KliPPy View Post
It's probably that '%' characters are getting erased because you are using formatex() to format your page. In formatex() (and every other string formatting function), to display a single percentage character, you have to write two, e.g:
Code:
#bg {width:100%%}
Thanks! It's perfect now.

Last edited by ~Ice*shOt; 12-05-2015 at 11:05.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
wickedd
Veteran Member
Join Date: Nov 2009
Old 12-05-2015 , 11:12   Re: Motd background too small
Reply With Quote #4

Quote:
Originally Posted by ~Ice*shOt View Post
No, it's 100% there's difference between 100 and 100%
Oops you're right, I don't know how I didn't see that.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 05:58.


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