Raised This Month: $ Target: $400
 0% 

Help with top15 MOTD


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
maNIaRO
Member
Join Date: Nov 2014
Old 05-01-2022 , 12:49   Help with top15 MOTD
Reply With Quote #1

Hi all,
I have a stats plugin with sql saving.
All good, but I want to improve a little bit the MOTD for /top15
I have 6 columns in the motd, first one is rank number, then nickname and so on.
I just want to add either in the same column with rank, or separate column between rank and name, an image for each row of the top15. Like separate image from csgo ranks.
Can you please help with what and/or how I should change?

Thanks

Code:
public GiveTopInformation(FailState, Handle:Query, Error[], Errcode, DataPlayer[], DataSize)
{
    new id, PlayerName2[32], Number[10], PlayerPoints, iMOTDPos, string[3036], iNumResults;
    
    id = DataPlayer[0], string[0] = EOS;
    iMOTDPos = format(string, charsmax(string), "<html><head><style>body{background:#FFF;font-family:Tahoma}th{background:#056B9E;color:#FFF;padding:3px;text-align:left;border-top:4px solid #3986AC}td{background:#CCCCCC;padding:2px 6px;border-bottom:1px dotted}table{color:#006699;background:#FFF;font-size:15px;border:2px solid #006699}</style></head><body><table width=100%% border=0 align=center cellpadding=0 cellspacing=1>");             
    iMOTDPos += format(string[iMOTDPos], charsmax(string)-iMOTDPos, "<center><img src='https://i.imgur.com/4kypRjN.png'></center><br/><tr><th>Rank<th>Nick<th>Points<th>Kills<th>Deaths<th>HS</tr>");
    iNumResults = SQL_NumResults(Query);

    if(iNumResults) 
    {
        for(new i; i < iNumResults; i++)
        {
            SQL_ReadResult(Query, 1, PlayerName2, charsmax(PlayerName2)), PlayerPoints = SQL_ReadResult(Query, 3), AddCommas(PlayerPoints, Number, charsmax(Number));
            iMOTDPos += format(string[iMOTDPos], charsmax(string)-iMOTDPos, "<tr><td>%d<td>%s<td>%s<td>#<td>#<td>#</tr>", i+1, PlayerName2, Number);
            SQL_NextRow(Query);
        }
    }
    copy(string[iMOTDPos], charsmax(string)-iMOTDPos, "</table><center><img src='https://i.imgur.com/XR2ZufG.png'></center></body></html>");
    show_motd(id, string, "PLOIESTI.LaLeagane.Ro");
    return PLUGIN_HANDLED;
}
maNIaRO 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 21:23.


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