No, no. I'm making an motd window INSIDE of my plugin, here I've done it now, it's functioning but not complete and I've used the code from Alka's new_style_rank to get it together
PHP Code:
public cmdShowRank(id)
{
static stats[8], stats2[4]
get_user_stats2(id, stats2);
static host_name[32];
get_cvar_string("hostname", host_name, 31);
static motd[1501], len;
len = format(motd, 1500,"<body bgcolor=#000000><font color=#87cefa><pre>");
//len += format(motd[len], 1500-len,"<center><img src=^"http://YourURLHere.com^"></center></img>");
len += format(motd[len], 1500-len,"<center><h4><font color=^"blue^"> Your statistics in '%s' </font></h4></center>", host_name);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Rank :</B> <font color=^"white^">%s </color></left>^n", RankNames[PlayerLevel[id]-2]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Kills :</B> <font color=^"white^"> %d</color></left>^n", stats[0]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Deaths :</B> <font color=^"white^"> %d</color></left>^n", stats[1]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Head Shots :</B> <font color=^"white^"> %d</color></left>^n", stats[2]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Damage :</B> <font color=^"white^"> %d</color></left>^n", stats[6]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Shots :</B> <font color=^"white^"> %d</color></left>^n", stats[4]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Hits ;</B> <font color=^"white^"> %d</color></left>^n", stats[5]);
len += format(motd[len], 1500-len,"<left><font color=^"blue^">----------------------------------</color></left>^n");
len += format(motd[len], 1500-len,"<left><font color=^"red^">Eff : <font color=^"white^"> %3.0f%%</color></left>^n", effec(stats));
len += format(motd[len], 1500-len,"<left><font color=^"red^">Acc : <font color=^"white^"> %3.0f%%</color></left>^n", accuracy(stats));
len += format(motd[len], 1500-len,"<left><font color=^"blue^">----------------------------------</color></left>^n^n");
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Defused Bombs :</B> <font color=^"white^">%d </color></left>^n", stats2[1]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Planted Bombs :</B> <font color=^"white^">%d </color></left>^n", stats2[2]);
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Exploded Bombs :</B> <font color=^"white^">%d </color></left>^n^n", stats2[3]);
show_motd(id, motd, "Your Rank");
return 0;
}
stock Float:accuracy(stats[8])
{
if(!stats[4])
return ( 0.0 );
new Float:result
result = 100.0 * float( stats[5] ) / float( stats[4] );
return (result > 100.0) ? 100.0 : result
}
stock Float:effec(stats[8])
{
if(!stats[0])
return ( 0.0 );
new Float:result
result = 100.0 * float( stats[0] ) / float( stats[0] + stats[1] );
return (result > 100.0) ? 100.0 : result
}
It shows my ranking fine, but it shows all others as 0, I've removed the lines
Quote:
new rank_pos = get_user_stats(id, stats, body);
new max_rank = get_statsnum();
|
because I don't want to show those ranks. I know I need the get_user_stats but I'm not sure how I add it back from this point.
__________________