Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

HLSDK(AG) Player list on hud
http://aghl.ru/forum/viewtopic.php?f=20&t=2654
Страница 1 из 1

Автор:  Gennaro-HL [ 12 апр 2017, 13:03 ]
Заголовок сообщения:  HLSDK(AG) Player list on hud

Hi, can anyone help me with this?
I want to generate a player list in a hud but it only generates 1 player
What am I doing wrong?
Is it possible to do so?

Код:
for (int i = 1; i <= gpGlobals->maxClients; i++)
      {
         CBasePlayer* pPlayerLoop = AgPlayerByIndex(i);// list players
         if (pPlayerLoop)
         {
            char s[100];
            sprintf(s, "%s", STRING(pPlayerLoop->pev->netname));// players name
            AgSay(pPlayerLoop, s, 0, 10, -1.0, 0.20, 5);//hud
         }
      }

Автор:  Lev [ 12 апр 2017, 18:51 ]
Заголовок сообщения:  Re: HLSDK(AG) Player list on hud

Message on the same coordinates replaces previous one.

Автор:  Gennaro-HL [ 13 апр 2017, 05:39 ]
Заголовок сообщения:  Re: HLSDK(AG) Player list on hud

If I change the coordinate to the message is not replaced by the other?

I want to have the same effect as this

Код:
new MaxPlayers;
public plugin_init()
{
   register_clcmd("say test", "Test")
   MaxPlayers = get_maxplayers()
}
public Test(id)
{
   new szMessage[32], szName[32], iLen;
   for(new i = 1; i <= MaxPlayers; i++)
   {
      if(is_user_connected(i))
      {
         get_user_name(i, szName, charsmax(szName))
         iLen += formatex(szMessage[iLen], charsmax(szMessage) - iLen, "%s^n", szName)   
      }
   }
   set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)
   show_hudmessage(id, "%s", szMessage)
}

Автор:  Lev [ 13 апр 2017, 08:28 ]
Заголовок сообщения:  Re: HLSDK(AG) Player list on hud

Messages displayed simultaneously is also limited, so you should place all the text in one string and display it. Like in your last post.

Страница 1 из 1 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/