Raised This Month: $ Target: $400
 0% 

Problem setting top10


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-16-2009 , 08:49   Problem setting top10
Reply With Quote #1

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.
CsIosefin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-16-2009 , 10:31   Re: Problem setting top10
Reply With Quote #2

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()
__________________
Bugsy is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-17-2009 , 09:59   Re: Problem setting top10
Reply With Quote #3

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.
CsIosefin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-17-2009 , 19:55   Re: Problem setting top10
Reply With Quote #4

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().
__________________
Bugsy is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-18-2009 , 10:13   Re: Problem setting top10
Reply With Quote #5

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.
CsIosefin is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 08-18-2009 , 12:34   Re: Problem setting top10
Reply With Quote #6

So are you asking a help for HTML? I did this in ZP Stats, there's a link in my sig.
SnoW is offline
Send a message via MSN to SnoW
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-18-2009 , 17:47   Re: Problem setting top10
Reply With Quote #7

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 is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-20-2009 , 16:02   Re: Problem setting top10
Reply With Quote #8

Anyone? Can someone help me?
CsIosefin is offline
xdanyx
Junior Member
Join Date: Oct 2008
Old 09-30-2009 , 19:12   Re: Problem setting top10
Reply With Quote #9

Quote:
Originally Posted by CsIosefin View Post
Anyone? Can someone help me?
Sure -> here
xdanyx 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 15:03.


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