Thread: html
View Single Post
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, 41 views)
731 is offline