Raised This Month: $ Target: $400
 0% 

Motd windows


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
187Ghost187
Junior Member
Join Date: May 2009
Old 06-06-2009 , 12:45   Re: Motd windows
Reply With Quote #3

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(idstats2);
    
    static 
host_name[32];
    
get_cvar_string("hostname"host_name31);
    
    static 
motd[1501], len;
    
    
len format(motd1500,"<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(idmotd"Your Rank");
    
    return 
0;
}

stock Float:accuracy(stats[8])
{
    if(!
stats[4])
        return ( 
0.0 );
    new 
Float:result
    result 
100.0 floatstats[5] ) / floatstats[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 floatstats[0] ) / floatstats[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.
__________________

Last edited by 187Ghost187; 06-06-2009 at 17:04. Reason: Indentation
187Ghost187 is offline
 



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:59.


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