AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Table Align in MOTD (https://forums.alliedmods.net/showthread.php?t=106628)

hleV 10-17-2009 10:18

Table Align in MOTD
 
1 Attachment(s)
I'm working on some in-game ranking system for other games like HLDM, ESF, etc. and I need help with aligning stuff in MOTD. The MOTD doesn't support HTML so I have to play with text formatting.

PHP Code:

stock fnUpdateTop15()
{
        
g_szTop15[0] = 0;
 
        new 
iSize ArraySize(g_aSteamID), szSteamID[32], szName[32], iKillsiLen;
        
iSize iSize 15 15 iSize;
        
iLen formatex(g_szTop152047"%6s%22s%s^n^n""Rank""Name""Kills");
 
        for (new 
iRankiRank iSizeiRank++)
        {
                
ArrayGetString(g_aSteamIDiRankszSteamID31);
                
TrieGetString(g_tNameszSteamIDszName31);
                
TrieGetCell(g_tKillsszSteamIDiKills);
 
                
iLen += formatex(g_szTop15[iLen], 2047 iLen"%-7.2d%22s%6d^n"iRank 1szNameiKills);
        }


As you can see I've already made something about text formatting, but that doesn't fit my needs yet.

This is what I get:

Arkshine 10-17-2009 10:33

Re: Table Align in MOTD
 
Try : "%6s %-22.22s %6s^n^n"

hleV 10-17-2009 16:45

Re: Table Align in MOTD
 
The description line is fine. The problem is with players' kills being displayed in different places, as you can see in the image attached.

OneMoreLevel 10-17-2009 16:46

Re: Table Align in MOTD
 
Quote:

Originally Posted by hleV (Post 964770)
I'm working on some in-game ranking system for other games like HLDM, ESF, etc. and I need help with aligning stuff in MOTD. The MOTD doesn't support HTML so I have to play with text formatting.

PHP Code:

stock fnUpdateTop15()
{
        
g_szTop15[0] = 0;
 
        new 
iSize ArraySize(g_aSteamID), szSteamID[32], szName[32], iKillsiLen;
        
iSize iSize 15 15 iSize;
        
iLen formatex(g_szTop152047"%6s%22s%s^n^n""Rank""Name""Kills");
 
        for (new 
iRankiRank iSizeiRank++)
        {
                
ArrayGetString(g_aSteamIDiRankszSteamID31);
                
TrieGetString(g_tNameszSteamIDszName31);
                
TrieGetCell(g_tKillsszSteamIDiKills);
 
                
iLen += formatex(g_szTop15[iLen], 2047 iLen"%-7.2d%22s%6d^n"iRank 1szNameiKills);
        }


As you can see I've already made something about text formatting, but that doesn't fit my needs yet.

This is what I get:

Are you sure HL1 doesnt work with HTML, i tried it and it works fine. You just need to read from a file.

Arkshine 10-17-2009 17:08

Re: Table Align in MOTD
 
I was meant something : "%-7.2d %-22.22s %6d^n"

hleV 10-17-2009 17:13

Re: Table Align in MOTD
 
Quote:

Originally Posted by OneMoreLevel (Post 965095)
Are you sure HL1 doesnt work with HTML, i tried it and it works fine. You just need to read from a file.

Yes I am sure. In CS it works, but in HL it doesn't. I have no idea how did it work for you.
Quote:

Originally Posted by Arkshine (Post 965118)
I was meant something : "%-7.2d %-22.22s %6d^n"

Same thing. Everything is flawless except for the kills.

Arkshine 10-17-2009 17:37

Re: Table Align in MOTD
 
Did you try %-6.6d ?

hleV 10-17-2009 18:27

Re: Table Align in MOTD
 
Still nothing.

OneMoreLevel 10-18-2009 15:12

Re: Table Align in MOTD
 
Quote:

Originally Posted by hleV (Post 965123)
Yes I am sure. In CS it works, but in HL it doesn't. I have no idea how did it work for you.

Same thing. Everything is flawless except for the kills.


I think I know what your problem is. You are probably using Old VGUI tables, you need to use new ones, go to:

~ > Options > MultiPlayer > Menu type (something similar)

Change that to the one that doesnt say old style.

If it isnt on old style try reinstalling

hleV 10-18-2009 16:46

Re: Table Align in MOTD
 
What does it have to do with VGUI Menus? In HL options there's no such thing as setting old and new style of it.


All times are GMT -4. The time now is 22:32.

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