AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem setting top10 (https://forums.alliedmods.net/showthread.php?t=100627)

CsIosefin 08-16-2009 08:49

Problem setting top10
 
Hey, I made a small plugin, at first, but we managed to arrange plugin. I want to be in the middle. With me not care if I can arrange one, thanks.
Script:
Code:

format_top10(sBuffer[2048])
{
        new iMax = get_statsnum()
        new izStats[8], izBody[8], t_sName[32]
        new iLen = 0

        if (iMax > 10)
        {
                iMax = 10;
        }

        iLen = format(sBuffer, 2047, "<center><body bgcolor=#000000><font color=#FFFFFF size=4 face=helvetica><pre>")
        iLen += format(sBuffer[iLen], 2047 - iLen, "%2s %22s %6s %6s %4s^n", "[Rank]", "[Nume]", "[Ucideri]", "[Decesuri]", "[HS]")
       
        for (new i = 0; i < iMax && 2047 - iLen > 0; i++)
        {
                get_stats(i, izStats, izBody, t_sName, 31)
                replace_all(t_sName, 31, "<", "[")
                replace_all(t_sName, 31, ">", "]")
                iLen += format(sBuffer[iLen], 2047 - iLen, "%-4.2d %22s %5.6d %6d %4d^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2])
        }
}

public cmdTop10(id)
{
        format_top10(g_sBuffer)
        show_motd(id, g_sBuffer, "Top 10")
        client_cmd(id,"spk ^"vox/deeoo user status^"")
       
        return PLUGIN_CONTINUE
}

Thank you, a good day.

Bugsy 08-16-2009 10:31

Re: Problem setting top10
 
You want to be in the middle? So basically you want players listed 1-4, you always be rank 5, and then show ranks 6-10?

Also, use formatex() instead of format()

CsIosefin 08-17-2009 09:59

Re: Problem setting top10
 
I want my top to be in the middle. Under [Rank] to be 1, 2, 3 or what rank you up to 10, under [Nume] I want to name player under [Ucideri] many of the killings and so on. And to be arranged, how to fix it, it does not really know how to walking around with code -22 or me know why.
And I use formatex () instead of format ()?
If you know you better, make me an example and put it in the middle if you want. Again, at first. Thanks for you answer. Good day.

Bugsy 08-17-2009 19:55

Re: Problem setting top10
 
I don't understand what you're trying to do. Ranks are already in order when read using get_stats(), how do you want them ordered? Sorry, your English is a bit hard to understand.

formatex() is faster\better than format().

CsIosefin 08-18-2009 10:13

Re: Problem setting top10
 
Okay I edited "formatex.
Code:

format_top10(sBuffer[2048])
{
    new iMax = get_statsnum()
    new izStats[8], izBody[8], t_sName[32]
    new iLen = 0

    if (iMax > 10)
    {
        iMax = 10;
    }

    iLen = formatex(sBuffer, 2047, "<center><body bgcolor=#000000><font color=#FFFFFF size=4 face=helvetica><pre>")
    iLen += formatex(sBuffer[iLen], 2047 - iLen, "%2s %22s %6s %6s %4s^n", "[Rank]", "[Nume]", "[Ucideri]", "[Decesuri]", "[HS]")
   
    for (new i = 0; i < iMax && 2047 - iLen > 0; i++)
    {
        get_stats(i, izStats, izBody, t_sName, 31)
        replace_all(t_sName, 31, "<", "[")
        replace_all(t_sName, 31, ">", "]")
        iLen += formatex(sBuffer[iLen], 2047 - iLen, "%-4.2d %22s %5.6d %6d %4d^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2])
    }
}

public cmdTop10(id)
{
    format_top10(g_sBuffer)
    show_motd(id, g_sBuffer, "Top 10")
    client_cmd(id,"spk ^"vox/deeoo user status^"")
   
    return PLUGIN_CONTINUE
}

I want to be arranged, as shown here look (deformed).
[IMG]http://img91.**************/img91/3848/tarep.jpg[/IMG]
Can you help him up? Thanks for the kindness you.

SnoW 08-18-2009 12:34

Re: Problem setting top10
 
So are you asking a help for HTML? I did this in ZP Stats, there's a link in my sig.

CsIosefin 08-18-2009 17:47

Re: Problem setting top10
 
This is not about HTML, as I put <center> know were else but here is the stage of arranging rankings but codes or how. I asked for help, I can handle, can somebody help me politely and ...
Thanks.

CsIosefin 08-20-2009 16:02

Re: Problem setting top10
 
Anyone? Can someone help me?

xdanyx 09-30-2009 19:12

Re: Problem setting top10
 
Quote:

Originally Posted by CsIosefin (Post 907071)
Anyone? Can someone help me?

Sure -> here


All times are GMT -4. The time now is 15:03.

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