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

Played Time


Post New Thread Reply   
 
Thread Tools Display Modes
731
Member
Join Date: Aug 2006
Old 03-02-2022 , 05:21   Re: Played Time
Reply With Quote #171

I changed the /pttop15 display style
Code:
public show_top15(id)
{
	new i, count;
	static sort[33][2], maxPlayers;
	
	if(!maxPlayers) maxPlayers = get_maxplayers();
	
	for(i=1;i<=maxPlayers;i++)
	{
		sort[count][0] = i;
		sort[count][1] = TotalPlayedTime[i] + (get_user_time(i, 1) / 60);
		count++;
	}
	
	SortCustom2D(sort,count,"stats_custom_compare");
	
	const SIZE=2048
	new istate[4],msg[SIZE+1],len=0,players[32],num,pname[32],t;
	get_players(players,num);
	new b = clamp(count,0,15);
	
	//CS1.6
	len += format(msg[len], SIZE - len, "<head><META http-equiv=Content-Type content='text/html ;charset=UTF-8'></head><style>");
	
	len += format(msg[len], SIZE - len, "body{color:#FFCC99;background-color:black;margin-top:5}.A{background-color:#310000}.B{background-color:#630000}td{font-size:14px}");
	len += format(msg[len], SIZE - len, "</style><center><b><font size=4>Played Time Top 15</b><table width=500>");
	len += format(msg[len], SIZE - len, "<tr bgcolor=#9C0000><td><b>#</b></td><td><b>Name</b></td><td><b>Time</b></td>");
	
	for(new i=0;i<b;i++){
		t=sort[i][0];
		if (equal(istate,"A")) copy(istate,3,"B")
		else copy(istate,3,"A")
		get_user_name(t,pname,31);
		len += format(msg[len], SIZE - len, "<tr class=%s><td>%d.<td style='text-align=right'>%-22.22s<td style='text-align=right'>%d",istate,i+1,pname,sort[i][1]);
	}
	
	len += format(msg[len], SIZE - len, "</table><hr size=1 color=blue><font size=2>");
	
	show_motd ( id, msg, "Played-Time Top 15");
	
	return PLUGIN_CONTINUE;
}

Last edited by 731; 03-02-2022 at 05:25.
731 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 13:29.


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