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

html


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MacL
Member
Join Date: May 2021
Old 06-14-2021 , 14:02   html
Reply With Quote #1

hey alliedmodders, i have problem with html and i have some questions. problem is why this code does not support 12 parts and is completely broken.
How can I change the background and replace it with a photo?
and how can i put image in <th> tags or how can i change font and color? thanks
code
PHP Code:
    len format(buffer[len], 2367-len"<style>body{background:#112233;font-family:Arial}th{background:#2E2E2E;color:#FFF;padding:5px 2px;text-align:left}td{padding:5px 2px}table{width:100%%;background:#EEEECC;font-size:12px;}h2{color:#FFF;font-family:Verdana;text-align:center}#nr{text-align:center}#c{background:#E2E2BC}</style><h2>Something</h2><table border=^"0^" align=^"center^" cellpadding=^"0^" cellspacing=^"1^"><tbody>";
    
len += format(buffer[len], 2367-len"<tr><th id=nr>#</th><th>Name<th>Persoal<th>Andowna<th>Money<th>Armor<th>Health<th>Gapo<th>Time<th>stats<th>Last time<th>Points");
        
    for(new 
startgNumi++) {
        
get_user_name(idname31);
        
get_stats(iiStatsiBodyname31);
            
        new 
Float:fstats[8];
        for (new 
08j++)
            
fstats[j] = float(iStats[j]);
            
        while(
containi(name"<") != -1)
            
replace(name31"<""<");
        while(
containi(name">") != -1)
            
replace(name31">"">");
            
        
len += format(buffer[len], 2367-len"<tr %s><td id=nr>%d<td>%s<td>%d<td>%d<td>%d<td>%d<td>%d<td>%d<td>%d<td>%d<td>%d",((i%2)==0) ? "" " id=c", (i+1), namepart4part5part6part7part8part9part10part11part12);
    }
        
    new 
server_name[64];
    
get_cvar_string("hostname"server_name63);
    
len += format(buffer[len], 2367-len"<tr><th colspan=^"7^" id=nr>%s"server_name);
        
    
len += format(buffer[len], 2367-len"</tbody></table></body>");
    
show_motd(idbuffer"Moda"); 
something like this:
change the background with photo and font and colors.

Last edited by MacL; 06-14-2021 at 14:05.
MacL is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-14-2021 , 16:07   Re: html
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=109369

you'll have to host a website if you want to get past this limitation and show more characters in the motd window
jimaway is offline
MacL
Member
Join Date: May 2021
Old 06-14-2021 , 16:14   Re: html
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
https://forums.alliedmods.net/showthread.php?t=109369

you'll have to host a website if you want to get past this limitation and show more characters in the motd window
Goddamn it. thanks, but how can i change font style or color? for color, I tried:
Code:
 
style="color:blue;"
but it did not work
MacL is offline
MacL
Member
Join Date: May 2021
Old 06-14-2021 , 17:23   Re: html
Reply With Quote #4

Quote:
Originally Posted by jimaway View Post
https://forums.alliedmods.net/showthread.php?t=109369

you'll have to host a website if you want to get past this limitation and show more characters in the motd window
If so, how can I do this? Please explain more and give an example
MacL is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-14-2021 , 17:40   Re: html
Reply With Quote #5

Quote:
Originally Posted by MacL View Post
If so, how can I do this? Please explain more and give an example
Code:
show_motd(playerid, "http://yourmotdwebsite.com", "header")
jimaway is offline
MacL
Member
Join Date: May 2021
Old 06-14-2021 , 18:00   Re: html
Reply With Quote #6

Quote:
Originally Posted by jimaway View Post
Code:
show_motd(playerid, "http://yourmotdwebsite.com", "header")
For example, if I want to get money, point, Played time of the player (I used to do this in the plugin itself, like that code i wrote), should this be done in the site file itself or..?

Last edited by MacL; 06-14-2021 at 18:01.
MacL is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-14-2021 , 20:01   Re: html
Reply With Quote #7

You'll need to send the info from your game server to the web server. Will be easier to just go simpler with format and use the standard MOTD.
__________________
Bugsy is offline
731
Member
Join Date: Aug 2006
Old 06-14-2021 , 22:05   Re: html
Reply With Quote #8

Create a "htm" folder under the "cstrike" folder, put "top15.htm" in this "htm" folder, open "top15.htm" with Notepad or other text editing software, and change the url inside Change the following address to a URL address where others can access the "top15_result.htm" file. (Note: The "top15_result.htm" file is generated by the plug-in)

  To use the TOP15 of this plug-in, you need to enable the web service in your server and use the "htm" folder as the root address of your web server or one of its virtual directories. The content of the web service is beyond the scope of this discussion, so I won’t introduce it here, please check the information yourself to solve it.

top15.htm details
<Meta http-equiv="Refresh" Content="0.1; Url=http://....../top15_result.htm">
<body bgcolor=black></body>

Code:
public show_top15(param[])
{
	new id=param[0]
	new iMax = get_statsnum()
	new izStats[8], izBody[8]
	new iLen = 0

	if (iMax > 15)
		iMax = 15
	// modified by Rulzy
	new lNick[26], lKills[16], lDeaths[16], lHits[16], lShots[16], lHs[16], lEff[16], lAcc[16], name[128]

	format(lNick, 25, "%L", id, "NICK_ANSI")
	format(lKills, 15, "%L", id, "KILLS_ANSI")
	format(lDeaths, 15, "%L", id, "DEATHS_ANSI")
	format(lHits, 15, "%L", id, "HITS_ANSI")
	format(lShots, 15, "%L", id, "SHOTS_ANSI")
	format(lHs, 15, "%L", id, "HS_ANSI")
	format(lEff, 15, "%L", id, "EFF_ANSI")
	format(lAcc, 15, "%L", id, "ACC_ANSI")

	ucfirst(lEff)
	ucfirst(lAcc)


	new file = fopen("htm/top15_result.htm","wt")
	if(!file)
	{
		set_task(random_float(0.1, 0.3), "show_top15", id, param, 1)
		return
	}
	fprintf(file,"<html><head><body><style type=^"text/css^">")
	fprintf(file,"body{font-family:Arial,sans-serif;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}td{text-align=right}")
	fprintf(file,".header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}</style></head><body>")
	fprintf(file,"<table style='font-size:12px;'><tr class=^"header^"><th>#<th>%s<th>%s<th>%s<th>%s<th>%s<th>%s<th>%s<th>%s",lNick, lKills, lDeaths, lHits, lShots, lHs, lEff, lAcc)

	for (new i = 0; i < iMax && MAX_BUFFER_LENGTH - iLen > 0; i++)
	{
		get_stats(i, izStats, izBody, name, 127)
		replace_all(name, 127, "&","&amp;")
		replace_all(name, 127, "<","&lt;")
		replace_all(name, 127, ">","&gt;")
		fprintf(file,"<tr class=^"%s^">", i % 2 ? "one":"two")
		fprintf(file,"<td>%d<td style='text-align=left'>%s<td>%d<td>%d<td>%d<td>%d<td>%d<td>%3.1f%%<td>%3.1f%%", i + 1, name, izStats[STATS_KILLS], 
			izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
	}
	fprintf(file,"</table></body></html>")
	fclose(file)
	show_motd(id, "htm/top15.htm", "Top 15")
}
Attached Files
File Type: zip statsx.zip (10.1 KB, 36 views)
731 is offline
Reply


Thread Tools
Display Modes

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 11:12.


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